-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathvideotypecheck.html
59 lines (41 loc) · 1.54 KB
/
videotypecheck.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
<!DOCTYPE html>
<html>
<body>
<p><b>video/mp4;codecs="avc1.4d401f": </b></p>
VideoCanPlay_4:
<p id="videoCanPlayType"></p>
isTypeSupported:
<p id="videoSupport"></p>
<br></br>
<p><b>Audio/mp4;codecs="mp4a.40.2": </b></P>
audioCanPlay_2:
<p id="audioCanPlayType"></p>
isTypeSupported:
<p id="audioSupport"></p>
<img src="http://waycash.net/front/images/bg/2.jpg" alt="image that should be blocked">
<img src="http://coolmobile.es/images/new_extranet_cmgroup/icono_04_es.jpg" alt="image that should be blocked1">
<video src="pig1.mp4" controls> </video>
<script>
var videoType = 'video/mp4;codecs="avc1.4d401f"';
var audioType = 'audio/mp4;codecs="mp4a.40.2"';
var obj = document.createElement('video');
document.getElementById("videoCanPlayType").innerHTML =
obj.canPlayType(videoType);
document.getElementById("videoSupport").innerHTML = (MediaRecorder.isTypeSupported(videoType))? "Maybe" : "Nope";
var obj = document.createElement('audio');
document.getElementById("audioCanPlayType").innerHTML =
obj.canPlayType(audioType);
document.getElementById("audioSupport").innerHTML = (MediaRecorder.isTypeSupported(audioType))? "Maybe" : "Nope";
var types = ["video/webm",
"audio/webm",
"video/webm\;codecs=vp8",
"video/webm\;codecs=daala",
"video/webm\;codecs=h264",
"audio/webm\;codecs=opus",
"video/mpeg"];
for (var i in types) {
console.log( "Is " + types[i] + " supported? " + (MediaRecorder.isTypeSupported(types[i]) ? "Maybe!" : "Nope :("));
}
</script>
</body>
</html>