-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
174 lines (140 loc) · 5.8 KB
/
index.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
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="style.css">
<title>VideoVerbose</title>
</head>
<body>
<div class = "container">
<h1>VideoVerbose</h1><div class="toggle-container">
</div>
<p>This tool will allow you to check, verify the different playback capabilities of your browser, like HDR, Dolby Audio, and performance for different codecs at resolutions upto 8K.</p>
<p>Developed by <a href="https://www.youtube.com/kdcloudy">@kdcloudy</a></p>
<div id = "basicInfo">
</div>
<h2>Performance:</h2>
<form>
<p>Select your video configuration and find out if this browser supports the codec,
and whether decoding will be smooth and power efficient:</p>
<ul>
<li>
<label for="codec">Select a codec</label>
<select id="codec">
<option value = 'video/webm; codecs="vp09.02.10.10.01.09.16.09.01"'>VP9</option>
<option value = "video/mp4; codecs=avc1.420034">AVC/H.264</option>
<option value = "video/mp4; codecs=hvc1.1.6.L93.B0" selected>HEVC/H.265</option>
</select>
</li>
<li>
<label for="size">Select a resolution</label>
<select id="size">
<option value="7680x4320">8K</option>
<option value="3840x2160">4K UHD</option>
<option value="2560x1440">1440p QHD</option>
<option value="1920x1080"selected>1080p HD</option>
</select>
</li>
<li>
<label for="framerate">Select a framerate</label>
<select id="framerate">
<option>60</option>
<option selected>30</option>
<option>24</option>
</select>
</li>
<li>
<label for="bitrate">Select a bitrate</label>
<select id="bitrate">
<option selected>4000</option>
<option>2500</option>
<option>800</option>
</select>
</li> </ul>
<p><input type="button" class="button" value="Test this Video Configuration" id="tryit"></p>
</form>
<ul id="results"></ul>
</body>
<script>
let mc = {
videoConfiguration : new Object(),
tryit: function () {
mc.createConfiguration();
mc.testit();
},
createConfiguration: function () {
var size = document.getElementById('size').value.split('x');
mc.videoConfiguration = {
type: 'media-source',
video: {
contentType: document.getElementById('codec').value,
width: size[0],
height: size[1],
bitrate: document.getElementById('bitrate').value,
framerate: document.getElementById('framerate').value,
}
}
},
//navigator.mediaCapabilities.decodingInfo({ type: 'media-source', video: { contentType: 'video/webm; codecs=\"vp09.02.10.10.01.09.16.09.01\"', height: 1080, bitrate: 800000, width: 3180, framerate: 30 }})
testit: function () {
let content = '';
navigator.mediaCapabilities.decodingInfo(mc.videoConfiguration).then(result => {
var li = document.createElement('li'),
mcv = mc.videoConfiguration.video;
content = 'A ' + mcv.width + 'x' + mcv.height + ', ' + mcv.contentType + ' at ' +
mcv.framerate + 'fps and ' + mcv.bitrate + ' bps video ' +
(result.supported ? ' is ' : 'is NOT ') + ' supported, ' +
(result.smooth ? ' is ' : ' is NOT ') + ' smooth, and' +
(result.powerEfficient ? ' is ' : ' is NOT ') + 'power efficient.'; //}
var ul = document.getElementById("results")
li.innerHTML = content;
ul.appendChild(li);
}).catch((error) => {
var li = document.createElement('li'),
ul = document.getElementById("results");
li.innerText = 'Codec ' + mc.videoConfiguration.video.contentType + ' threw an error: ' + error;
ul.appendChild(li);
});
}
}
var HDRSupport, DVSupport, DDPSupport, VP9Support;
//Checking for Dolby Vision support
if (MediaSource.isTypeSupported('video/mp4; codecs="dvhe"') == true ){
DVSupport= 'Supported'
} else {
DVSupport='Unsupported'
}
//Checking for HDR Support
if (window.matchMedia('(dynamic-range: high)').matches == true) {
HDRSupport = "Your screen is HDR supported"
} else if (window.matchMedia('(color-gamut: p3)').matches == true ){
HDRSupport = "Your screen has wide color, you'll be able to watch tonemapped HDR video"
} else {
HDRSupport = "HDR is unsupported"
}
if (MediaSource.isTypeSupported('video/mp4;codecs="ec-3"')==true){
DDPSupport='Supported'
} else if (navigator.userAgent.indexOf('Mac OS X 10_15') != -1 && navigator.userAgent.indexOf('Chrome') != -1 ) {
DDPSupport='Unsupported'
} else if (navigator.userAgent.indexOf('Mac OS X 10_15') != -1 && navigator.userAgent.indexOf('Safari') != -1 ){
DDPSupport='Supported <br> Dolby Atmos: Supported'
} else if (navigator.userAgent.indexOf('Edge') != -1 ) {
DDPSupport='Supported <br> Dolby Atmos: Supported'
} else {
DDPSupport = 'Unsupported'
}
if(MediaSource.isTypeSupported('video/webm; codecs="vp09.02.10.10.01.09.16.09.01"')==true){
VP9Support='Supported'
} else {
VP9Support='Unsupported'
}
let detailInfo = '';
detailInfo = "HDR Video Playback: " + HDRSupport + '<br>'
+ "Dolby Vision Support: " + DVSupport + '<br>'
+ "Dolby Digital Plus Support: " + DDPSupport + '<br>'
+ "YouTube 4K Support: " + VP9Support + '<br>'
document.getElementById('basicInfo').innerHTML = '<h2>Basic Info: </h2>' + '<h3> Device: ' + navigator.userAgent + '</h3>' + detailInfo + '</div>'
document.getElementById('tryit').addEventListener('click', mc.tryit);
</script>
</html>