On Chrome mobile, when creating a new ApiConfig the receiver listener does not even fire. I created a webapp over a year ago that uses Chromecast Sender App API and it worked just fine on desktop and mobile Chrome. I could cast the videos from the webapp and control playback, etc. Now on mobile Chrome it fails to load a receiver while on the desktop it still works as intended. Nothing in my code has changed so I used the demo, CastHelloVideo https://github.com/googlecast/CastHelloVideo-chrome, to touble shoot.
//code from CastHelloVideo
var apiConfig = new chrome.cast.ApiConfig(sessionRequest, sessionListener, receiverListener);
chrome.cast.initialize(apiConfig, onInitSuccess, onError);
...
function receiverListener(e) {
appendMessage('receiverListener()'); //never called
if (e === 'available') {
console.log('receiver found'); //never called
appendMessage('receiver found'); //never called
}
else {
console.log('receiver list empty'); //never called
appendMessage('receiver list empty'); //never called
}
}
//receiverListener never gets called yet onInitSuccess does
So, either the Chromecast SDK has changed and it is not backwards compatible with mobile Chrome or the Chromecast SDK does not support mobile anymore even though it's still documented that it does. Or I am totally missing something.
Any ideas?