forked from nettleweb/nettleweb
-
Notifications
You must be signed in to change notification settings - Fork 0
/
player.html
77 lines (72 loc) · 1.92 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
<?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>Frame0</title>
<style type="text/css">
@import url("common.css");
embed, ruffle-embed, ruffle-player {
position: absolute;
display: block;
width: 100%;
height: 100%;
border: none;
}
#frame {
position: absolute;
width: 100%;
height: 100%;
}
</style>
</head>
<body>
<script type="text/javascript">
"use strict";
// <![CDATA[
(() => {
const location = new URL(window.location.href);
const url = location.searchParams.get("url") || "";
if (url.length === 0) {
console.warn("No URL specified");
return;
}
switch (location.searchParams.get("type")) {
case "flash": {
const ruffle = window.RufflePlayer.newest();
const player = ruffle.createPlayer();
document.body.appendChild(player);
player.load(url);
break;
}
case "dos": {
const frame = document.createElement("div");
frame.id = "frame";
document.body.appendChild(frame);
emulators.pathPrefix = "/lib/jsdos/";
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>