-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathplayer.html
92 lines (87 loc) · 2.29 KB
/
player.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
<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
<meta http-equiv="Referrer-Policy" content="no-referrer" />
<meta name="referrer" content="no-referrer" />
<meta name="viewport" content="width=device-width,initial-scale=1" />
<base href="/"/>
<link rel="icon" type="image/x-icon" href="favicon.ico" />
<link rel="stylesheet" type="text/css" href="lib/jsdos/js-dos.css" />
<script type="text/javascript" src="lib/ruffle/ruffle.js"></script>
<script type="text/javascript" src="lib/jsdos/js-dos.js"></script>
<title>WhiteSpider™</title>
<style type="text/css">
@import url("common.css");
embed, ruffle-player {
position: absolute;
display: block;
width: 100%;
height: 100%;
border: none;
overflow: hidden;
}
body>div {
position: absolute;
width: 100%;
height: 100%;
overflow: hidden;
}
</style>
</head>
<body>
<script type="text/javascript">
// <![CDATA[
"use strict"; (() => {
const location = new URL(window.location.href);
const type = location.searchParams.get("type") || "";
const url = location.searchParams.get("url") || "";
if (type.length === 0 || url.length === 0) {
console.error("Player: Missing required parameters.");
return;
}
window.focus();
emulators.pathPrefix = "/lib/jsdos/";
RufflePlayer.config = Object.freeze(Object.create(null));
switch (parseInt(type, 10)) {
case 1:
{
const player = RufflePlayer.newest().createPlayer();
document.body.appendChild(player);
player.load({
url: url,
scale: "showAll",
quality: "best",
autoplay: "auto",
logLevel: "warn",
letterbox: "on",
openUrlMode: "confirm",
upgradeToHttps: true,
// backgroundColor: "#000000"
});
}
break;
case 2:
{
const frame = document.createElement("div");
document.body.appendChild(frame);
Dos(frame).run(url);
}
break;
default:
{
const frame = document.createElement("embed");
frame.type = "text/plain";
frame.width = "1024";
frame.height = "768";
frame.src = url;
document.body.appendChild(frame);
}
break;
}
})();
// ]]>
</script>
</body>
</html>