-
Notifications
You must be signed in to change notification settings - Fork 23
/
index.html
124 lines (113 loc) · 3.23 KB
/
index.html
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
112
113
114
115
116
117
118
119
120
121
122
123
124
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Drive Video Player</title>
<link rel="shortcut icon" href="https://bit.ly/samplefavicon" type="image/x-icon">
<meta name='google-adsense-platform-account' content='ca-host-pub-1556223355139109'/>
<meta name='google-adsense-platform-domain' content='blogspot.com'/>
</head>
<body>
<style>
body {
padding: 0;
margin: 0;
}
video {
width: 100%;
height: 100%;
position: absolute;
}
.embed {
position: absolute;
background: none;
top: 2px;
z-index: 999;
color: aqua;
font-family: sans-serif;
font-size: 18px;
border: 0;
font-weight: 600;
right: 10px;
}
</style>
<script src="https://cdn.fluidplayer.com/v3/current/fluidplayer.min.js">
</script>
<script>
var apikey = "AIzaSyAHIDPKFSVbDwk-NdlAW8n3uh2q6AJkyAA";//Your Drive Api Key
var eid="";
var video="";
var embed="";
if(!getParameterByName('id') || getParameterByName('ib')){
var eid = prompt('Enter Drive Video ID :- ');
embed = `
<iframe width="560" height="315"
scrolling="no"
src="${location.href}?id=${eid}"
frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media;
gyroscope; picture-in-picture" allowfullscreen>
</iframe>
`;
prompt('Here is Your Embed Code :- ',embed);
window.location.href = window.location.href+'?id='+eid;
}
video = getParameterByName('id') ;
if(getParameterByName('ib')){
video = btoa(getParameterByName('ib'));
}
var vidurl = "https://www.googleapis.com/drive/v3/files/"+video+"?alt=media&key="+apikey;
document.write("<video controls id='video' src="+vidurl+"></video>");
function getembed(){
var code = `
<iframe width="560" height="315"
scrolling="no"
src="${location.href}?id=${video}"
frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media;
gyroscope; picture-in-picture" allowfullscreen>
</iframe>
`;
prompt('Here is Your Embed Code :- ',code);
}
function getParameterByName(name, url = window.location.href) {
name = name.replace(/[\[\]]/g, '\\$&');
var regex = new RegExp('[?&]' + name + '(=([^&#]*)|&|#|$)'),
results = regex.exec(url);
if (!results) return null;
if (!results[2]) return '';
return decodeURIComponent(results[2].replace(/\+/g, ' '));
}
</script>
<script>
var myFP = fluidPlayer(
'video', {
"layoutControls": {
"controlBar": {
"autoHideTimeout": 3,
"animated": true,
"autoHide": true
},
"htmlOnPauseBlock": {
"html": '<button class=\"embed\" onclick=\"getembed()\">Embed</button>\n',
"height": null,
"width": null
},
"autoPlay": true,
"mute": true,
"allowTheatre": true,
"playPauseAnimation": true,
"playbackRateEnabled": true,
"allowDownload": false,
"playButtonShowing": true,
"fillToContainer": false,
"posterImage": ""
},
"vastOptions": {
"adList": [],
"adCTAText": false,
"adCTATextPosition": ""
}
})
</script>
</body>
</html>