1
0
Fork 0
mirror of https://github.com/jellyfin/jellyfin-web synced 2025-03-30 19:56:21 +00:00

hls updates

This commit is contained in:
Luke Pulverenti 2015-05-21 16:53:14 -04:00
parent 3beaf88745
commit 9e470c9f94
21 changed files with 315 additions and 164 deletions

View file

@ -8,7 +8,13 @@
ajax: function(request) {
return jQuery.ajax(request);
try {
return jQuery.ajax(request);
} catch (err) {
var deferred = DeferredBuilder.Deferred();
deferred.reject();
return deferred.promise();
}
}
};

View file

@ -483,7 +483,7 @@
});
}
function onDisconnected() {
currentWebAppSession = null;
currentPairedDeviceId = null;
@ -491,23 +491,26 @@
}
function launchWebApp(device) {
device.getWebAppLauncher().launchWebApp(ApplicationID).success(function (session) {
console.log('launchWebApp success. calling onSessionConnected');
// First try to join existing session. If it fails, launch a new one
device.getWebAppLauncher().joinWebApp(ApplicationID).success(function (session) {
console.log('joinWebApp success. calling onSessionConnected');
onSessionConnected(device, session);
}).error(function (err) {
console.log('launchWebApp error: ' + JSON.stringify(err) + '. calling joinWebApp');
console.log('joinWebApp error: ' + JSON.stringify(err) + '. calling joinWebApp');
device.getWebAppLauncher().joinWebApp(ApplicationID).success(function (session) {
device.getWebAppLauncher().launchWebApp(ApplicationID).success(function (session) {
console.log('joinWebApp success. calling onSessionConnected');
console.log('launchWebApp success. calling onSessionConnected');
onSessionConnected(device, session);
}).error(function (err1) {
console.log('joinWebApp error:' + JSON.stringify(err1));
console.log('launchWebApp error:' + JSON.stringify(err1));
});