This repository has been archived by the owner on Sep 5, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcheckenv.html
91 lines (88 loc) · 2.83 KB
/
checkenv.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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width,minimum-scale=1,initial-scale=1">
<title>Xbox Demo App - checkenv</title>
<meta name="robots" content="noindex">
<script src="rmp/three/three-xr.js"></script>
<script src="rmp/js/rmp.min.js"></script>
<style>
#rmpPlayer {
display: none !important;
}
</style>
<link rel="stylesheet" href="css/bootstrap.min.css">
</head>
<body>
<div class="container">
<div class="row">
<div class="col">
<p>Go to <a href="ms-appx-web:///index.html">home page</a></p>
<div><strong>Detected environment follows:</strong></div>
<div id="rmpPlayer"></div>
<div id="result"></div>
</div>
</div>
</div>
<script>
var rmp = new RadiantMP('rmpPlayer');
var result = document.getElementById('result');
var env = rmp.getEnvironment();
var ul = document.createElement('ul');
function addLI(textContent) {
var li = document.createElement('li');
li.textContent = textContent;
ul.appendChild(li);
}
ul.className = 'list-unstyled';
for (var prop in env) {
if (env.hasOwnProperty(prop)) {
var value = env[prop];
if (typeof value === 'function') {
continue;
} else if (typeof value === 'object') {
value = JSON.stringify(value);
}
addLI(prop + ': ' + value);
}
}
result.appendChild(ul);
var src = {
hls: 'https://5b44cf20b0388.streamlock.net:8443/vod/smil:bbb.smil/playlist.m3u8'
};
var settings = {
licenseKey: 'your-license-key',
src: src,
requestAutoplayCapabilitiesData: true
};
rmp.init(settings);
// getAutoplayMode
var rmpContainer = document.getElementById('rmpPlayer');
rmpContainer.addEventListener('autoplaymodedetected', function () {
addLI('getAutoplayMode: ' + rmp.getAutoplayMode());
});
// navigator.xr
if (typeof navigator.xr !== 'undefined' && typeof navigator.xr.isSessionSupported !== 'undefined') {
navigator.xr.isSessionSupported('immersive-vr').then((isSupported) => {
addLI('navigator.xr - isSessionSupported(\'immersive-vr\'): ' + isSupported);
}).catch((e) => {
addLI('navigator.xr - isSessionSupported(\'immersive-vr\'): catch error ' + JSON.stringify(e));
});
navigator.xr.isSessionSupported('immersive-ar').then((isSupported) => {
addLI('navigator.xr - isSessionSupported(\'immersive-ar\'): ' + isSupported);
}).catch((e) => {
addLI('navigator.xr - isSessionSupported(\'immersive-ar\'): catch error ' + JSON.stringify(e));
});
navigator.xr.isSessionSupported('inline').then((isSupported) => {
addLI('navigator.xr - isSessionSupported(\'inline\'): ' + isSupported);
}).catch((e) => {
addLI('navigator.xr - isSessionSupported(\'inline\'): catch error ' + JSON.stringify(e));
});
} else {
addLI('navigator.xr: no support');
}
</script>
<script src="js/tvjs.js"></script>
</body>
</html>