From 1fe7aea03474834b26da028aa5a975978d84fb7f Mon Sep 17 00:00:00 2001 From: ronalduQualabs Date: Mon, 4 May 2026 14:50:41 -0300 Subject: [PATCH] fix: format castable mixin --- packages/castable-video/castable-mixin.js | 21 ++++++++------------- 1 file changed, 8 insertions(+), 13 deletions(-) diff --git a/packages/castable-video/castable-mixin.js b/packages/castable-video/castable-mixin.js index 2ae9d05..c64a0ef 100644 --- a/packages/castable-video/castable-mixin.js +++ b/packages/castable-video/castable-mixin.js @@ -7,7 +7,7 @@ import { currentSession, getDefaultCastOptions, isHls, - getPlaylistSegmentFormat + getPlaylistSegmentFormat, } from './castable-utils.js'; /** @@ -21,7 +21,6 @@ import { */ export const CastableMediaMixin = (superclass) => class CastableMedia extends superclass { - static observedAttributes = [ ...(superclass.observedAttributes ?? []), 'cast-src', @@ -50,7 +49,7 @@ export const CastableMediaMixin = (superclass) => } privateProps.set(this, { - loadOnPrompt: () => this.#loadOnPrompt() + loadOnPrompt: () => this.#loadOnPrompt(), }); return (this.#remote = new RemotePlayback(this)); @@ -126,10 +125,7 @@ export const CastableMediaMixin = (superclass) => activeTrackIds.push(trackId); } - const track = new chrome.cast.media.Track( - trackId, - chrome.cast.media.TrackType.TEXT - ); + const track = new chrome.cast.media.Track(trackId, chrome.cast.media.TrackType.TEXT); track.trackContentId = trackEl.src; track.trackContentType = 'text/vtt'; track.subtype = @@ -159,7 +155,8 @@ export const CastableMediaMixin = (superclass) => } const { videoFormat, audioFormat } = await getPlaylistSegmentFormat(this.castSrc); - const isVideoFMP4 = videoFormat?.includes('m4s') || videoFormat?.includes('mp4') || videoFormat?.includes('m4a'); + const isVideoFMP4 = + videoFormat?.includes('m4s') || videoFormat?.includes('mp4') || videoFormat?.includes('m4a'); if (isVideoFMP4) { mediaInfo.hlsSegmentFormat = chrome.cast.media.HlsSegmentFormat.FMP4; mediaInfo.hlsVideoSegmentFormat = chrome.cast.media.HlsVideoSegmentFormat.FMP4; @@ -237,7 +234,8 @@ export const CastableMediaMixin = (superclass) => this.getAttribute('cast-src') ?? this.querySelector('source')?.src ?? resolvedSrc ?? - this.getAttribute('src') ?? undefined + this.getAttribute('src') ?? + undefined ); } @@ -303,10 +301,7 @@ export const CastableMediaMixin = (superclass) => set muted(val) { if (this.#castPlayer) { - if ( - (val && !this.#castPlayer.isMuted) || - (!val && this.#castPlayer.isMuted) - ) { + if ((val && !this.#castPlayer.isMuted) || (!val && this.#castPlayer.isMuted)) { this.#castPlayer.controller?.muteOrUnmute(); } return;