I'm trying to test some chromecast examples using chrome, but can't see the chromecast in the available receiver list for my APP-ID.
This is my situation,
My chromecast device is whitelisted. I received my APP-ID associated with my receiver urls.
I can get access to my receiver url, using the browser and it is exactly the same url associated with my App ID.
The receiver.html has something like this:
var receiver = new cast.receiver.Receiver( 'APP-ID', ['Test'], "", 5);
The APP-ID is the one I received when I whitelisted the chromecast device.
The receiver.html is hosted with a public ip. It is accessible for everyone.
The sender.html:
var appId = "APP-ID";
$window.addEventListener("message", function(event) {
if (event.source == window && event.data && event.data.source == "CastApi" && event.data.event == "Hello") { $log.info("CastApi Hello message received!"); initializeApi(); }
});
var initializeApi = function() {
cast_api = new cast.Api(); cast_api.addReceiverListener(appId, **onReceiverList**);
};
var onReceiverList = function(list) {
$scope.receivers = list; var fn = list.length ? $log.info : $log.warn; fn("Receivers: ", list); $scope.$apply();
};
THE PROBLEM is the receiver list is always empty!!!
The sender.html is hosted in my localhost server and I whitelisted it with the word "localhost" in the option page of chromecast extension.
I check the option "Send this Chromecast's serial number when checking for updates" when I was setting up the chromecast the first time with Chrome (No Android). I'm able to access to debug mode using the url http://MY-CHROMECAST-IP*:9222 so I'm sure it's working.
Don't know what I am missing.
Someone could help me?