-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsimple.js
49 lines (46 loc) · 1 KB
/
simple.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
43
44
45
46
47
48
49
ChimeePlayer.install(ChimeeSnapshot)
const snapshotContainer = document.querySelector('.snapshot-container')
var player = new ChimeePlayer({
wrapper: '.chimee-container',
src: './1.mp4',
isLive: false,
box:'native',
autoplay: false,
controls: true,
autoplay: true,
width: 640,
height: 360,
plugin: [{
name: ChimeeSnapshot.name,
// watermark: {
// text: 'chimee-plugin-snapshot',
// x: -300,
// y: -100,
// rotate: 15,
// fontColor: 'rgba(255, 255, 255, 0.5)',
// fontSize: 22
// },
watermark: {
image: './chimee-logo.png',
x: -140,
y: -70,
opacity: 0.8,
rotate: 10
},
snapshotted(snapshot) {
const image = new Image()
image.src = snapshot.src
snapshotContainer.appendChild(image)
console.log(snapshot)
}
}]
})
let count = 0
const timer = setInterval(() => {
if (count >= 10) {
clearTimeout(timer)
return false
}
player.$plugins.snapshot.takeSnapshot()
count++
}, 1000)