-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcontent3.js
More file actions
24 lines (17 loc) · 768 Bytes
/
content3.js
File metadata and controls
24 lines (17 loc) · 768 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
var vidLink = "https://moritz-riedel.de";
var counterOne = setInterval(functionOne, 150); //Alle 150ms wird geschaut ob Video abgespielt und Player aktiviert wurde
function functionOne(){
if (document.getElementById("mediaplayer")){
clearInterval(counterOne);
vidLink = document.getElementById("mediaplayer").src;
console.log(vidLink);
var button = document.createElement("button");
button.title="Download";
button.id ="downloadBtn";
button.setAttribute('type', 'button');
button.style ='font-size: 20px; cursor: pointer; display: block;';
button.innerText = ("Download");
button.onclick = function click(){window.open(vidLink);};
document.getElementById("toolbar-options").appendChild(button);
}
}