mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
3.0.5621.2
This commit is contained in:
parent
2e982826bb
commit
4e86a39f8c
25 changed files with 651 additions and 550 deletions
50
dashboard-ui/thirdparty/cordova/externalplayer.js
vendored
Normal file
50
dashboard-ui/thirdparty/cordova/externalplayer.js
vendored
Normal file
|
@ -0,0 +1,50 @@
|
|||
(function () {
|
||||
|
||||
function showPlayerSelectionMenu(item, url, mimeType) {
|
||||
|
||||
window.plugins.launcher.launch({
|
||||
uri: url,
|
||||
dataType: mimeType
|
||||
|
||||
}, function () {
|
||||
|
||||
console.log('plugin launch success');
|
||||
ExternalPlayer.onPlaybackStart();
|
||||
|
||||
}, function () {
|
||||
|
||||
console.log('plugin launch error');
|
||||
ExternalPlayer.onPlaybackStart();
|
||||
});
|
||||
}
|
||||
|
||||
function getExternalPlayers(url, mimeType) {
|
||||
|
||||
var deferred = $.Deferred();
|
||||
|
||||
window.plugins.launcher.canLaunch({
|
||||
uri: url,
|
||||
dataType: mimeType,
|
||||
getAppList: true
|
||||
}, function (data) {
|
||||
|
||||
console.log('plugin canLaunch succcess');
|
||||
var players = data.appList.map(function (p) {
|
||||
|
||||
});
|
||||
deferred.resolveWith(null, [players]);
|
||||
|
||||
}, function () {
|
||||
console.log('plugin canLaunch error');
|
||||
deferred.reject();
|
||||
});
|
||||
|
||||
deferred.resolveWith(null, [players]);
|
||||
|
||||
return deferred.promise();
|
||||
}
|
||||
|
||||
window.ExternalPlayer.getExternalPlayers = getExternalPlayers;
|
||||
window.ExternalPlayer.showPlayerSelectionMenu = showPlayerSelectionMenu;
|
||||
|
||||
})();
|
Loading…
Add table
Add a link
Reference in a new issue