Skip to content

Instantly share code, notes, and snippets.

@argentinaluiz
Created February 23, 2024 13:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save argentinaluiz/632b7aaf5e56af12f52e8bcdc15d18fd to your computer and use it in GitHub Desktop.
Save argentinaluiz/632b7aaf5e56af12f52e8bcdc15d18fd to your computer and use it in GitHub Desktop.
fairplay test
<html>
<head>
<link href="https://unpkg.com/video.js@7.13.1/dist/video-js.min.css" rel="stylesheet" />
<script src="https://unpkg.com/video.js@7.13.1/dist/video.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/videojs-contrib-eme@3.8.1/dist/videojs-contrib-eme.min.js"></script>
<script src="uaparser.min.js"></script>
<style type="text/css">
.vjs-matrix.video-js {
color: #fcca50;
}
/* Change the border of the big play button. */
.vjs-matrix .vjs-big-play-button {
border-color: #fcca50;
}
/* Change the color of various "bars". */
.vjs-matrix .vjs-volume-level,
.vjs-matrix .vjs-play-progress,
.vjs-matrix .vjs-slider-bar {
background: #fcca50;
}
</style>
</head>
<body>
<video
id="player"
class="video-js vjs-matrix vjs-default-skin vjs-big-play-centered"
style="height: 100%; width: 100%"
controls
preload="auto"
></video>
<script type="text/javascript">
var video = videojs("player", {
playbackRates: [0.5, 1, 1.5, 2],
autoplay: true
});
video.eme();
video.src([
{
src:
"https://codeeducation.akamaized.net/code/fullcycle/devops_20/01/01_introducao.mp4/fp/fairplay.m3u8",
type: "application/x-mpegURL",
keySystems: {
"com.apple.fps.1_0": {
certificateUri: "https://codeeducation.akamaized.net/fairplay.cer",
licenseUri: "https://fps.ezdrm.com/api/licenses/F6B15258-BC92-49EB-9CDF-DE9F121C13A5?customdata=MTQ0OmFyZ2VudGluYWx1aXpAZ21haWwuY29tOjY3MTE6Y291cnNlOmNvZGU=",
},
},
},
]);
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment