-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
42 lines (41 loc) · 1.07 KB
/
index.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
40
41
42
for (var i = 0; i < __oplayers__.length; i++) {
var o = __oplayers__[i]
var plugins = [
OUI({
theme: {
primaryColor: o['theme'],
controller: {
header: o.title,
slideToSeek: 'always',
},
},
screenshot: +o['screenshot'],
subtitle: o['subtitle'] ? { source: [{ src: o['subtitle'], default: true, name: 'default' }] } : undefined,
thumbnails: o['thumbnails']
? {
src: o['thumbnails'],
number: o['thumbnailsCount'],
}
: undefined,
}),
OHls({
forceHLS: true,
library: 'https://cdn.jsdelivr.net/npm/hls.js@0.14.17/dist/hls.min.js',
}),
ODash({ library: 'https://cdn.dashjs.org/latest/dash.all.min.js' }),
]
OPlayer.make(document.getElementById('player' + o['id']), {
source: {
src: o['src'],
poster: o['poster'],
title: o['title'],
},
loop: +o['loop'],
volume: o['volume'],
autoplay: +o['autoplay'],
autopause: +o['autopause'],
isLive: +o['live'],
})
.use(plugins)
.create()
}