ConnectSDK / Connect-SDK-Cordova-Plugin

Cordova/PhoneGap plugin for Connect SDK
Apache License 2.0
69 stars 46 forks source link

Chromecast: cannot display album art when playing media #20

Closed eunikolsky closed 9 years ago

eunikolsky commented 9 years ago

Comment for playMedia specifies iconUrl as a parameter to display an image for a media (https://github.com/ConnectSDK/Connect-SDK-Cordova-Plugin/blob/master/www/ConnectSDK.js#L1523). However, it doesn't work. Sample code, based on the Connect-SDK-Cordova-API-Sampler project:

url = "http://streaming.streamonomy.com/BeGoodRockMix";
mimeType = "audio/x-mpegurl";
options = {
    title: "Internet",
    description: "Radio",
    shouldLoop: false,
    iconURL: "http://ec2-54-201-108-205.us-west-2.compute.amazonaws.com/samples/media/earth-our-home2.jpg",
};
req = this.device.getMediaPlayer().playMedia(url, mimeType, options);

I've found two bugs:

  1. displayMediaCommon:type: method checks the url key instead of iconURL: https://github.com/ConnectSDK/Connect-SDK-Cordova-Plugin/blob/master/src/ios/ConnectSDKCordovaDispatcher.m#L972
  2. The test for iconUrl is inverted: https://github.com/ConnectSDK/Connect-SDK-Cordova-Plugin/blob/master/src/ios/ConnectSDKCordovaDispatcher.m#L973 It also seems to be completely useless.

TODO: check on Android