-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.js
More file actions
40 lines (30 loc) · 890 Bytes
/
index.js
File metadata and controls
40 lines (30 loc) · 890 Bytes
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
import Clappr from 'clappr';
import './public/clappr-security-text.css'
const defaults = {
securityText: "<YOUR_SECURITY_TEXT>",
}
export default Clappr.UIContainerPlugin.extend({
name: 'security-text',
initialize: function () {
this.render();
},
bindEvents: function () {
this.listenTo(this.container, Clappr.Events.CONTAINER_PAUSE, this.hide);
this.listenTo(this.container, Clappr.Events.CONTAINER_PLAY, this.show);
},
hide: function () {
this.$el.hide();
},
show: function () {
this.$el.show();
},
render: function () {
const div = document.createElement('div');
div.className = "security-text-wrapper";
this.setElement(div);
console.log(this.$el);
this.$el.html(`<p>${this.options.securityText || defaults.securityText}</p>`);
this.container.$el.append(this.$el);
return this;
}
});