Last active
February 8, 2022 01:58
-
-
Save cryocaustik/9e1ac4aa9afe773abcfe6fe7d79aa713 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ampSetup() { | |
try { | |
let myPlayer = amp( | |
"vid1", | |
{ | |
nativeControlsForTouch: false, | |
autoplay: false, | |
controls: true, | |
width: "800", | |
height: "600", | |
fluid: true, | |
poster: "", | |
logo: { | |
enabled: false, | |
}, | |
// cea708captions: true, | |
// cea708CaptionsSettings: { | |
// enabled: true, | |
// srclang: "en", | |
// label: "Live CC", | |
// }, | |
// imsc1Captions: [ | |
// { | |
// label: "Caption", | |
// srclang: "en-us", | |
// }, | |
// ], | |
imsc1CaptionsSettings: [ | |
{ | |
label: "Caption", | |
srclang: "en-us", | |
}, | |
], | |
}, | |
function () { | |
console.log("Good to go!"); | |
this.addEventListener("ended", function () { | |
console.log("Finished!"); | |
}); | |
} | |
); | |
myPlayer.src([ | |
{ | |
src: this.streamInfo.endpoint, | |
type: "application/vnd.ms-sstr+xml", | |
}, | |
]); | |
} catch (error) { | |
window.alert("stream error"); | |
document.getElementById("vid1").replaceWith(""); | |
console.log("stream err"); | |
console.log(error); | |
} | |
}, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<video | |
id="vid1" | |
class="azuremediaplayer amp-default-skin" | |
style="width: 100%" | |
></video> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment