Add fullykiosk browser special cases

This commit is contained in:
2022-07-15 19:49:38 +00:00
parent a46d2b3cb0
commit 11d75426fb
8 changed files with 505 additions and 248 deletions

View File

@@ -8,8 +8,6 @@ export const RequireInteractMixin = (SuperClass) => {
constructor() {
super();
window.addEventListener("pointerdown", this._interactionResolve);
this.show_indicator();
}
@@ -34,12 +32,35 @@ export const RequireInteractMixin = (SuperClass) => {
color: var(--warning-color, red);
opacity: 0.5;
--mdc-icon-size: 48px;
}`;
}
video {
display: none;
}
`;
const icon = document.createElement("ha-icon");
interactSymbol.shadowRoot.append(icon);
(icon as any).icon = "mdi:gesture-tap";
// If we are allowed to play a video, we can assume no interaction is needed
const video = (this._video = document.createElement("video"));
interactSymbol.shadowRoot.append(video);
const vPlay = video.play();
if (vPlay) {
vPlay
.then(() => {
this._interactionResolve();
})
.catch((e) => {
if (e.name === "AbortError") this._interactionResolve();
});
video.pause();
}
window.addEventListener("pointerdown", this._interactionResolve);
// if (this.fully) this._interactionResolve();
await this.firstInteraction;
interactSymbol.remove();
}