Refactor interaction requirement. Add indicator

This commit is contained in:
2022-07-14 12:00:47 +00:00
parent a3cd0c9fd6
commit 1109980d61
9 changed files with 136 additions and 47 deletions

View File

@@ -13,14 +13,10 @@ export const MediaPlayerMixin = (SuperClass) => {
this.player.addEventListener(ev, () => this._player_update());
}
window.addEventListener(
"pointerdown",
() => {
this._player_enabled = true;
if (!this.player.ended) this.player.play();
},
{ once: true }
);
this.firstInteraction.then(() => {
this._player_enabled = true;
if (!this.player.ended) this.player.play();
});
this.addEventListener("command-player-play", (ev) => {
if (ev.detail?.media_content_id)