@thalassic/ui 22.28.0 → 22.28.1
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.
|
@@ -68,6 +68,8 @@ class MediaController {
|
|
|
68
68
|
_detachRegistered = false;
|
|
69
69
|
_playing = signal(false, /* @ts-ignore */
|
|
70
70
|
...(ngDevMode ? [{ debugName: "_playing" }] : /* istanbul ignore next */ []));
|
|
71
|
+
_hasShownFrame = signal(false, /* @ts-ignore */
|
|
72
|
+
...(ngDevMode ? [{ debugName: "_hasShownFrame" }] : /* istanbul ignore next */ []));
|
|
71
73
|
_currentTime = signal(0, /* @ts-ignore */
|
|
72
74
|
...(ngDevMode ? [{ debugName: "_currentTime" }] : /* istanbul ignore next */ []));
|
|
73
75
|
_duration = signal(0, /* @ts-ignore */
|
|
@@ -91,6 +93,13 @@ class MediaController {
|
|
|
91
93
|
_scrubTime = signal(0, /* @ts-ignore */
|
|
92
94
|
...(ngDevMode ? [{ debugName: "_scrubTime" }] : /* istanbul ignore next */ []));
|
|
93
95
|
playing = this._playing.asReadonly();
|
|
96
|
+
/**
|
|
97
|
+
* Whether the current source has drawn a frame of its own, by playing or by
|
|
98
|
+
* a seek landing on data: before it has, a player shows its poster, which a
|
|
99
|
+
* request to play alone leaves in place while the first frame is fetched.
|
|
100
|
+
* Reset as the element empties for another source.
|
|
101
|
+
*/
|
|
102
|
+
hasShownFrame = this._hasShownFrame.asReadonly();
|
|
94
103
|
currentTime = computed(() => this._scrubbing() ? this._scrubTime() : this._currentTime(), /* @ts-ignore */
|
|
95
104
|
...(ngDevMode ? [{ debugName: "currentTime" }] : /* istanbul ignore next */ []));
|
|
96
105
|
duration = this._duration.asReadonly();
|
|
@@ -117,6 +126,8 @@ class MediaController {
|
|
|
117
126
|
this._listen(media, 'seeked', () => {
|
|
118
127
|
if (!this._scrubbing())
|
|
119
128
|
this._syncTime(media);
|
|
129
|
+
if (media.readyState >= HTMLMediaElement.HAVE_CURRENT_DATA)
|
|
130
|
+
this._hasShownFrame.set(true);
|
|
120
131
|
});
|
|
121
132
|
this._listen(media, 'durationchange', () => this._syncDuration(media));
|
|
122
133
|
this._listen(media, 'loadedmetadata', () => {
|
|
@@ -135,8 +146,17 @@ class MediaController {
|
|
|
135
146
|
if (!this._playing())
|
|
136
147
|
this._state.set('ready');
|
|
137
148
|
});
|
|
138
|
-
this._listen(media, 'playing', () =>
|
|
139
|
-
|
|
149
|
+
this._listen(media, 'playing', () => {
|
|
150
|
+
this._state.set('playing');
|
|
151
|
+
this._hasShownFrame.set(true);
|
|
152
|
+
});
|
|
153
|
+
// A source swapped mid-playback empties the element without a pause, so
|
|
154
|
+
// it is not left reported as playing, nor as having shown a frame.
|
|
155
|
+
this._listen(media, 'emptied', () => {
|
|
156
|
+
this._state.set('idle');
|
|
157
|
+
this._playing.set(false);
|
|
158
|
+
this._hasShownFrame.set(false);
|
|
159
|
+
});
|
|
140
160
|
this._listen(media, 'error', () => {
|
|
141
161
|
this._error.set(media.error);
|
|
142
162
|
this._state.set('error');
|
|
@@ -278,6 +298,10 @@ class MediaController {
|
|
|
278
298
|
this._playing.set(true);
|
|
279
299
|
this._state.set('playing');
|
|
280
300
|
}
|
|
301
|
+
if (!media.paused ||
|
|
302
|
+
(media.currentTime > 0 && media.readyState >= HTMLMediaElement.HAVE_CURRENT_DATA)) {
|
|
303
|
+
this._hasShownFrame.set(true);
|
|
304
|
+
}
|
|
281
305
|
}
|
|
282
306
|
_syncTime(media) {
|
|
283
307
|
this._currentTime.set(media.currentTime);
|
|
@@ -915,6 +939,11 @@ class VideoPlayer {
|
|
|
915
939
|
...(ngDevMode ? [{ debugName: "source" }] : /* istanbul ignore next */ []));
|
|
916
940
|
title = input(undefined, /* @ts-ignore */
|
|
917
941
|
...(ngDevMode ? [{ debugName: "title" }] : /* istanbul ignore next */ []));
|
|
942
|
+
/**
|
|
943
|
+
* Picture shown over the video until the source first shows a frame. Framed
|
|
944
|
+
* as the video is unless `--tls-video-player-poster-fit` says otherwise
|
|
945
|
+
* (`cover` for a poster of another shape than the footage).
|
|
946
|
+
*/
|
|
918
947
|
poster = input(undefined, /* @ts-ignore */
|
|
919
948
|
...(ngDevMode ? [{ debugName: "poster" }] : /* istanbul ignore next */ []));
|
|
920
949
|
captions = input([], /* @ts-ignore */
|
|
@@ -958,6 +987,20 @@ class VideoPlayer {
|
|
|
958
987
|
labels = this._config.labels;
|
|
959
988
|
// Computed
|
|
960
989
|
state = this._controller.state;
|
|
990
|
+
/**
|
|
991
|
+
* The poster drawn over the video until the source shows a frame of its own
|
|
992
|
+
* (`MediaController.hasShownFrame`). An image of its own rather than the
|
|
993
|
+
* media element's `poster` attribute, which a browser fetches late and paints
|
|
994
|
+
* over a black frame meanwhile: an image already in the cache is in view the
|
|
995
|
+
* moment the player is.
|
|
996
|
+
*/
|
|
997
|
+
shownPoster = computed(() => {
|
|
998
|
+
const poster = this.poster();
|
|
999
|
+
if (!poster || this._controller.hasShownFrame())
|
|
1000
|
+
return null;
|
|
1001
|
+
return poster;
|
|
1002
|
+
}, /* @ts-ignore */
|
|
1003
|
+
...(ngDevMode ? [{ debugName: "shownPoster" }] : /* istanbul ignore next */ []));
|
|
961
1004
|
fullscreen = this._fullscreenController.fullscreen;
|
|
962
1005
|
fullscreenSupported = this._fullscreenController.fullscreenSupported;
|
|
963
1006
|
pictureInPictureSupported = this._fullscreenController.pictureInPictureSupported;
|
|
@@ -1151,7 +1194,7 @@ class VideoPlayer {
|
|
|
1151
1194
|
this._seekFeedbackTimer = setTimeout(() => this.seekFeedback.set(null), SEEK_FEEDBACK_DURATION);
|
|
1152
1195
|
}
|
|
1153
1196
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: VideoPlayer, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1154
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.5", type: VideoPlayer, isStandalone: true, selector: "tls-video-player", inputs: { source: { classPropertyName: "source", publicName: "source", isSignal: true, isRequired: true, transformFunction: null }, title: { classPropertyName: "title", publicName: "title", isSignal: true, isRequired: false, transformFunction: null }, poster: { classPropertyName: "poster", publicName: "poster", isSignal: true, isRequired: false, transformFunction: null }, captions: { classPropertyName: "captions", publicName: "captions", isSignal: true, isRequired: false, transformFunction: null }, autoplay: { classPropertyName: "autoplay", publicName: "autoplay", isSignal: true, isRequired: false, transformFunction: null }, loop: { classPropertyName: "loop", publicName: "loop", isSignal: true, isRequired: false, transformFunction: null }, muted: { classPropertyName: "muted", publicName: "muted", isSignal: true, isRequired: false, transformFunction: null }, preload: { classPropertyName: "preload", publicName: "preload", isSignal: true, isRequired: false, transformFunction: null }, ariaLabel: { classPropertyName: "ariaLabel", publicName: "ariaLabel", isSignal: true, isRequired: false, transformFunction: null }, ariaLabelledby: { classPropertyName: "ariaLabelledby", publicName: "ariaLabelledby", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { ended: "ended", playingChange: "playingChange" }, host: { attributes: { "role": "group", "tabindex": "0" }, listeners: { "keydown": "onKeydown($event)", "pointermove": "onPointerActivity()", "focusin": "onFocusIn()", "focusout": "onFocusOut($event)" }, properties: { "attr.aria-label": "ariaLabel() ?? null", "attr.aria-labelledby": "ariaLabelledby() ?? null", "class.tls-video-player--controls-hidden": "controlsHidden()" }, classAttribute: "tls-video-player" }, providers: [MediaController, FullscreenController], viewQueries: [{ propertyName: "_videoElement", first: true, predicate: ["videoElement"], descendants: true, isSignal: true }, { propertyName: "_settingsMenu", first: true, predicate: MediaSettingsMenu, descendants: true, isSignal: true }], ngImport: i0, template: "<video\n #videoElement\n class=\"video\"\n [attr.poster]=\"poster() ?? null\"\n [attr.preload]=\"preload()\"\n [muted]=\"muted()\"\n [loop]=\"loop()\"\n [autoplay]=\"autoplay()\"\n playsinline\n (click)=\"onSurfaceClick()\"\n>\n @for (caption of captions(); track caption.src) {\n <track\n kind=\"subtitles\"\n [attr.src]=\"caption.src\"\n [attr.srclang]=\"caption.srclang\"\n [attr.label]=\"caption.label\"\n [attr.default]=\"caption.default ? '' : null\"\n />\n }\n</video>\n\n@if (state() === 'loading') {\n <tls-loader class=\"loader\" />\n}\n\n@if (seekFeedback(); as feedbackSeconds) {\n <div\n class=\"seek-feedback\"\n [class.seek-feedback--backward]=\"feedbackSeconds < 0\"\n aria-hidden=\"true\"\n animate.leave=\"seek-feedback--leave\"\n >\n <tls-icon [name]=\"seekFeedbackIcon()\" />\n <span class=\"seek-feedback__seconds\">{{ seekFeedbackText() }}</span>\n </div>\n}\n\n@if (state() === 'error') {\n <div class=\"error\" role=\"alert\">\n <span class=\"error__message\">{{ labels.errorMessage }}</span>\n <button type=\"button\" class=\"error__retry\" (click)=\"retry()\">{{ labels.retry }}</button>\n </div>\n}\n\n<div class=\"controls\" [class.controls--hidden]=\"controlsHidden()\">\n <tls-media-scrubber class=\"controls__scrubber\" />\n <div class=\"controls__row\">\n <tls-media-play-toggle />\n <tls-media-volume-control />\n <tls-media-time-display />\n <span class=\"controls__spacer\"></span>\n <tls-media-settings-menu />\n @if (pictureInPictureSupported()) {\n <button type=\"button\" class=\"controls__button\" [attr.aria-label]=\"labels.pictureInPicture\"\n (click)=\"togglePictureInPicture()\">\n <tls-icon name=\"picture-in-picture\" />\n </button>\n }\n @if (fullscreenSupported()) {\n <button type=\"button\" class=\"controls__button\"\n [attr.aria-label]=\"fullscreen() ? labels.exitFullscreen : labels.fullscreen\"\n (click)=\"toggleFullscreen()\">\n <tls-icon [name]=\"fullscreen() ? 'fullscreen-exit' : 'fullscreen'\" />\n </button>\n }\n </div>\n</div>\n", styles: [":host{position:relative;display:grid;grid-template-rows:100%;grid-template-columns:100%;aspect-ratio:var(--tls-media-aspect, 16/9);overflow:hidden}:host .video{width:100%;height:100%;grid-area:1/1;object-fit:contain}:host .loader{grid-area:1/1;place-self:center}:host .seek-feedback{grid-area:1/1;margin-inline:var(--spacing-8);display:flex;align-items:center;align-self:center;justify-self:end;gap:var(--spacing-1);pointer-events:none}:host .seek-feedback--backward{justify-self:start}:root[data-motion=essential] :host .seek-feedback--leave,:root[data-motion=full] :host .seek-feedback--leave{animation:seek-feedback-leave var(--motion-fast) var(--motion-ease-out) forwards}:host .error{grid-area:1/1;place-self:center;display:flex;flex-direction:column;align-items:center;gap:var(--spacing-3)}:host .controls{position:relative;grid-area:1/1;align-self:end;padding:var(--spacing-3);display:flex;flex-direction:column;gap:var(--spacing-2)}:host .controls__row{display:flex;align-items:center;gap:var(--spacing-2)}:host .controls__button{position:relative;width:var(--tls-media-control-size, 36px);height:var(--tls-media-control-size, 36px);display:inline-flex;align-items:center;justify-content:center;border:none;color:inherit;cursor:pointer}:host .controls__spacer{flex:1 1 0}:host .controls--hidden{visibility:hidden;opacity:0}:root[data-motion=essential] :host .controls,:root[data-motion=full] :host .controls{transition:opacity var(--motion-fast) var(--motion-ease-out),visibility var(--motion-fast)}:host(:fullscreen){width:100%;height:100%;aspect-ratio:auto;border-radius:0}@keyframes seek-feedback-leave{to{opacity:0}}\n"], dependencies: [{ kind: "component", type: Icon, selector: "tls-icon", inputs: ["name", "iconSrc", "alt", "allowedSources"] }, { kind: "component", type: Loader, selector: "tls-loader", inputs: ["size", "width", "widthRatio", "ariaLabel"] }, { kind: "component", type: MediaPlayToggle, selector: "tls-media-play-toggle" }, { kind: "component", type: MediaScrubber, selector: "tls-media-scrubber" }, { kind: "component", type: MediaSettingsMenu, selector: "tls-media-settings-menu" }, { kind: "component", type: MediaTimeDisplay, selector: "tls-media-time-display" }, { kind: "component", type: MediaVolumeControl, selector: "tls-media-volume-control" }] });
|
|
1197
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.5", type: VideoPlayer, isStandalone: true, selector: "tls-video-player", inputs: { source: { classPropertyName: "source", publicName: "source", isSignal: true, isRequired: true, transformFunction: null }, title: { classPropertyName: "title", publicName: "title", isSignal: true, isRequired: false, transformFunction: null }, poster: { classPropertyName: "poster", publicName: "poster", isSignal: true, isRequired: false, transformFunction: null }, captions: { classPropertyName: "captions", publicName: "captions", isSignal: true, isRequired: false, transformFunction: null }, autoplay: { classPropertyName: "autoplay", publicName: "autoplay", isSignal: true, isRequired: false, transformFunction: null }, loop: { classPropertyName: "loop", publicName: "loop", isSignal: true, isRequired: false, transformFunction: null }, muted: { classPropertyName: "muted", publicName: "muted", isSignal: true, isRequired: false, transformFunction: null }, preload: { classPropertyName: "preload", publicName: "preload", isSignal: true, isRequired: false, transformFunction: null }, ariaLabel: { classPropertyName: "ariaLabel", publicName: "ariaLabel", isSignal: true, isRequired: false, transformFunction: null }, ariaLabelledby: { classPropertyName: "ariaLabelledby", publicName: "ariaLabelledby", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { ended: "ended", playingChange: "playingChange" }, host: { attributes: { "role": "group", "tabindex": "0" }, listeners: { "keydown": "onKeydown($event)", "pointermove": "onPointerActivity()", "focusin": "onFocusIn()", "focusout": "onFocusOut($event)" }, properties: { "attr.aria-label": "ariaLabel() ?? null", "attr.aria-labelledby": "ariaLabelledby() ?? null", "class.tls-video-player--controls-hidden": "controlsHidden()" }, classAttribute: "tls-video-player" }, providers: [MediaController, FullscreenController], viewQueries: [{ propertyName: "_videoElement", first: true, predicate: ["videoElement"], descendants: true, isSignal: true }, { propertyName: "_settingsMenu", first: true, predicate: MediaSettingsMenu, descendants: true, isSignal: true }], ngImport: i0, template: "<video\n #videoElement\n class=\"video\"\n [attr.poster]=\"poster() ?? null\"\n [attr.preload]=\"preload()\"\n [muted]=\"muted()\"\n [loop]=\"loop()\"\n [autoplay]=\"autoplay()\"\n playsinline\n (click)=\"onSurfaceClick()\"\n>\n @for (caption of captions(); track caption.src) {\n <track\n kind=\"subtitles\"\n [attr.src]=\"caption.src\"\n [attr.srclang]=\"caption.srclang\"\n [attr.label]=\"caption.label\"\n [attr.default]=\"caption.default ? '' : null\"\n />\n }\n</video>\n\n<!-- Decorative: the poster stands for the video it covers, which carries the\n player's accessible name. -->\n@if (shownPoster(); as poster) {\n <img class=\"poster\" alt=\"\" [src]=\"poster\" />\n}\n\n@if (state() === 'loading') {\n <tls-loader class=\"loader\" />\n}\n\n@if (seekFeedback(); as feedbackSeconds) {\n <div\n class=\"seek-feedback\"\n [class.seek-feedback--backward]=\"feedbackSeconds < 0\"\n aria-hidden=\"true\"\n animate.leave=\"seek-feedback--leave\"\n >\n <tls-icon [name]=\"seekFeedbackIcon()\" />\n <span class=\"seek-feedback__seconds\">{{ seekFeedbackText() }}</span>\n </div>\n}\n\n@if (state() === 'error') {\n <div class=\"error\" role=\"alert\">\n <span class=\"error__message\">{{ labels.errorMessage }}</span>\n <button type=\"button\" class=\"error__retry\" (click)=\"retry()\">{{ labels.retry }}</button>\n </div>\n}\n\n<div class=\"controls\" [class.controls--hidden]=\"controlsHidden()\">\n <tls-media-scrubber class=\"controls__scrubber\" />\n <div class=\"controls__row\">\n <tls-media-play-toggle />\n <tls-media-volume-control />\n <tls-media-time-display />\n <span class=\"controls__spacer\"></span>\n <tls-media-settings-menu />\n @if (pictureInPictureSupported()) {\n <button type=\"button\" class=\"controls__button\" [attr.aria-label]=\"labels.pictureInPicture\"\n (click)=\"togglePictureInPicture()\">\n <tls-icon name=\"picture-in-picture\" />\n </button>\n }\n @if (fullscreenSupported()) {\n <button type=\"button\" class=\"controls__button\"\n [attr.aria-label]=\"fullscreen() ? labels.exitFullscreen : labels.fullscreen\"\n (click)=\"toggleFullscreen()\">\n <tls-icon [name]=\"fullscreen() ? 'fullscreen-exit' : 'fullscreen'\" />\n </button>\n }\n </div>\n</div>\n", styles: [":host{position:relative;display:grid;grid-template-rows:100%;grid-template-columns:100%;aspect-ratio:var(--tls-media-aspect, 16/9);overflow:hidden}:host .video{width:100%;height:100%;grid-area:1/1;object-fit:contain}:host .poster{width:100%;height:100%;grid-area:1/1;object-fit:var(--tls-video-player-poster-fit, contain);pointer-events:none}:host .loader{grid-area:1/1;place-self:center}:host .seek-feedback{grid-area:1/1;margin-inline:var(--spacing-8);display:flex;align-items:center;align-self:center;justify-self:end;gap:var(--spacing-1);pointer-events:none}:host .seek-feedback--backward{justify-self:start}:root[data-motion=essential] :host .seek-feedback--leave,:root[data-motion=full] :host .seek-feedback--leave{animation:seek-feedback-leave var(--motion-fast) var(--motion-ease-out) forwards}:host .error{grid-area:1/1;place-self:center;display:flex;flex-direction:column;align-items:center;gap:var(--spacing-3)}:host .controls{position:relative;grid-area:1/1;align-self:end;padding:var(--spacing-3);display:flex;flex-direction:column;gap:var(--spacing-2);view-transition-name:var(--tls-video-player-controls-transition-name, none)}:host .controls__row{display:flex;align-items:center;gap:var(--spacing-2)}:host .controls__button{position:relative;width:var(--tls-media-control-size, 36px);height:var(--tls-media-control-size, 36px);display:inline-flex;align-items:center;justify-content:center;border:none;color:inherit;cursor:pointer}:host .controls__spacer{flex:1 1 0}:host .controls--hidden{visibility:hidden;opacity:0}:root[data-motion=essential] :host .controls,:root[data-motion=full] :host .controls{transition:opacity var(--motion-fast) var(--motion-ease-out),visibility var(--motion-fast)}@starting-style{:root[data-motion=essential] :host .controls,:root[data-motion=full] :host .controls{opacity:0}}:host(:fullscreen){width:100%;height:100%;aspect-ratio:auto;border-radius:0}@keyframes seek-feedback-leave{to{opacity:0}}\n"], dependencies: [{ kind: "component", type: Icon, selector: "tls-icon", inputs: ["name", "iconSrc", "alt", "allowedSources"] }, { kind: "component", type: Loader, selector: "tls-loader", inputs: ["size", "width", "widthRatio", "ariaLabel"] }, { kind: "component", type: MediaPlayToggle, selector: "tls-media-play-toggle" }, { kind: "component", type: MediaScrubber, selector: "tls-media-scrubber" }, { kind: "component", type: MediaSettingsMenu, selector: "tls-media-settings-menu" }, { kind: "component", type: MediaTimeDisplay, selector: "tls-media-time-display" }, { kind: "component", type: MediaVolumeControl, selector: "tls-media-volume-control" }] });
|
|
1155
1198
|
}
|
|
1156
1199
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: VideoPlayer, decorators: [{
|
|
1157
1200
|
type: Component,
|
|
@@ -1174,7 +1217,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImpor
|
|
|
1174
1217
|
'(pointermove)': 'onPointerActivity()',
|
|
1175
1218
|
'(focusin)': 'onFocusIn()',
|
|
1176
1219
|
'(focusout)': 'onFocusOut($event)',
|
|
1177
|
-
}, template: "<video\n #videoElement\n class=\"video\"\n [attr.poster]=\"poster() ?? null\"\n [attr.preload]=\"preload()\"\n [muted]=\"muted()\"\n [loop]=\"loop()\"\n [autoplay]=\"autoplay()\"\n playsinline\n (click)=\"onSurfaceClick()\"\n>\n @for (caption of captions(); track caption.src) {\n <track\n kind=\"subtitles\"\n [attr.src]=\"caption.src\"\n [attr.srclang]=\"caption.srclang\"\n [attr.label]=\"caption.label\"\n [attr.default]=\"caption.default ? '' : null\"\n />\n }\n</video>\n\n@if (state() === 'loading') {\n <tls-loader class=\"loader\" />\n}\n\n@if (seekFeedback(); as feedbackSeconds) {\n <div\n class=\"seek-feedback\"\n [class.seek-feedback--backward]=\"feedbackSeconds < 0\"\n aria-hidden=\"true\"\n animate.leave=\"seek-feedback--leave\"\n >\n <tls-icon [name]=\"seekFeedbackIcon()\" />\n <span class=\"seek-feedback__seconds\">{{ seekFeedbackText() }}</span>\n </div>\n}\n\n@if (state() === 'error') {\n <div class=\"error\" role=\"alert\">\n <span class=\"error__message\">{{ labels.errorMessage }}</span>\n <button type=\"button\" class=\"error__retry\" (click)=\"retry()\">{{ labels.retry }}</button>\n </div>\n}\n\n<div class=\"controls\" [class.controls--hidden]=\"controlsHidden()\">\n <tls-media-scrubber class=\"controls__scrubber\" />\n <div class=\"controls__row\">\n <tls-media-play-toggle />\n <tls-media-volume-control />\n <tls-media-time-display />\n <span class=\"controls__spacer\"></span>\n <tls-media-settings-menu />\n @if (pictureInPictureSupported()) {\n <button type=\"button\" class=\"controls__button\" [attr.aria-label]=\"labels.pictureInPicture\"\n (click)=\"togglePictureInPicture()\">\n <tls-icon name=\"picture-in-picture\" />\n </button>\n }\n @if (fullscreenSupported()) {\n <button type=\"button\" class=\"controls__button\"\n [attr.aria-label]=\"fullscreen() ? labels.exitFullscreen : labels.fullscreen\"\n (click)=\"toggleFullscreen()\">\n <tls-icon [name]=\"fullscreen() ? 'fullscreen-exit' : 'fullscreen'\" />\n </button>\n }\n </div>\n</div>\n", styles: [":host{position:relative;display:grid;grid-template-rows:100%;grid-template-columns:100%;aspect-ratio:var(--tls-media-aspect, 16/9);overflow:hidden}:host .video{width:100%;height:100%;grid-area:1/1;object-fit:contain}:host .loader{grid-area:1/1;place-self:center}:host .seek-feedback{grid-area:1/1;margin-inline:var(--spacing-8);display:flex;align-items:center;align-self:center;justify-self:end;gap:var(--spacing-1);pointer-events:none}:host .seek-feedback--backward{justify-self:start}:root[data-motion=essential] :host .seek-feedback--leave,:root[data-motion=full] :host .seek-feedback--leave{animation:seek-feedback-leave var(--motion-fast) var(--motion-ease-out) forwards}:host .error{grid-area:1/1;place-self:center;display:flex;flex-direction:column;align-items:center;gap:var(--spacing-3)}:host .controls{position:relative;grid-area:1/1;align-self:end;padding:var(--spacing-3);display:flex;flex-direction:column;gap:var(--spacing-2)}:host .controls__row{display:flex;align-items:center;gap:var(--spacing-2)}:host .controls__button{position:relative;width:var(--tls-media-control-size, 36px);height:var(--tls-media-control-size, 36px);display:inline-flex;align-items:center;justify-content:center;border:none;color:inherit;cursor:pointer}:host .controls__spacer{flex:1 1 0}:host .controls--hidden{visibility:hidden;opacity:0}:root[data-motion=essential] :host .controls,:root[data-motion=full] :host .controls{transition:opacity var(--motion-fast) var(--motion-ease-out),visibility var(--motion-fast)}:host(:fullscreen){width:100%;height:100%;aspect-ratio:auto;border-radius:0}@keyframes seek-feedback-leave{to{opacity:0}}\n"] }]
|
|
1220
|
+
}, template: "<video\n #videoElement\n class=\"video\"\n [attr.poster]=\"poster() ?? null\"\n [attr.preload]=\"preload()\"\n [muted]=\"muted()\"\n [loop]=\"loop()\"\n [autoplay]=\"autoplay()\"\n playsinline\n (click)=\"onSurfaceClick()\"\n>\n @for (caption of captions(); track caption.src) {\n <track\n kind=\"subtitles\"\n [attr.src]=\"caption.src\"\n [attr.srclang]=\"caption.srclang\"\n [attr.label]=\"caption.label\"\n [attr.default]=\"caption.default ? '' : null\"\n />\n }\n</video>\n\n<!-- Decorative: the poster stands for the video it covers, which carries the\n player's accessible name. -->\n@if (shownPoster(); as poster) {\n <img class=\"poster\" alt=\"\" [src]=\"poster\" />\n}\n\n@if (state() === 'loading') {\n <tls-loader class=\"loader\" />\n}\n\n@if (seekFeedback(); as feedbackSeconds) {\n <div\n class=\"seek-feedback\"\n [class.seek-feedback--backward]=\"feedbackSeconds < 0\"\n aria-hidden=\"true\"\n animate.leave=\"seek-feedback--leave\"\n >\n <tls-icon [name]=\"seekFeedbackIcon()\" />\n <span class=\"seek-feedback__seconds\">{{ seekFeedbackText() }}</span>\n </div>\n}\n\n@if (state() === 'error') {\n <div class=\"error\" role=\"alert\">\n <span class=\"error__message\">{{ labels.errorMessage }}</span>\n <button type=\"button\" class=\"error__retry\" (click)=\"retry()\">{{ labels.retry }}</button>\n </div>\n}\n\n<div class=\"controls\" [class.controls--hidden]=\"controlsHidden()\">\n <tls-media-scrubber class=\"controls__scrubber\" />\n <div class=\"controls__row\">\n <tls-media-play-toggle />\n <tls-media-volume-control />\n <tls-media-time-display />\n <span class=\"controls__spacer\"></span>\n <tls-media-settings-menu />\n @if (pictureInPictureSupported()) {\n <button type=\"button\" class=\"controls__button\" [attr.aria-label]=\"labels.pictureInPicture\"\n (click)=\"togglePictureInPicture()\">\n <tls-icon name=\"picture-in-picture\" />\n </button>\n }\n @if (fullscreenSupported()) {\n <button type=\"button\" class=\"controls__button\"\n [attr.aria-label]=\"fullscreen() ? labels.exitFullscreen : labels.fullscreen\"\n (click)=\"toggleFullscreen()\">\n <tls-icon [name]=\"fullscreen() ? 'fullscreen-exit' : 'fullscreen'\" />\n </button>\n }\n </div>\n</div>\n", styles: [":host{position:relative;display:grid;grid-template-rows:100%;grid-template-columns:100%;aspect-ratio:var(--tls-media-aspect, 16/9);overflow:hidden}:host .video{width:100%;height:100%;grid-area:1/1;object-fit:contain}:host .poster{width:100%;height:100%;grid-area:1/1;object-fit:var(--tls-video-player-poster-fit, contain);pointer-events:none}:host .loader{grid-area:1/1;place-self:center}:host .seek-feedback{grid-area:1/1;margin-inline:var(--spacing-8);display:flex;align-items:center;align-self:center;justify-self:end;gap:var(--spacing-1);pointer-events:none}:host .seek-feedback--backward{justify-self:start}:root[data-motion=essential] :host .seek-feedback--leave,:root[data-motion=full] :host .seek-feedback--leave{animation:seek-feedback-leave var(--motion-fast) var(--motion-ease-out) forwards}:host .error{grid-area:1/1;place-self:center;display:flex;flex-direction:column;align-items:center;gap:var(--spacing-3)}:host .controls{position:relative;grid-area:1/1;align-self:end;padding:var(--spacing-3);display:flex;flex-direction:column;gap:var(--spacing-2);view-transition-name:var(--tls-video-player-controls-transition-name, none)}:host .controls__row{display:flex;align-items:center;gap:var(--spacing-2)}:host .controls__button{position:relative;width:var(--tls-media-control-size, 36px);height:var(--tls-media-control-size, 36px);display:inline-flex;align-items:center;justify-content:center;border:none;color:inherit;cursor:pointer}:host .controls__spacer{flex:1 1 0}:host .controls--hidden{visibility:hidden;opacity:0}:root[data-motion=essential] :host .controls,:root[data-motion=full] :host .controls{transition:opacity var(--motion-fast) var(--motion-ease-out),visibility var(--motion-fast)}@starting-style{:root[data-motion=essential] :host .controls,:root[data-motion=full] :host .controls{opacity:0}}:host(:fullscreen){width:100%;height:100%;aspect-ratio:auto;border-radius:0}@keyframes seek-feedback-leave{to{opacity:0}}\n"] }]
|
|
1178
1221
|
}], ctorParameters: () => [], propDecorators: { source: [{ type: i0.Input, args: [{ isSignal: true, alias: "source", required: true }] }], title: [{ type: i0.Input, args: [{ isSignal: true, alias: "title", required: false }] }], poster: [{ type: i0.Input, args: [{ isSignal: true, alias: "poster", required: false }] }], captions: [{ type: i0.Input, args: [{ isSignal: true, alias: "captions", required: false }] }], autoplay: [{ type: i0.Input, args: [{ isSignal: true, alias: "autoplay", required: false }] }], loop: [{ type: i0.Input, args: [{ isSignal: true, alias: "loop", required: false }] }], muted: [{ type: i0.Input, args: [{ isSignal: true, alias: "muted", required: false }] }], preload: [{ type: i0.Input, args: [{ isSignal: true, alias: "preload", required: false }] }], ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaLabel", required: false }] }], ariaLabelledby: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaLabelledby", required: false }] }], ended: [{ type: i0.Output, args: ["ended"] }], playingChange: [{ type: i0.Output, args: ["playingChange"] }], _videoElement: [{ type: i0.ViewChild, args: ['videoElement', { isSignal: true }] }], _settingsMenu: [{ type: i0.ViewChild, args: [i0.forwardRef(() => MediaSettingsMenu), { isSignal: true }] }] } });
|
|
1179
1222
|
|
|
1180
1223
|
const provideThalassicMediaConfig = (config = {}) => makeEnvironmentProviders([
|