@slashedcloud/player
Version:
A media player application utilizing Shaka Player for adaptive video streaming, capable of playing HLS, MPD and plain HTTP video streams.
46 lines (45 loc) • 1.37 kB
JavaScript
import '../BigPlayButton.css';var m = Object.defineProperty;
var c = (i, e, t) => e in i ? m(i, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : i[e] = t;
var a = (i, e, t) => c(i, typeof e != "symbol" ? e + "" : e, t);
var u = (i, e, t) => new Promise((l, r) => {
var d = (n) => {
try {
s(t.next(n));
} catch (o) {
r(o);
}
}, h = (n) => {
try {
s(t.throw(n));
} catch (o) {
r(o);
}
}, s = (n) => n.done ? l(n.value) : Promise.resolve(n.value).then(d, h);
s((t = t.apply(i, e)).next());
});
import p from "./Base.js";
/*!
* SlashedCloud v0.1.2 (https://github.com/SlashedCloud/player#readme)
* Copyright 2024-2024 rogerio.jardim@fedrax.pt
* Licensed under Apache (https://github.com/SlashedCloud/player/blob/develop/LICENSE)
*/
class P extends p {
constructor(t) {
super(t);
a(this, "name", "BigPlayButtonPlugin");
a(this, "timerId", null);
}
setup() {
return u(this, null, function* () {
this.player.on("play", this.onEvent.bind(this)), this.player.on("pause", this.onEvent.bind(this));
});
}
onEvent() {
this.timerId && clearTimeout(this.timerId);
const t = document.querySelector(".shaka-play-button");
t && (t.classList.remove("hidden"), this.timerId = setTimeout(() => t.classList.add("hidden"), 150));
}
}
export {
P as default
};