forked from Orange-OpenSource/hasplayer.js
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathcapabilities.html
122 lines (96 loc) · 5.96 KB
/
capabilities.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
<!DOCTYPE html>
<html>
<head>
<title>Page de test de fonctionnalités</title>
<style type="text/css">
body{
font-family:Arial, Helvetica, sans-serif;
}
.ok {
display: inline-block;
width:25px;
height:25px;
background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABkAAAAZCAYAAADE6YVjAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAIGNIUk0AAHolAACAgwAA+f8AAIDpAAB1MAAA6mAAADqYAAAXb5JfxUYAAAKYSURBVHjaYvz29wf35CfrOve8Pxv65/9fVkZGxn8MFIL/DAyM////Z1LilLxaLBtewLjoxc6SiU/WdjPQCKhyylxiuvr1gRkDDcHDHy/UmZgYmf7S0hImRqa/TAx0AFSzxEvIfEm1fEyaDrfiSXQ5FmpYECHmNKlENjyfgYGBwZhX/UDY1Yarf/7/ZaWaJZFizhOLZcMKYPwvf74J/Gf4z0i14EK34NOfr0ItDxfP/vv/HwtVLEG34B/Df6aOx8un3vr+RJ+oiA8QsZnTopgcrcQheQ2bfJSY8wRkCxgYGBgWPN9euevd6Qhs6jHixEfYcmGNfGwqAwMDgza3wqniO9M23vvxXAvZB0WyYYXIeg59uOg3+/nWOqKTsDqX7HkYW5Zd7E6fSrafIofkdVgqKpINRbHg3vdn2i0PF8/+/f8PGy5LmG3z/ULufn+mAxN48eudvIOA/kZuZs5PDAwMDHws3O9NeNUOyLKL3UmV8m1kYmD8D4/ov98ES+5OX//452sVXBawMDL/xvDJ/R/PNWsfzFv87d9PHpiYEqfU1Shxl34mBkQJ/Y/hP1PHo2XTbnx7ZERWjj/7+ZZD+8OlM/79/8eMS+OiFzvLcEU00cXK9ncno2c829SETe7Ix8veM59tbqRK2TXvxfaqla/25yKLPfjxQqPt4ZKZ+CKa5AKy9/HKCVveHo9nYGBgeP/ns2j9g/kLX/3+IE1KxiVYdv1j+M/U/HDRnF3vTke8+v1B+s73p7qklg5EFZB///9jOfbpqgfZ9cn///9pWnH9Y/jPxMTKyPyLlpawMDD9YfIStljMwsj8m1aWeAqbL2H8//8/w+nPN5x2vjsd+e3vD15qNCz+M/xn/P//P5Mej/KxQBHb2YABAJuACoNlP/nrAAAAAElFTkSuQmCC');
}
.ko {
display: inline-block;
width:28px;
height:25px;
background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABwAAAAZCAYAAAAiwE4nAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAIGNIUk0AAHolAACAgwAA+f8AAIDpAAB1MAAA6mAAADqYAAAXb5JfxUYAAALVSURBVHjavNRbSFNxHAfw38605iZT0cDLlualB0WxoWkD86FQnNrLHsRiL0oPjcALeCmIRNBUqASZD6I+lEYP9mBpGPqQhDYbGml78Fq6UrCRG7q8bt+ePHKYZxcdHvg9nPM/v9+Hc873/AkAeVx7e/7Q6bRQKsegUEyirKwVJpPMmxnkFVhV1QIicEqhmMTqaoTvwdHR607YYWm1Ot+C+/t+yM7+yAuKRNsYH7/mO7Czs5QXO6ycnA/Y2Tl/etBsDkVCwpxbkAjo7b19erC29olHGBGQmGjExkbwyUGjMRGhoWaPQSKgru7xycGiotdeYURASMhfzM5e9h4cGsoFw9i9BokAjeaFd+DWlgRK5RiIAIHAgdLSTgwP34RKNeg0PCrqF3p67qCj4y6kUiuIAKHwACMjNzwHdTotO1AstmFp6RIAgsUShIKCd+yaXL6CqakrbF9h4Vt2LTPzM/b2/N2Dq6sRkMlMbCPD2NHUVMOuWyxByM0dQnj4GiYmrrLXTSYZ4uPnOU/f1VXiHiwvf+702vz89tHefo/zbxqNiez58vJFpKZ+deqLifmB9fUL/KDBkAaRaPvYIDCMHa2tZdjdPcfpWViIQ1qagTdANTVN/GBe3nuX6YuNXYTZHMrpqax86rJHLLZhejrZGezrU7v8DeTyFej1GXA4BBxwbS0c+fkDLlG1ug92O3MEWq3SY7/BYUVH/4TBkMYi8/PxnH3TapVyEnpcBvr7bx2BDQ0PeW8OCPgHvT6Dk8aUlG8gAnQ6LSe9GRl63jkKxSRsNjFhbi4BkZG/eW8MDt7A5mYgm8b09C+86S0ufuXy1ba13Sc0Nj5wu1WpVINobq5GUtJ3pzWh8AAVFc9QX/8IYWF/XM5JTp4+2QZ9imJIIrHRWR0SiY0htfoNCYX2MwE1mpcCOBwCGhgooO7uEpqZSaatrUCfIkKhneLiFikr6xNVV7f8HwA3OhxTg0UPfwAAAABJRU5ErkJggg==');
}
</style>
<script type="text/javascript">
var capablities = {
mediaKeys:null,
supportsMediaSource: function () {
"use strict";
var hasWebKit = ("WebKitMediaSource" in window),
hasMediaSource = ("MediaSource" in window);
return (hasWebKit || hasMediaSource);
},
supportsMediaKeys: function () {
"use strict";
this.mediaKeys = (window.WebKitMediaKeys) || (window.MSMediaKeys) || (window.MediaKeys);
var hasMediaKeys = this.mediaKeys !== null;
return hasMediaKeys;
},
supportsCodec: function (codec) {
"use strict";
var video = document.createElement("video");
var canPlay;
canPlay = video.canPlayType(codec);
return (canPlay === "probably");
},
supportsFlavor: function(codec, flavor){
this.supportsMediaKeys();
//console.info(this.mediaKeys, this.mediaKeys.isTypeSupported);
if(this.mediaKeys && this.mediaKeys.isTypeSupported){
return this.mediaKeys.isTypeSupported(flavor,codec);
}else{
// for chrome ... use canPlayType which is not for that
var video = document.createElement("video");
var canPlay = video.canPlayType(codec,flavor);
return (canPlay === "probably");
}
}
};
function doTest(){
var mp4Codec = 'video/mp4; codecs="avc1.640028"',
webMCodec = 'video/webm; codecs="vp8, vorbis"',
MSE=document.getElementById("MSE"),
EME = document.getElementById("EME"),
MP4 = document.getElementById("MP4"),
WEBM = document.getElementById("WebM"),
PLAYREADY = document.getElementById("MP4Pr"),
GPLAYREADY = document.getElementById("MP4PrG"),
WIDEVINE = document.getElementById("MP4Ww"),
CLEARKEY = document.getElementById("MP4Ck"),
WKCLEARKEY = document.getElementById("MP4CkWk");
MSE.className = (capablities.supportsMediaSource()? "ok" : "ko");
EME.className = (capablities.supportsMediaKeys()? "ok" : "ko");
MP4.className = (capablities.supportsCodec(mp4Codec)? "ok" : "ko");
WEBM.className = (capablities.supportsCodec(webMCodec)? "ok" : "ko");
PLAYREADY.className = (capablities.supportsFlavor(mp4Codec, "com.microsoft.playready")? "ok" : "ko");
GPLAYREADY.className = (capablities.supportsFlavor(mp4Codec, "com.youtube.playready")? "ok" : "ko");
WIDEVINE.className = (capablities.supportsFlavor(webMCodec, "com.widevine.alpha")? "ok" : "ko");
CLEARKEY.className = (capablities.supportsFlavor(mp4Codec, "org.w3.clearkey")? "ok" : "ko");
WKCLEARKEY.className = (capablities.supportsFlavor(mp4Codec, "webkit-org.w3.clearkey")? "ok" : "ko");
}
</script>
</head>
<body onload="doTest()">
<h1>MSE/EME capability testing</h1>
<div id="userAgent"></div>
<table>
<tr><td>MSE Extension</td><td><span id="MSE"></span></td></tr>
<tr><td>EME Extension</td><td><span id="EME"></span></td></tr>
<tr><td>MP4 format</td><td><span id="MP4"></span></td></tr>
<tr><td>WebM format</td><td><span id="WebM"></span></td></tr>
<tr><td>MP4 with PlayReady DRM</td><td><span id="MP4Pr"></span></td></tr>
<tr><td>MP4 with PlayReady DRM (google)</td><td><span id="MP4PrG"></span></td></tr>
<tr><td>MP4 with Widevine DRM</td><td><span id="MP4Ww"></span></td></tr>
<tr><td>MP4 with Clear Key system</td><td><span id="MP4Ck"></span></td></tr>
<tr><td>MP4 with Clear Key system (webkit-org)</td><td><span id="MP4CkWk"></span></td></tr>
</table>
</body>
</html>