-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathembed.html
More file actions
43 lines (42 loc) · 1.25 KB
/
embed.html
File metadata and controls
43 lines (42 loc) · 1.25 KB
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
<!DOCTYPE html>
<html>
<head>
<title></title>
<style>
*{
margin: 0;
padding: 0;
box-sizing: border-box;
}
html{
overflow: hidden;
}
html,body{
width: 100%;
height: 100%;
}
</style>
<link rel="stylesheet" href="./css/mediaviewer.css"/>
<link rel="stylesheet" href="./css/mediaviewer-mobile.css"/>
</head>
<body>
<div class="embed"></div>
<script type="module">
import {startup, VideoPlayer} from './js/mediaviewer.js';
import {resizeEmbed} from './js/mediaviewer-tools.js';
const videoID = new URLSearchParams(window.location.search),
data = JSON.parse(localStorage.getItem(`embed_${videoID.get('v')}`));
if(!data) throw new Error('[MediaViewer]: Embed code is not found');
startup();
new VideoPlayer('.embed',{
embed: true,
poster: '',
playlists:[data['playlists'][0]],
controls: true,
loop: true,
tracks: data['playlists'][0]['tracks']
});
resizeEmbed();
</script>
</body>
</html>