phawind111 / google-cast-sdk

Automatically exported from code.google.com/p/google-cast-sdk
0 stars 0 forks source link

chrome.cast.media.MediaInfo does not accept image data URLs #719

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
Call chrome.cast.media.MediaInfo with a media parameter like 
data:image/png;base64,iVB...

Output is: Error code "invalid_parameter", error description "Invalid contentId 
in MediaInfo."

Should accept such images (if they fit into message bus size limits).

Original issue reported on code.google.com by werner.e...@gmail.com on 19 Dec 2015 at 8:43

GoogleCodeExporter commented 8 years ago
'data' is not a valid parameter for MediaInfo class, use contentType instead. 
Please see class description here: 
https://developers.google.com/cast/docs/reference/chrome/chrome.cast.media.Media
Info and example here: 
https://github.com/googlecast/CastHelloVideo-chrome/blob/master/helloVideos.js#L
326

Original comment by na...@google.com on 21 Dec 2015 at 11:18

GoogleCodeExporter commented 8 years ago
Sorry for not being detailed enough.
I was using a *data URL* https://tools.ietf.org/html/rfc2397

var media = "data:image/png;base64......";
var mimetype = "image/png";

var mediainfo = new chrome.cast.media.MediaInfo(media,mimetype);
var loadrequest = new chrome.cast.media.LoadRequest(mediainfo);
session.loadMedia(loadrequest,...);

Original comment by werner.e...@gmail.com on 23 Dec 2015 at 10:31

GoogleCodeExporter commented 8 years ago
We're reviewing this. 

Original comment by na...@google.com on 30 Dec 2015 at 7:53

GoogleCodeExporter commented 8 years ago
In the meantime i have implemented a custom receiver. I am now sending the data 
URL string via sendMessage to my receiver which in turns paints it into a 
canvas.

So the issue could be closed for my application. Initially i thought it would 
be nice to do the rendering in the client app and just send "screenshot" images 
to the standard receiver.

In any case, it could/should appear in the docs somewhere.

Many thanks, best wishes for 2016, from Germany.

Original comment by werner.e...@gmail.com on 2 Jan 2016 at 2:30