diff --git a/src/components/maincontroller.ts b/src/components/maincontroller.ts index 484aa746..24de26ab 100644 --- a/src/components/maincontroller.ts +++ b/src/components/maincontroller.ts @@ -782,7 +782,7 @@ export function setTextTrack(index: number | null): void { if (subtitleAppearance.dropShadow != null) { // Empty string is DROP_SHADOW textTrackStyle.edgeType = - subtitleAppearance.dropShadow.toUpperCase() || + subtitleAppearance.dropShadow || cast.framework.messages.TextTrackEdgeType.DROP_SHADOW; textTrackStyle.edgeColor = '#000000FF'; } diff --git a/src/types/global.d.ts b/src/types/global.d.ts index 08239a1d..6a54b6af 100644 --- a/src/types/global.d.ts +++ b/src/types/global.d.ts @@ -7,6 +7,7 @@ import type { BaseItemDto, RepeatMode } from '@jellyfin/sdk/lib/generated-client'; +import { TextTrackEdgeType } from 'chromecast-caf-receiver/cast.framework.messages'; export interface Dictionary { [Key: string]: T; @@ -89,6 +90,14 @@ interface SupportedCommands { } // /From commandHandler +interface SubtitleAppearance { + dropShadow: TextTrackEdgeType; + font: string; + textColor: string; + textBackground: string; + textSize: 'smaller' | 'small' | 'large' | 'larger' | 'extralarge'; +} + declare global { export interface Window { mediaElement: HTMLElement | null; @@ -96,8 +105,7 @@ declare global { castReceiverContext: CastReceiverContext; repeatMode: RepeatMode; reportEventType: 'repeatmodechange'; - // eslint-disable-next-line @typescript-eslint/no-explicit-any - subtitleAppearance: any; + subtitleAppearance: SubtitleAppearance; MaxBitrate: number | undefined; senderId: string | undefined; volume: SystemVolumeData;