125 lines
3.5 KiB
HTML
Executable File
125 lines
3.5 KiB
HTML
Executable File
<!DOCTYPE html>
|
|
<html style="width: 100vw; height: 100vh; margin: 0; padding: 0; background: #000; overflow: hidden;">
|
|
|
|
<head>
|
|
<meta charset="utf-8" />
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0">
|
|
<meta name="description" content="Tizen Mobile Web Basic Template" />
|
|
<title>Tizen Mobile Web Basic Application</title>
|
|
<link rel="stylesheet" type="text/css" href="css/style.css" />
|
|
<script type="text/javascript" src="$WEBAPIS/webapis/webapis.js"></script>
|
|
<script language="JavaScript" src="https://mule.jwrk.org/distribution/vokaPlayer.global.js"></script>
|
|
</head>
|
|
<body style="width: 100vw; height: 100vh; margin: 0; padding: 0; background: #000; overflow: hidden;">
|
|
<div id="my-video"></div>
|
|
</body>
|
|
|
|
<script language="JavaScript">
|
|
window.addEventListener('load', () => {
|
|
tizen.tvinputdevice.registerKey('MediaPlayPause');
|
|
tizen.tvinputdevice.registerKey('MediaRewind');
|
|
tizen.tvinputdevice.registerKey('MediaFastForward');
|
|
tizen.tvinputdevice.registerKey('MediaPlay');
|
|
tizen.tvinputdevice.registerKey('MediaPause');
|
|
tizen.tvinputdevice.registerKey('MediaStop');
|
|
tizen.tvinputdevice.registerKey('MediaTrackPrevious');
|
|
tizen.tvinputdevice.registerKey('MediaTrackNext');
|
|
tizen.tvinputdevice.registerKey('ArrowRight');
|
|
tizen.tvinputdevice.registerKey('ArrowLeft');
|
|
});
|
|
|
|
var player = spbtvplayer('my-video', {
|
|
log: true,
|
|
features: {
|
|
api: true,
|
|
drm: false,
|
|
metrics: true
|
|
},
|
|
apiConfig: {
|
|
channelId: 'hls-998f5396-c9dd-4a1e-82c7-0aec531fc015',
|
|
urlGetParams: 'minheight=400',
|
|
clientId: null,
|
|
movieId: null,
|
|
episodeId: null,
|
|
newsId: null,
|
|
apiHost: 'https://mule.jwrk.org',
|
|
},
|
|
uiConfig: {
|
|
initAsLive: true
|
|
},
|
|
globalOpts: {
|
|
uiLanguage: 'ru'
|
|
},
|
|
streamOpts: {
|
|
autoplay: true
|
|
},
|
|
controls: {
|
|
externalSubtitles: {
|
|
url: "https://raw.githubusercontent.com/videojs/video.js/c7298d40a4632a6e9dfcd5a2f5cc3bbe92a78744/docs/examples/elephantsdream/captions.ru.vtt",
|
|
lang: 'ru'
|
|
},
|
|
zoomButton: {
|
|
isVisible: true,
|
|
enable: true,
|
|
},
|
|
editing: {
|
|
enable: true,
|
|
},
|
|
},
|
|
});
|
|
player.afterInitialize(() => {
|
|
console.log("Initialized")
|
|
})
|
|
|
|
player.addEventListener('play', onPlay, window)
|
|
player.addEventListener('pause', onPause, window)
|
|
player.addEventListener('canplay', onCanPlay, window)
|
|
player.addEventListener('controlbarShow', onControlsShow, window)
|
|
player.addEventListener('controlbarHide', oncontrolsHide, window)
|
|
|
|
function onPlay() { console.log("on PLAY") }
|
|
|
|
function onPause() { console.log("on PAUSE") }
|
|
|
|
function onCanPlay() { console.log("on CANPLAY") }
|
|
|
|
function onControlsShow() { console.log("on onControlsShow") }
|
|
|
|
function oncontrolsHide() { console.log("on oncontrolsHide") }
|
|
|
|
function controlBarHide() {
|
|
player.setControlbarVisibility(false)
|
|
}
|
|
|
|
function controlBarShow() {
|
|
player.setControlbarVisibility(true)
|
|
}
|
|
|
|
function changeQualityAuto() {
|
|
player.setSelectedVideoQuality(-1)
|
|
}
|
|
|
|
function changeQualityLowest() {
|
|
player.setSelectedVideoQuality(0)
|
|
}
|
|
|
|
function changeQualityBest() {
|
|
var quality = player.getVideoQualityList()
|
|
player.setSelectedVideoQuality(quality.length - 1)
|
|
}
|
|
|
|
</script>
|
|
|
|
<script>
|
|
/*
|
|
if (webapis.avplay) {
|
|
webapis.avplay.setListener(listener);
|
|
webapis.avplay.open('https://test-streams.mux.dev/x36xhzz/x36xhzz.m3u8');
|
|
webapis.avplay.prepare();
|
|
webapis.avplay.play();
|
|
}
|
|
*/
|
|
</script>
|
|
|
|
</html>
|