-
Notifications
You must be signed in to change notification settings - Fork 0
/
content.js
49 lines (30 loc) · 1.47 KB
/
content.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
$("head").append('<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css">');
$("body").append('<div style="display:none" id="modal-iframe"><i class="fa fa-times-circle closestream" aria-hidden="true"></i><div class="cont"></div></div>');
$("#modal-iframe").draggable();
var intervalId = null;
var varCounter = 0;
var varName = function(){
if(varCounter <= 3) {
var thingy = '<button type="button" class="thing stream"><span><i class="fa fa-video-camera" aria-hidden="true"></i></span></button>';
//var thingy = thingy.concat('<button type="button" class="thing shrug"><span><i class="fa fa-smile-o" aria-hidden="true"></i></span></button>');
$(".thing").remove();
$(".header-toolbar").prepend(thingy);
varCounter++;
/* your code goes here */
} else {
clearInterval(intervalId);
}
};
$(document).ready(function(){
intervalId = setInterval(varName, 10000);
});
$(document).on("click",".stream",function(){
//alert("triggo");
$("#modal-iframe div.cont").html('<video controls autoplay width="100%"> <source src="VIDEO_URL_HERE" type="video/webm"> Your browser does not support the video tag.</video>');
$("#modal-iframe").fadeIn();
});
$(document).on("click",".closestream",function(){
//alert("triggo");
$("#modal-iframe div.cont").html('');
$("#modal-iframe").fadeOut();
});