Skip to content

Instantly share code, notes, and snippets.

@argentinaluiz
Created November 4, 2022 18:52
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/53f857dd45925d9344a9aa93b6770cdf to your computer and use it in GitHub Desktop.
Save argentinaluiz/53f857dd45925d9344a9aa93b6770cdf to your computer and use it in GitHub Desktop.
bitmovin.html
<html>
<head>
<link
rel="stylesheet"
href="https://cdn.bitmovin.com/player/web/8.31.0/bitmovinplayer-ui.css"
/>
</head>
<body>
<div id="video"></div>
<script
type="text/javascript"
src="https://cdn.bitmovin.com/player/web/8/bitmovinplayer.js"
></script>
<script
type="text/javascript"
src="https://cdn.bitmovin.com/player/web/8/bitmovinplayer-ui.js"
></script>
<script>
var config = {
key: "25208ca6-d380-433a-85e5-04f649370fb3",
/*cast: {
enable: true,
},*/
};
var source = {
dash: "https://s3.amazonaws.com/drmsonus/code/fullcycle/devops_20/01/01_introducao.mp4/stream.mpd",
hls: "https://codeeducation.akamaized.net/code/fullcycle/devops_20/01/01_introducao.mp4/fp/fairplay.m3u8",
drm: {
widevine: {
LA_URL: "https://widevine-dash.ezdrm.com/widevine-php/widevine-foreignkey.php?pX=AC398C&customdata=MTQ0OmFyZ2VudGluYWx1aXpAZ21haWwuY29tOjY3MTE6Y291cnNlOmNvZGU=",
},
/*playready: {
LA_URL:
"https://playready.directtaps.net/pr/svc/rightsmanager.asmx?PlayRight=1&ContentKey=EAtsIJQPd5pFiRUrV9Layw==",
},*/
fairplay: {
LA_URL: "https://fps.ezdrm.com/api/licenses/AF034438-81E2-4C4A-AE4A-A852E6ED07E8?customdata=MTQ0OmFyZ2VudGluYWx1aXpAZ21haWwuY29tOjY3MTE6Y291cnNlOmNvZGU=",
certificateURL:
"https://codeeducation.akamaized.net/fairplay.cer",
},
},
};
const player = new bitmovin.player.Player(
document.querySelector("#video"),config
/*{
// ui: true,
key: "702e5e37-a4ff-420c-8789-735d3bedbbea",
style: {
width: `100%`,
height: `100%`,
controls: true,
},
playback: {
autoplay: true,
preferredTech: [
{
player: "html5",
streaming: "dash",
},
],
},
preferredTech: [
{
player: "html5",
streaming: "dash",
},
],
}*/
);
player
.load(source)
.then(
function () {
player.play();
},
function (reason) {}
);
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment