2015-05-18 12:40:20 -04:00
|
|
|
|
(function () {
|
|
|
|
|
|
|
|
|
|
|
2015-05-18 18:23:03 -04:00
|
|
|
|
function onDeviceFound(e) {
|
2015-05-18 12:40:20 -04:00
|
|
|
|
|
2015-05-18 18:23:03 -04:00
|
|
|
|
console.log('device found');
|
2015-05-18 12:40:20 -04:00
|
|
|
|
}
|
|
|
|
|
|
2015-05-18 18:23:03 -04:00
|
|
|
|
function onDeviceLost(e) {
|
2015-05-18 12:40:20 -04:00
|
|
|
|
|
2015-05-18 18:23:03 -04:00
|
|
|
|
console.log('device lost');
|
2015-05-18 12:40:20 -04:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function initSdk() {
|
|
|
|
|
|
|
|
|
|
var manager = ConnectSDK.discoveryManager;
|
|
|
|
|
|
|
|
|
|
manager.setPairingLevel(ConnectSDK.PairingLevel.OFF);
|
|
|
|
|
manager.setAirPlayServiceMode(ConnectSDK.AirPlayServiceMode.Media);
|
|
|
|
|
|
|
|
|
|
// Show devices that support playing videos and pausing
|
2015-05-18 18:23:03 -04:00
|
|
|
|
//manager.setCapabilityFilters([
|
|
|
|
|
// new ConnectSDK.CapabilityFilter(["MediaPlayer.Display.Video", "MediaControl.Pause"])
|
|
|
|
|
//]);
|
2015-05-18 12:40:20 -04:00
|
|
|
|
|
|
|
|
|
manager.addListener('devicefound', onDeviceFound);
|
|
|
|
|
manager.addListener('devicelost', onDeviceLost);
|
|
|
|
|
|
2015-05-18 18:23:03 -04:00
|
|
|
|
manager.startDiscovery();
|
|
|
|
|
|
2015-05-18 12:40:20 -04:00
|
|
|
|
requirejs(['thirdparty/cordova/chromecast']);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
document.addEventListener("deviceready", function () {
|
|
|
|
|
|
|
|
|
|
initSdk();
|
|
|
|
|
|
|
|
|
|
}, false);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
})();
|