mirror of
https://github.com/streamyfin/streamyfin.git
synced 2026-05-16 20:06:37 +01:00
- Created AirPlay utilities (options, helpers) - Built useAirPlayPlayer hook for state management - Created AirPlayMiniPlayer component (bottom bar when AirPlaying) - Built full AirPlay player modal with gesture controls - Integrated AirPlay mini player into app layout - iOS-only feature using native AVFoundation/ExpoAvRoutePickerView - Apple-themed UI with blue accents (#007AFF) - Supports swipe-down to dismiss - Shows device name, progress, and playback controls
75 lines
1.6 KiB
TypeScript
75 lines
1.6 KiB
TypeScript
/**
|
|
* AirPlay Options and Types
|
|
* Configuration constants and type definitions for AirPlay player
|
|
*/
|
|
|
|
export interface AirPlayDevice {
|
|
name: string;
|
|
id: string;
|
|
type: string;
|
|
}
|
|
|
|
export interface AirPlayPlayerState {
|
|
isConnected: boolean;
|
|
isPlaying: boolean;
|
|
currentItem: any | null;
|
|
currentDevice: AirPlayDevice | null;
|
|
progress: number;
|
|
duration: number;
|
|
volume: number;
|
|
showControls: boolean;
|
|
}
|
|
|
|
export interface AirPlaySegmentData {
|
|
intro: { start: number; end: number } | null;
|
|
credits: { start: number; end: number } | null;
|
|
recap: { start: number; end: number } | null;
|
|
commercial: Array<{ start: number; end: number }>;
|
|
preview: Array<{ start: number; end: number }>;
|
|
}
|
|
|
|
export interface AudioTrack {
|
|
index: number;
|
|
language: string;
|
|
codec: string;
|
|
displayTitle: string;
|
|
}
|
|
|
|
export interface SubtitleTrack {
|
|
index: number;
|
|
language: string;
|
|
codec: string;
|
|
displayTitle: string;
|
|
isForced: boolean;
|
|
}
|
|
|
|
export interface MediaSource {
|
|
id: string;
|
|
name: string;
|
|
bitrate?: number;
|
|
container: string;
|
|
}
|
|
|
|
export const AIRPLAY_CONSTANTS = {
|
|
POSTER_WIDTH: 300,
|
|
POSTER_HEIGHT: 450,
|
|
ANIMATION_DURATION: 300,
|
|
CONTROL_HIDE_DELAY: 5000,
|
|
PROGRESS_UPDATE_INTERVAL: 1000,
|
|
SEEK_FORWARD_SECONDS: 10,
|
|
SEEK_BACKWARD_SECONDS: 10,
|
|
} as const;
|
|
|
|
export const DEFAULT_AIRPLAY_STATE: AirPlayPlayerState = {
|
|
isConnected: false,
|
|
isPlaying: false,
|
|
currentItem: null,
|
|
currentDevice: null,
|
|
progress: 0,
|
|
duration: 0,
|
|
volume: 0.5,
|
|
showControls: true,
|
|
};
|
|
|
|
export type ConnectionQuality = "excellent" | "good" | "fair" | "poor";
|