@arcgis/map-components
Version:
ArcGIS Map Components
34 lines (33 loc) • 2.24 kB
JavaScript
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
import { c as v } from "../../chunks/runtime.js";
import { html as t } from "lit";
import { watch as d } from "@arcgis/core/core/reactiveUtils.js";
import { LitElement as u } from "@arcgis/lumina";
import { useDirection as h } from "@arcgis/lumina/controllers";
class f extends u {
constructor() {
super(...arguments), this._direction = h(), this._disabled = !1, this._playing = !1;
}
static {
this.properties = { _disabled: 16, _playing: 16, _isLive: 16, viewModel: 0, messages: 0, inline: 7 };
}
loaded() {
this.manager.onLifecycle(() => [
d(() => [this.viewModel.state, this.viewModel.playing], () => {
const { state: i, playing: e } = this.viewModel;
this._disabled = i === "not-ready" || i === "waiting", this._playing = e;
}, { initial: !0 }),
d(() => this.viewModel.layer?.isLive, (i) => {
this._isLive = i ?? void 0;
}, { initial: !0 })
]);
}
render() {
const { viewModel: i, messages: e, _disabled: n, _playing: a } = this, s = this._isLive, g = this._direction === "rtl", c = t`<calcite-action .active=${a} alignment=center .disabled=${n} .icon=${a ? "pause-f" : "play-f"} @click=${a ? () => i.pause() : () => i.play()} scale=s .text=${a ? e.pause : e.play}></calcite-action>`, p = s ? void 0 : t`<calcite-action alignment=center .disabled=${n} icon=reverse-f @click=${() => i.seekBackward()} scale=s .text=${e.reverse}></calcite-action>`, m = s ? void 0 : t`<calcite-action alignment=center .disabled=${n} icon=forward-f @click=${() => i.seekForward()} scale=s .text=${e.forward}></calcite-action>`, o = s ? void 0 : t`<calcite-action alignment=center .disabled=${n} icon=beginning-f @click=${() => i.seekToBeginning()} scale=s .text=${e.beginning}></calcite-action>`, l = s ? void 0 : t`<calcite-action alignment=center .disabled=${n} icon=end-f @click=${() => i.seekToEnding()} scale=s .text=${e.end}></calcite-action>`, r = this.inline ? [o, c, l] : [o, p, c, m, l];
return g && r.reverse(), t`<calcite-action-bar expand-disabled layout=horizontal scale=s>${r}</calcite-action-bar>`;
}
}
v("arcgis-video-player-actions-group", f);
export {
f as VideoPlayerActionsGroup
};