Skip to content

Commit

Permalink
Add Fairplay check.
Browse files Browse the repository at this point in the history
  • Loading branch information
Mounir Lamouri committed May 30, 2024
1 parent 752d638 commit 2c5cd66
Showing 1 changed file with 22 additions and 16 deletions.
38 changes: 22 additions & 16 deletions mediakey/support.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@
<body>
</body>
<script>
const keySystems = [
"com.widevine.alpha",
"com.apple.fairplay",
];
const L3config = [{
sessionTypes: ['persistent-license'],
videoCapabilities: [{
Expand All @@ -20,23 +24,25 @@
}]
}];

navigator.requestMediaKeySystemAccess('com.widevine.alpha', L3config)
.then(access => { return true; })
.catch(error => { return false; })
.then(v => {
let d = document.createElement('div');
d.textContent = "L3 support: " + v;
document.body.appendChild(d);
});
keySystems.forEach(keySystem => {
navigator.requestMediaKeySystemAccess(keySystem, L3config)
.then(access => { return true; })
.catch(error => { return false; })
.then(v => {
let d = document.createElement('div');
d.textContent = "[" + keySystem + "] Software (aka L3) support: " + v;
document.body.appendChild(d);
});

navigator.requestMediaKeySystemAccess('com.widevine.alpha', L1config)
.then(access => { return true; })
.catch(error => { return false; })
.then(v => {
let d = document.createElement('div');
d.textContent = "L1 support: " + v;
document.body.appendChild(d);
});
navigator.requestMediaKeySystemAccess(keySystem, L1config)
.then(access => { return true; })
.catch(error => { return false; })
.then(v => {
let d = document.createElement('div');
d.textContent = "[" + keySystem + "] Hardware (aka L1) support: " + v;
document.body.appendChild(d);
});
});

</script>
</html>

0 comments on commit 2c5cd66

Please sign in to comment.