-
Notifications
You must be signed in to change notification settings - Fork 0
/
app.js
39 lines (34 loc) · 1014 Bytes
/
app.js
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
function initUI() {
const video = document.getElementById('video');
const ui = video['ui'];
ui.configure();
const controls = video['ui'].getControls();
const player = controls.getPlayer();
return { player, ui, controls };
}
async function play(player) {
// player...(async (..., ...) => {
// make football free
// });
player.configure({
drm: {
servers: {
'com.widevine.alpha': '...',
// 'com.widevine.alpha': '',
// 'com.apple.fps.1_0': '',
}
}
});
try {
await player.load(channel);
console.log('The video has now been loaded!');
} catch (e) {
// onError is executed if the asynchronous load fails.
console.error('Error code' + e.code + 'object' + e);
}
}
async function initApp() {
const { player } = initUI();
play(player);
}
document.addEventListener('shaka-ui-loaded', initApp);