-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathPlayer.js
23 lines (20 loc) · 1009 Bytes
/
Player.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
function getViD(){
url=document.location.href;
start=url.indexOf('v=')+2;
end=url.indexOf('&',start);
if (end==-1)end=url.length;
return url.substring(start, end);
}
function setURL(){
//'&iv_load_policy='+localStorage.anno+'&cc_load_policy='+localStorage.cc+'&disablekb='+localStorage.kb+'&hd='+localStorage.hd+'&loop='+localStorage.loop+'&rel='+localStorage.rel+
document.getElementById('holder').src='http://www.youtube.com/embed/'+ getViD() +'?controls='+localStorage.controls+'&autohide='+localStorage.hide+'&autoplay='+localStorage.play+'&fs='+localStorage.fs+'&modestbranding='+localStorage.brand+'&showinfo='+localStorage.info;
//document.getElementById('holder').width=localStorage.width+"px";
//document.getElementById('holder').height=localStorage.height+"px";
};
function onLoad(){
if (localStorage.length!=6){
chrome.tabs.create({'url':chrome.extension.getURL("Options.html")});
setTimeout(setURL,3000);
}else setURL();
};
document.addEventListener('DOMContentLoaded', onLoad);