-
Notifications
You must be signed in to change notification settings - Fork 5
/
script.js
111 lines (93 loc) · 3.9 KB
/
script.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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
function getparam(a,e){return e||(e=window.location.href),new URL(e).searchParams.get(a)}
let s=a=>document.getElementById(a);
function getIdFromUrl(url) { return url.match(/[-\w]{25,}/); }
let apikey = 'AIzaSyD739-eb6NzS_KbVJq1K8ZAxnrMfkIqPyw';
let get=()=>{
getbase();
}
let getbase=()=>{
let ply = [];
/*
ply.videourl = `https://www.googleapis.com/drive/v3/files/${getIdFromUrl(s('videourl').value) }?alt=media&key=${apikey}`;
let poster = "";
if(s('posterurl').value){
poster = s('posterurl').value ;}
else {
poster = 'https://lh3.googleusercontent.com/d/'+getIdFromUrl(s('videourl').value);
}*/
ply.posterurl = s('posterurl').value ;
ply.id = s('videourl').value;
// ply.videotitle = s('videotitle').value;
console.log(ply);
var arr = JSON.stringify(Object.assign({}, ply))
console.log(btoa(arr));
window.base =btoa(arr);
iframe();
console.log(btoa(arr))
return btoa(arr);
}
//Player Openers (diff. func. coding intentionally)
let openplyr=()=> { window.open('https://sh20raj.github.io/VideoPlyr/plyr.html?id='+base)}
let openfluid=()=> { window.open('https://sh20raj.github.io/VideoPlyr/fluid.html?id='+base)}
let openafterglow=()=> { window.open('https://sh20raj.github.io/VideoPlyr/afterglow.html?id='+base)}
let openmediaelements=()=> { window.open('https://sh20raj.github.io/VideoPlyr/mediaelements.html?id='+base)}
let openvlitejs=()=> { window.open('https://sh20raj.github.io/VideoPlyr/vlitejs.html?id='+base)}
let opensp=()=> { window.open('https://sh20raj.github.io/VideoPlyr/sopplayer.html?id='+base)}
let pmsg = 'Copy Embed Code' ;
//Player Embedders
let embedplyr=()=> {
prompt(pmsg,`<iframe width="560" height="315"
scrolling="no"
src="https://sh20raj.github.io/VideoPlyr/plyr.html?id=${base}"
frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media;
gyroscope; picture-in-picture" allowfullscreen>
</iframe>`)
}
let embedfluid=()=> {
prompt(pmsg,`<iframe width="560" height="315"
scrolling="no"
src="https://sh20raj.github.io/VideoPlyr/fluid.html?id=${base}"
frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media;
gyroscope; picture-in-picture" allowfullscreen>
</iframe>`)
}
let embedafterglow=()=> {
prompt(pmsg,`<iframe width="560" height="315"
scrolling="no"
src="https://sh20raj.github.io/VideoPlyr/afterglow.html?id=${base}"
frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media;
gyroscope; picture-in-picture" allowfullscreen>
</iframe>`)
}
let embedmediaelements=()=> {
prompt(pmsg,`<iframe width="560" height="315"
scrolling="no"
src="https://sh20raj.github.io/VideoPlyr/mediaelements.html?id=${base}"
frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media;
gyroscope; picture-in-picture" allowfullscreen>
</iframe>`)
}
let embedvlitejs=()=> {
prompt(pmsg,`<iframe width="560" height="315"
scrolling="no"
src="https://sh20raj.github.io/VideoPlyr/vlitejs.html?id=${base}"
frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media;
gyroscope; picture-in-picture" allowfullscreen>
</iframe>`);
}
let embedsp=()=> {
prompt(pmsg,`<iframe width="560" height="315"
scrolling="no"
src="https://sh20raj.github.io/VideoPlyr/sopplayer.html?id=${base}"
frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media;
gyroscope; picture-in-picture" allowfullscreen>
</iframe>`);
}
let iframe=()=> {
s('afterglow').src= 'https://sh20raj.github.io/VideoPlyr/afterglow.html?id='+base;
s('fluid').src='https://sh20raj.github.io/VideoPlyr/fluid.html?id='+base;
s('plyr').src='https://sh20raj.github.io/VideoPlyr/plyr.html?id='+base;
s('vlitejs').src='https://sh20raj.github.io/VideoPlyr/vlitejs.html?id='+base;
s('mediaelements').src='https://sh20raj.github.io/VideoPlyr/mediaelements.html?id='+base;
s('sopplayer').src='https://sh20raj.github.io/VideoPlyr/sopplayer.html?id='+base;
}