-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.html
42 lines (41 loc) · 1.35 KB
/
index.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
<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<title>Clappr Emoji Chat Plugin Demo</title>
</head>
<body>
<div id="player"></div>
<script type="text/javascript" charset="utf-8">
window.onload = function() {
player = new Clappr.Player({
source: 'http://techslides.com/demos/sample-videos/small.mp4',
parentId: '#player',
emojiChat: {
onClick: EmojiClickHandler,
// bottom: true,
// emojis: [
// 'like',
// 'doubt',
// 'haha',
// ]
},
mediaControlDisabled: true,
plugins: [EmojiChatPlugin]
});
// console.log(new EmojiChatPlugin)
function EmojiClickHandler (emoji) {
console.log(emoji + ' was clicked'); // haha was clicked
// Do your own operation here
}
player.on(Clappr.Events.PLAYER_PLAY, () => {
player.getPlugin('media_control').disable();
player.getPlugin('EmojiChatPlugin').updateViewCount(11);
player.getPlugin('EmojiChatPlugin').updateEmojiCount('haha', 10);
});
}
</script>
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/clappr@latest/dist/clappr.min.js"></script>
<script type="text/javascript" charset="utf-8" src="./dist/clappr-emoji-chat.js"> </script>
</body>
</html>