Files
TorrServerJellyfin/server/web/msx/pages/webos.html
2021-09-12 12:45:58 +03:00

72 lines
2.2 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<!DOCTYPE html>
<html>
<head>
<title>WebOS Interaction Plugin</title>
<meta charset="UTF-8" />
<meta name="author" content="kolsys" />
<meta name="copyright" content="kolsys" />
<script type="text/javascript" src="webOSTV-1.2.4.js"></script>
<script type="text/javascript" src="tvx-plugin.min.js"></script>
<script type="text/javascript">
const params = new URLSearchParams(document.location.search);
function WebOSPlay() {
try {
webOS.service.request('luna://com.webos.applicationManager', {
method: 'launch',
parameters: {
id: 'com.webos.app.videoplayer',
params: {
videoList: {
result: params.getAll('url').map(url => ({url: url})),
}
},
onSuccess: function (args) {
console.log('Success:', args);
TVXInteractionPlugin.executeAction('back');
},
onFailure: function (args) {
console.log('Failed to open Video Player', args);
TVXInteractionPlugin.executeAction('error:Failed to open Video Player');
}
},
});
} catch(e) {
console.log('ERROR', e);
TVXInteractionPlugin.executeAction('error:Failed to open Video Player ' + e.getMessage());
}
}
function WebOSHandler() {
this.ready = function() {
WebOSPlay();
};
this.handleRequest = function(dataId, data, callback) {
if (dataId == 'init') {
callback({
type: 'pages',
headline: 'WebOS Player',
pages: [{
items: [{
type: 'default',
layout: '0,0,12,6',
color: 'msx-glass',
text: 'Opening webOS Media Player...'
}]
}]
});
return true;
}
return false;
};
}
window.onload = function() {
TVXInteractionPlugin.setupHandler(new WebOSHandler());
TVXInteractionPlugin.init();
};
</script>
</head>
<body>
</body>
</html>