import { NativeModule, requireNativeModule } from 'expo-modules-core'; import { AdBreak, AdItem, ImaSettings } from '../advertising'; export type PlayerModuleEvents = { onShouldLoadAdItem: ({ nativeId, id, adItem, }: { nativeId: string; id: number; adItem: AdItem; }) => void; onShouldPlayAdBreak: ({ nativeId, id, adBreak, }: { nativeId: string; id: number; adBreak: AdBreak; }) => void; onImaBeforeInitialization: ({ nativeId, id, settings, }: { nativeId: string; id: number; settings: ImaSettings; }) => void; }; declare class PlayerModule extends NativeModule { /** * Call .play() on nativeId's player. */ play(nativeId: string): Promise; /** * Call .pause() on nativeId's player. */ pause(nativeId: string): Promise; /** * Call .mute() on nativeId's player. */ mute(nativeId: string): Promise; /** * Call .unmute() on nativeId's player. */ unmute(nativeId: string): Promise; /** * Call .seek(time) on nativeId's player. */ seek(nativeId: string, time: number): Promise; /** * Sets timeShift on nativeId's player. */ timeShift(nativeId: string, offset: number): Promise; /** * Call .destroy() on nativeId's player and remove from registry. */ destroy(nativeId: string): Promise; /** * Call .setVolume(volume) on nativeId's player. */ setVolume(nativeId: string, volume: number): Promise; /** * Resolve nativeId's current volume. */ getVolume(nativeId: string): Promise; /** * Resolve nativeId's current time. */ currentTime(nativeId: string, mode?: string): Promise; /** * Resolve nativeId's current playing state. */ isPlaying(nativeId: string): Promise; /** * Resolve nativeId's current paused state. */ isPaused(nativeId: string): Promise; /** * Resolve nativeId's active source duration. */ duration(nativeId: string): Promise; /** * Resolve nativeId's current muted state. */ isMuted(nativeId: string): Promise; /** * Call .unload() on nativeId's player. */ unload(nativeId: string): Promise; /** * Resolve nativeId's current time shift value. */ getTimeShift(nativeId: string): Promise; /** * Resolve nativeId's live stream state. */ isLive(nativeId: string): Promise; /** * Resolve nativeId's maximum time shift value. */ getMaxTimeShift(nativeId: string): Promise; /** * Resolve nativeId's current playback speed. */ getPlaybackSpeed(nativeId: string): Promise; /** * Set playback speed for nativeId's player. */ setPlaybackSpeed(nativeId: string, playbackSpeed: number): Promise; /** * Resolve nativeId's current ad state. */ isAd(nativeId: string): Promise; /** * Set maximum selectable bitrate for nativeId's player. */ setMaxSelectableBitrate(nativeId: string, maxBitrate: number): Promise; /** * Resolve nativeId's AirPlay activation state (iOS only). */ isAirPlayActive(nativeId: string): Promise; /** * Resolve nativeId's AirPlay availability state (iOS only). */ isAirPlayAvailable(nativeId: string): Promise; /** * Resolve nativeId's cast availability state. */ isCastAvailable(nativeId: string): Promise; /** * Resolve nativeId's current casting state. */ isCasting(nativeId: string): Promise; /** * Initiate casting for nativeId's player. */ castVideo(nativeId: string): Promise; /** * Stop casting for nativeId's player. */ castStop(nativeId: string): Promise; /** * Skip current ad for nativeId's player. */ skipAd(nativeId: string): Promise; /** * Applies the JS decision for an ad item load callback. */ setShouldLoadAdItem(id: number, shouldLoad: boolean): Promise; /** * Applies the JS decision for an ad break playback callback. */ setShouldPlayAdBreak(id: number, shouldPlay: boolean): Promise; /** * Applies the JS-updated IMA settings for a before-initialization callback. */ setPreparedImaSettings(id: number, settings: ImaSettings): Promise; /** * Check if player can play at specified playback speed (iOS only). */ canPlayAtPlaybackSpeed( nativeId: string, playbackSpeed: number ): Promise; /** * Creates a new Player instance using the provided config. */ initializeWithConfig( nativeId: string, config?: Record, networkNativeId?: string, decoderNativeId?: string ): Promise; /** * Creates a new analytics-enabled Player instance. */ initializeWithAnalyticsConfig( nativeId: string, analyticsConfig: Record, config?: Record, networkNativeId?: string, decoderNativeId?: string ): Promise; /** * Load source into the player. * Requires SourceModule dependency. */ loadSource(nativeId: string, sourceNativeId: string): Promise; /** * Load offline content into the player. */ loadOfflineContent( nativeId: string, offlineContentId: string, options?: Record ): Promise; /** * Get current audio track. */ getAudioTrack(nativeId: string): Promise; /** * Get available audio tracks. */ getAvailableAudioTracks(nativeId: string): Promise; /** * Set audio track. */ setAudioTrack(nativeId: string, trackId: string): Promise; /** * Get current subtitle track. */ getSubtitleTrack(nativeId: string): Promise; /** * Get available subtitle tracks. */ getAvailableSubtitles(nativeId: string): Promise; /** * Set subtitle track. */ setSubtitleTrack(nativeId: string, trackId: string | null): Promise; /** * Schedule an ad. */ scheduleAd(nativeId: string, adConfig: Record): Promise; /** * Get thumbnail for time position. */ getThumbnail(nativeId: string, time: number): Promise; /** * Get current video quality. */ getVideoQuality(nativeId: string): Promise; /** * Get available video qualities. */ getAvailableVideoQualities(nativeId: string): Promise; /** * Set video quality. */ setVideoQuality(nativeId: string, qualityId: string): Promise; } export default requireNativeModule('PlayerModule');