ChrisRidings / CastV2inPHP

Chromecast CastV2 implementation in PHP - control Chromecasts
41 stars 12 forks source link

Include image with audiocast #4

Open svenove opened 6 years ago

svenove commented 6 years ago

"urn:x-cast:com.google.cast.media" supports including images with the message: https://developers.google.com/cast/docs/reference/messages#GenericMediaMetadata

It should be added here: https://github.com/ChrisRidings/CastV2inPHP/blob/master/CCDefaultMediaPlayer.php#L15

But I'm not quite sure on the correct syntax... Would it be something like this? $json = '{"type":"LOAD","media":{"contentId":"' . $url . '","streamType":"' . $streamType . '","contentType":"' . $contentType . '", "metadata":{"metadataType":0, "images":['http://www.google.com/image.png']}},"autoplay":' . $autoPlay . ',"currentTime":' . $currentTime . ',"requestId":921489134}';

ChrisRidings commented 6 years ago

I'm not at a machine to test and a bit short on time, but search google suggests:

    metadata: {
      metadataType: 0,
      title: "Big Buck Bunny", 
      images: [
        { url: 'http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/images/BigBuckBunny.jpg' }
      ]
    } 

In the place you've put it should be fine.