fix: Seek to the start of review media (#2353)
This commit is contained in:
@@ -422,11 +422,8 @@ export class AdvancedCameraCardViewerCarousel extends LitElement {
|
||||
* Fire a media show event when a slide is selected.
|
||||
*/
|
||||
protected async _seekHandler(): Promise<void> {
|
||||
const view = this.viewManagerEpoch?.manager.getView();
|
||||
const seek = view?.context?.mediaViewer?.seek;
|
||||
if (
|
||||
!this.hass ||
|
||||
!seek ||
|
||||
!this._media ||
|
||||
!this._loadedMediaPlayerController ||
|
||||
this._selected === null
|
||||
@@ -438,6 +435,13 @@ export class AdvancedCameraCardViewerCarousel extends LitElement {
|
||||
return;
|
||||
}
|
||||
|
||||
const view = this.viewManagerEpoch?.manager.getView();
|
||||
const seek = view?.context?.mediaViewer?.seek ?? selectedMedia.getStartTime();
|
||||
|
||||
if (!seek) {
|
||||
return;
|
||||
}
|
||||
|
||||
const seekTimeInMedia = selectedMedia.includesTime(seek);
|
||||
setOrRemoveAttribute(this, !seekTimeInMedia, 'unseekable');
|
||||
if (!seekTimeInMedia && !this._loadedMediaPlayerController.isPaused()) {
|
||||
|
||||
Reference in New Issue
Block a user