Skip to content

Instantly share code, notes, and snippets.

@cryocaustik
Last active February 8, 2022 01:58
Show Gist options
  • Save cryocaustik/9e1ac4aa9afe773abcfe6fe7d79aa713 to your computer and use it in GitHub Desktop.
Save cryocaustik/9e1ac4aa9afe773abcfe6fe7d79aa713 to your computer and use it in GitHub Desktop.
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);
}
},
<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