1
0
Fork 0
mirror of https://github.com/jellyfin/jellyfin-web synced 2025-03-30 19:56:21 +00:00
jellyfin-web/dashboard-ui/thirdparty/cordova/connectsdk.js

41 lines
921 B
JavaScript
Raw Normal View History

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);
})();