Skip to content

Commit

Permalink
Add SubtitleAppearance interface
Browse files Browse the repository at this point in the history
  • Loading branch information
3flex committed Oct 23, 2024
1 parent 9859c9f commit 9db0f4a
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/components/maincontroller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';
}
Expand Down
12 changes: 10 additions & 2 deletions src/types/global.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<T> {
[Key: string]: T;
Expand Down Expand Up @@ -89,15 +90,22 @@ 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;
playerManager: PlayerManager;
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;
Expand Down

0 comments on commit 9db0f4a

Please sign in to comment.