streamit-player 1.0.1 → 1.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +2 -2
- package/dist/{Player-CqgNV9Pd.js → Player-BhwMyjyV.js} +94 -18
- package/dist/{Player-DrKG8tPQ.cjs → Player-CgkT9GAK.cjs} +94 -18
- package/dist/index.cjs +1 -1
- package/dist/index.js +1 -1
- package/dist/streamit-player.esm.js +94 -18
- package/dist/streamit-player.esm.min.js +483 -421
- package/dist/streamit-player.iife.js +94 -18
- package/dist/streamit-player.iife.min.js +86 -86
- package/dist/web-components/index.cjs +1 -1
- package/dist/web-components/index.js +1 -1
- package/dist/web-components/src/Player.d.ts +18 -0
- package/dist/web-components/src/Player.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -22076,6 +22076,37 @@ var StreamitPlayer = function(exports) {
|
|
|
22076
22076
|
];
|
|
22077
22077
|
const STANDARD_SPEEDS = [0.25, 0.5, 0.75, 1, 1.25, 1.5, 1.75, 2, 2.5, 3, 4];
|
|
22078
22078
|
const VERTICAL_SPEEDS = [0.5, 1, 2];
|
|
22079
|
+
function buildAttributeAliases(canonical) {
|
|
22080
|
+
const aliases = /* @__PURE__ */ new Map();
|
|
22081
|
+
for (const name of canonical) {
|
|
22082
|
+
if (!name.includes("-")) continue;
|
|
22083
|
+
for (const alias of [name.replace(/-/g, ""), name.replace(/-/g, "_")]) {
|
|
22084
|
+
if (alias !== name && !canonical.includes(alias)) {
|
|
22085
|
+
aliases.set(alias, name);
|
|
22086
|
+
}
|
|
22087
|
+
}
|
|
22088
|
+
}
|
|
22089
|
+
return aliases;
|
|
22090
|
+
}
|
|
22091
|
+
function parseConfigAttribute(value) {
|
|
22092
|
+
if (value === null) return void 0;
|
|
22093
|
+
const trimmed = value.trim();
|
|
22094
|
+
if (trimmed === "") return void 0;
|
|
22095
|
+
if (trimmed.startsWith("[object ")) {
|
|
22096
|
+
console.warn(
|
|
22097
|
+
`[streamit-player] The "config" attribute received a stringified object ("${trimmed}") and has been ignored. Pass config as a DOM property (element.config = {...}, or .config=\${...} / :config="..." in a framework template) rather than as an attribute.`
|
|
22098
|
+
);
|
|
22099
|
+
return void 0;
|
|
22100
|
+
}
|
|
22101
|
+
try {
|
|
22102
|
+
return JSON.parse(trimmed);
|
|
22103
|
+
} catch {
|
|
22104
|
+
console.warn(
|
|
22105
|
+
'[streamit-player] The "config" attribute is not valid JSON and has been ignored. Pass config as a DOM property instead.'
|
|
22106
|
+
);
|
|
22107
|
+
return void 0;
|
|
22108
|
+
}
|
|
22109
|
+
}
|
|
22079
22110
|
const _PlayerPlayer = class _PlayerPlayer extends i$1 {
|
|
22080
22111
|
constructor() {
|
|
22081
22112
|
super(...arguments);
|
|
@@ -22404,6 +22435,26 @@ var StreamitPlayer = function(exports) {
|
|
|
22404
22435
|
const settingsLabels = ((_c = (_b = this.config) == null ? void 0 : _b.settings) == null ? void 0 : _c.labels) || {};
|
|
22405
22436
|
return settingsLabels[key] || localeConfig[key] || defaultText;
|
|
22406
22437
|
}
|
|
22438
|
+
static get observedAttributes() {
|
|
22439
|
+
const canonical = super.observedAttributes;
|
|
22440
|
+
if (!Object.prototype.hasOwnProperty.call(this, "attributeAliases")) {
|
|
22441
|
+
this.attributeAliases = buildAttributeAliases(canonical);
|
|
22442
|
+
}
|
|
22443
|
+
return [...canonical, ...this.attributeAliases.keys()];
|
|
22444
|
+
}
|
|
22445
|
+
attributeChangedCallback(name, old, value) {
|
|
22446
|
+
var _a2;
|
|
22447
|
+
const canonical = (_a2 = this.constructor.attributeAliases) == null ? void 0 : _a2.get(name);
|
|
22448
|
+
if (canonical) {
|
|
22449
|
+
if (value === null) {
|
|
22450
|
+
this.removeAttribute(canonical);
|
|
22451
|
+
} else if (this.getAttribute(canonical) !== value) {
|
|
22452
|
+
this.setAttribute(canonical, value);
|
|
22453
|
+
}
|
|
22454
|
+
return;
|
|
22455
|
+
}
|
|
22456
|
+
super.attributeChangedCallback(name, old, value);
|
|
22457
|
+
}
|
|
22407
22458
|
get controllerInstance() {
|
|
22408
22459
|
return this.controller;
|
|
22409
22460
|
}
|
|
@@ -22725,6 +22776,29 @@ var StreamitPlayer = function(exports) {
|
|
|
22725
22776
|
if (changedProperties.has("liveMode") && this.controller) {
|
|
22726
22777
|
this.controller.setLiveMode(this.liveMode);
|
|
22727
22778
|
}
|
|
22779
|
+
this.adoptDisplayModeFromConfig(changedProperties);
|
|
22780
|
+
}
|
|
22781
|
+
/**
|
|
22782
|
+
* `displayMode` is the single source of truth for the layout: the host
|
|
22783
|
+
* stylesheet keys off the attribute it reflects and render() picks the
|
|
22784
|
+
* control set from it. `config.displayMode` and `config.layout.mode` are
|
|
22785
|
+
* equivalent ways to ask for a mode, so they are folded into the property
|
|
22786
|
+
* here - before the first render - rather than being read separately further
|
|
22787
|
+
* down, which is how a 9:16 host could end up wearing the standard control
|
|
22788
|
+
* bar.
|
|
22789
|
+
*
|
|
22790
|
+
* Only a config that changes the mode it asks for wins, so an unrelated
|
|
22791
|
+
* config update never clobbers a display-mode set on the element itself.
|
|
22792
|
+
*/
|
|
22793
|
+
adoptDisplayModeFromConfig(changedProperties) {
|
|
22794
|
+
var _a2, _b, _c;
|
|
22795
|
+
if (!changedProperties.has("config")) return;
|
|
22796
|
+
const requested = ((_a2 = this.config) == null ? void 0 : _a2.displayMode) || ((_c = (_b = this.config) == null ? void 0 : _b.layout) == null ? void 0 : _c.mode);
|
|
22797
|
+
if (!requested || requested === this.configRequestedMode) return;
|
|
22798
|
+
this.configRequestedMode = requested;
|
|
22799
|
+
if (this.displayMode !== requested) {
|
|
22800
|
+
this.displayMode = requested;
|
|
22801
|
+
}
|
|
22728
22802
|
}
|
|
22729
22803
|
firstUpdated() {
|
|
22730
22804
|
var _a2, _b, _c, _d, _e, _f, _g, _h, _i;
|
|
@@ -25350,8 +25424,7 @@ var StreamitPlayer = function(exports) {
|
|
|
25350
25424
|
`;
|
|
25351
25425
|
}
|
|
25352
25426
|
renderDefaultLiveOverlay(player) {
|
|
25353
|
-
|
|
25354
|
-
const layoutMode = ((_b = (_a2 = player.config) == null ? void 0 : _a2.layout) == null ? void 0 : _b.mode) || player.displayMode;
|
|
25427
|
+
const layoutMode = player.displayMode;
|
|
25355
25428
|
if (layoutMode !== "vertical" || !player.playerState.isLive) return "";
|
|
25356
25429
|
return b`
|
|
25357
25430
|
<div
|
|
@@ -25698,7 +25771,7 @@ var StreamitPlayer = function(exports) {
|
|
|
25698
25771
|
`;
|
|
25699
25772
|
}
|
|
25700
25773
|
render() {
|
|
25701
|
-
var _a2, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r
|
|
25774
|
+
var _a2, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r;
|
|
25702
25775
|
const {
|
|
25703
25776
|
isPlaying,
|
|
25704
25777
|
status,
|
|
@@ -25711,7 +25784,7 @@ var StreamitPlayer = function(exports) {
|
|
|
25711
25784
|
loop
|
|
25712
25785
|
} = this.playerState;
|
|
25713
25786
|
const isVisible = this.controlsVisible || !isPlaying;
|
|
25714
|
-
const layoutMode =
|
|
25787
|
+
const layoutMode = this.displayMode;
|
|
25715
25788
|
return b`
|
|
25716
25789
|
<div
|
|
25717
25790
|
part="player-container"
|
|
@@ -25732,12 +25805,12 @@ var StreamitPlayer = function(exports) {
|
|
|
25732
25805
|
<canvas part="transition-canvas" class="transition-canvas"></canvas>
|
|
25733
25806
|
</div>
|
|
25734
25807
|
|
|
25735
|
-
${!currentSource && this.emptyStateSectionEnabled && ((
|
|
25808
|
+
${!currentSource && this.emptyStateSectionEnabled && ((_b = (_a2 = this.config) == null ? void 0 : _a2.controls) == null ? void 0 : _b.emptyState) !== false ? this.renderEmptyState() : b`
|
|
25736
25809
|
<!-- Custom overlay slot -->
|
|
25737
25810
|
<slot name="top-overlay"></slot>
|
|
25738
25811
|
|
|
25739
25812
|
<!-- Center Play Button Overlay -->
|
|
25740
|
-
${!((
|
|
25813
|
+
${!((_c = this.playerState) == null ? void 0 : _c.isAdPlaying) ? this.renderOverlay("center-play", (p2) => this.renderDefaultCenterPlayOverlay(p2)) : ""}
|
|
25741
25814
|
|
|
25742
25815
|
<!-- Audio only cover -->
|
|
25743
25816
|
${layoutMode === "audio-only" ? b`
|
|
@@ -25810,22 +25883,22 @@ var StreamitPlayer = function(exports) {
|
|
|
25810
25883
|
${isBuffering && !error ? this.renderOverlay("buffering", (p2) => this.renderDefaultBufferingOverlay(p2)) : ""}
|
|
25811
25884
|
|
|
25812
25885
|
<!-- Centered Replay Overlay (not shown in vertical mode) -->
|
|
25813
|
-
${status === "ended" && !this.playerState.isLive && this.displayMode !== "vertical" && !loop && !((
|
|
25886
|
+
${status === "ended" && !this.playerState.isLive && this.displayMode !== "vertical" && !loop && !((_d = this.playerState) == null ? void 0 : _d.isAdPlaying) ? this.renderOverlay("replay", (p2) => this.renderDefaultReplayOverlay(p2)) : ""}
|
|
25814
25887
|
|
|
25815
25888
|
<!-- Ambient Tap Skip / Volume / Playback Speed gesture feedback ripples -->
|
|
25816
|
-
${this.tapFeedback && !((
|
|
25889
|
+
${this.tapFeedback && !((_e = this.playerState) == null ? void 0 : _e.isAdPlaying) ? this.renderOverlay(
|
|
25817
25890
|
"seek",
|
|
25818
25891
|
(p2, dir) => this.renderDefaultSeekOverlay(p2, dir),
|
|
25819
25892
|
this.tapFeedback
|
|
25820
25893
|
) : ""}
|
|
25821
|
-
${this.playPauseFeedback && !((
|
|
25822
|
-
${this.activeVolumeFeedback && !((
|
|
25823
|
-
${this.activeSpeedFeedback && !((
|
|
25894
|
+
${this.playPauseFeedback && !((_f = this.playerState) == null ? void 0 : _f.isAdPlaying) ? this.renderOverlay("play-pause", (p2) => this.renderDefaultPlayPauseOverlay(p2)) : ""}
|
|
25895
|
+
${this.activeVolumeFeedback && !((_g = this.playerState) == null ? void 0 : _g.isAdPlaying) ? this.renderOverlay("volume", (p2) => this.renderDefaultVolumeOverlay(p2)) : ""}
|
|
25896
|
+
${this.activeSpeedFeedback && !((_h = this.playerState) == null ? void 0 : _h.isAdPlaying) ? this.renderOverlay("speed", (p2) => this.renderDefaultSpeedOverlay(p2)) : ""}
|
|
25824
25897
|
|
|
25825
25898
|
<!-- Persistent Live Badge for Vertical Player -->
|
|
25826
|
-
${layoutMode === "vertical" && this.playerState.isLive && !((
|
|
25899
|
+
${layoutMode === "vertical" && this.playerState.isLive && !((_i = this.playerState) == null ? void 0 : _i.isAdPlaying) ? this.renderOverlay("live", (p2) => this.renderDefaultLiveOverlay(p2)) : ""}
|
|
25827
25900
|
|
|
25828
|
-
${!((
|
|
25901
|
+
${!((_j = this.playerState) == null ? void 0 : _j.isAdPlaying) ? b`
|
|
25829
25902
|
<!-- Ambient top/bottom vignette scrim -->
|
|
25830
25903
|
<div part="scrim" class="scrim ${isVisible ? "visible" : ""}"></div>
|
|
25831
25904
|
|
|
@@ -25844,12 +25917,12 @@ var StreamitPlayer = function(exports) {
|
|
|
25844
25917
|
|
|
25845
25918
|
<!-- Control overlays wrapper -->
|
|
25846
25919
|
<div part="controls-overlay" class="controls-overlay">
|
|
25847
|
-
${layoutMode === "custom" ? b`<slot></slot>` : layoutMode === "vertical" ? ((
|
|
25920
|
+
${layoutMode === "custom" ? b`<slot></slot>` : layoutMode === "vertical" ? ((_l = (_k = this.config) == null ? void 0 : _k.controls) == null ? void 0 : _l.verticalControls) !== false && this.controlsSectionEnabled ? b`
|
|
25848
25921
|
<player-vertical-controls
|
|
25849
25922
|
part="vertical-controls"
|
|
25850
25923
|
exportparts="vertical-controls-container, action-rail, rail-btn, seekbar, seekbar-container, hover-tooltip, tooltip-marker-label, thumbnail-container, thumbnail-preview, tooltip-time-text, track, buffer-bar, progress-bar, handle, marker, time-display"
|
|
25851
|
-
?hideCurrentTime=${((
|
|
25852
|
-
?hideDuration=${((
|
|
25924
|
+
?hideCurrentTime=${((_n = (_m = this.config) == null ? void 0 : _m.controls) == null ? void 0 : _n.currentTime) === false}
|
|
25925
|
+
?hideDuration=${((_p = (_o = this.config) == null ? void 0 : _o.controls) == null ? void 0 : _p.duration) === false}
|
|
25853
25926
|
.currentTime=${currentTime}
|
|
25854
25927
|
.duration=${duration}
|
|
25855
25928
|
.bufferedRanges=${bufferedRanges}
|
|
@@ -25876,7 +25949,7 @@ var StreamitPlayer = function(exports) {
|
|
|
25876
25949
|
<slot name="social-actions" slot="social-actions"></slot>
|
|
25877
25950
|
<slot name="bottom-actions" slot="bottom-actions"></slot>
|
|
25878
25951
|
</player-vertical-controls>
|
|
25879
|
-
` : "" : ((
|
|
25952
|
+
` : "" : ((_r = (_q = this.config) == null ? void 0 : _q.controls) == null ? void 0 : _r.controlsBar) !== false && this.controlsSectionEnabled ? this.renderStandardControls() : ""}
|
|
25880
25953
|
</div>
|
|
25881
25954
|
` : ""}
|
|
25882
25955
|
|
|
@@ -26012,7 +26085,10 @@ var StreamitPlayer = function(exports) {
|
|
|
26012
26085
|
n({ type: String, attribute: "live-mode", reflect: true })
|
|
26013
26086
|
], PlayerPlayer.prototype, "liveMode");
|
|
26014
26087
|
__decorateClass([
|
|
26015
|
-
n({
|
|
26088
|
+
n({
|
|
26089
|
+
type: Object,
|
|
26090
|
+
converter: { fromAttribute: parseConfigAttribute }
|
|
26091
|
+
})
|
|
26016
26092
|
], PlayerPlayer.prototype, "config");
|
|
26017
26093
|
__decorateClass([
|
|
26018
26094
|
n({ type: Boolean, attribute: "precise-seek", reflect: true })
|