-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbien2.html
65 lines (57 loc) · 2.19 KB
/
bien2.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
<html>
<head>
<meta name="referrer" content="no-referrer" />
<title>bien sport 2</title>
<script src="https://cdnjs.cloudflare.com/ajax/libs/shaka-player/4.3.6/shaka-player.ui.min.js" crossorigin="anonymous"></script>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/shaka-player/4.3.6/controls.min.css" crossorigin="anonymous" />
</script>
<body bgcolor='black' style='margin:0'>
</script>
</head>
<body>
<center>
<div data-shaka-player-container style='width: 100%; height: 100%'>
<video autoplay data-shaka-player id='video' style='width:100%;height:100%;'></video>
</div>
</center>
<script>
const manifestUri = "https://linearjitp-playback.astro.com.my/hls-mp4-fp/linear/5066/default.m3u8";
async function init() {
const video = document.getElementById('video');
const ui = video['ui'];
const controls = ui.getControls();
const player = controls.getPlayer();
window.player = player;
window.ui = ui;
player.configure({
drm: {
"clearKeys": {
'39c175581e237eff9559607eb9b23c10': '5102b12aac7756c65dcb46a101d960d3'
}
}
});
player.addEventListener('error', onPlayerErrorEvent);
controls.addEventListener('error', onUIErrorEvent);
try {
await player.load(manifestUri);
console.log('The video has now been loaded!');
} catch (error) {
onPlayerError(error);
}}
function onPlayerErrorEvent(errorEvent) {
onPlayerError(event.detail);
}
function onPlayerError(error) {
console.error('Error code', error.code, 'object', error);
}
function onUIErrorEvent(errorEvent) {
onPlayerError(event.detail);
}
function initFailed(errorEvent) {
console.error('Unable to load the UI library!');
}
document.addEventListener('shaka-ui-loaded', init);
document.addEventListener('shaka-ui-load-failed', initFailed);
</script>
</body>
</html>