-
Notifications
You must be signed in to change notification settings - Fork 19
/
Copy pathembed.html
74 lines (66 loc) · 1.58 KB
/
embed.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
<!DOCTYPE html>
<head>
<meta name="viewport"
content="height=device-height, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no, minimal-ui" />
<title>AwayFL Embedded Player __VERSION__</title>
<style>
* {
margin: 0;
padding: 0;
}
canvas {
outline: none
}
html, body, #container {
margin: 0;
overflow: hidden;
width: 100%;
height: 100%;
}
#splash__image {
width: 100%;
height: 100%;
position: absolute;
background-size: contain;
background-position: center;
background-repeat: no-repeat;
visibility: visible;
transition: all 0.5s;
z-index: 10;
}
#progress__root {
position: absolute;
}
#progress__line {
width: 0;
height: 100%;
transition: all 0.5s;
}
</style>
<script src="__LOADER_URL__"></script>
</head>
<body>
<div id="splash__image">
<div id="progress__root">
<div id="progress__line"></div>
</div>
</div>
<script>
window.addEventListener("load", () => {
const config = JSON.parse(__GAME_CONFIG__);
AWAYFL.LegacyLoader.init(config);
AWAYFL.LegacyLoader.runGame((fill) => {
window.dispatchEvent(new CustomEvent('awayfl-player-progress', {detail: fill}));
}, (config, hideLoader) => {
const player = new AWAYFL.Player(document, config);
window.dispatchEvent(new CustomEvent('awayfl-player-init', {detail: player}));
player
.loadAndPlay()
.then((_, hide) => {
window.dispatchEvent(new CustomEvent('awayfl-player-load'));
hide && hide() || window.swfParseComplete && window.swfParseComplete();;
});
})
});
</script>
</body>