diff --git a/packages/react-native-video/src/core/VideoPlayer.ts b/packages/react-native-video/src/core/VideoPlayer.ts index 6e7f11ae..ddfff9f7 100644 --- a/packages/react-native-video/src/core/VideoPlayer.ts +++ b/packages/react-native-video/src/core/VideoPlayer.ts @@ -1,21 +1,21 @@ -import { Platform } from "react-native"; -import { NitroModules } from "react-native-nitro-modules"; -import type { VideoPlayer as VideoPlayerImpl } from "../spec/nitro/VideoPlayer.nitro"; -import type { VideoPlayerSource } from "../spec/nitro/VideoPlayerSource.nitro"; -import type { IgnoreSilentSwitchMode } from "./types/IgnoreSilentSwitchMode"; -import type { MixAudioMode } from "./types/MixAudioMode"; -import type { TextTrack } from "./types/TextTrack"; -import type { NoAutocomplete } from "./types/Utils"; -import type { VideoConfig, VideoSource } from "./types/VideoConfig"; +import { Platform } from 'react-native'; +import { NitroModules } from 'react-native-nitro-modules'; +import type { VideoPlayer as VideoPlayerImpl } from '../spec/nitro/VideoPlayer.nitro'; +import type { VideoPlayerSource } from '../spec/nitro/VideoPlayerSource.nitro'; +import type { IgnoreSilentSwitchMode } from './types/IgnoreSilentSwitchMode'; +import type { MixAudioMode } from './types/MixAudioMode'; +import type { TextTrack } from './types/TextTrack'; +import type { NoAutocomplete } from './types/Utils'; +import type { VideoConfig, VideoSource } from './types/VideoConfig'; import { tryParseNativeVideoError, VideoRuntimeError, -} from "./types/VideoError"; -import type { VideoPlayerBase } from "./types/VideoPlayerBase"; -import type { VideoPlayerStatus } from "./types/VideoPlayerStatus"; -import { createPlayer } from "./utils/playerFactory"; -import { createSource } from "./utils/sourceFactory"; -import { VideoPlayerEvents } from "./events/VideoPlayerEvents"; +} from './types/VideoError'; +import type { VideoPlayerBase } from './types/VideoPlayerBase'; +import type { VideoPlayerStatus } from './types/VideoPlayerStatus'; +import { createPlayer } from './utils/playerFactory'; +import { createSource } from './utils/sourceFactory'; +import { VideoPlayerEvents } from './events/VideoPlayerEvents'; class VideoPlayer extends VideoPlayerEvents implements VideoPlayerBase { private _player: VideoPlayerImpl | undefined; @@ -196,9 +196,9 @@ class VideoPlayer extends VideoPlayerEvents implements VideoPlayerBase { } set ignoreSilentSwitchMode(value: IgnoreSilentSwitchMode) { - if (__DEV__ && !["ios"].includes(Platform.OS)) { + if (__DEV__ && !['ios'].includes(Platform.OS)) { console.warn( - "ignoreSilentSwitchMode is not supported on this platform, it wont have any effect", + 'ignoreSilentSwitchMode is not supported on this platform, it wont have any effect' ); } @@ -291,18 +291,14 @@ class VideoPlayer extends VideoPlayerEvents implements VideoPlayerBase { } async replaceSourceAsync( - source: - | VideoSource - | VideoConfig - | NoAutocomplete - | null, + source: VideoSource | VideoConfig | NoAutocomplete | null ): Promise { this.updateMemorySize(); await this.wrapPromise( this.player.replaceSourceAsync( - source === null ? null : createSource(source), - ), + source === null ? null : createSource(source) + ) ); this.updateMemorySize(); diff --git a/packages/react-native-video/src/core/events/VideoPlayerEvents.native.ts b/packages/react-native-video/src/core/events/VideoPlayerEvents.native.ts index 31f5b465..6daecbeb 100644 --- a/packages/react-native-video/src/core/events/VideoPlayerEvents.native.ts +++ b/packages/react-native-video/src/core/events/VideoPlayerEvents.native.ts @@ -1,6 +1,6 @@ -import type { AllPlayerEvents as PlayerEvents } from "../types/Events"; -import type { ListenerSubscription } from "../types/EventEmitter"; -import { VideoPlayerEventsBase } from "./VideoPlayerEventsBase"; +import type { AllPlayerEvents as PlayerEvents } from '../types/Events'; +import type { ListenerSubscription } from '../types/EventEmitter'; +import { VideoPlayerEventsBase } from './VideoPlayerEventsBase'; export class VideoPlayerEvents extends VideoPlayerEventsBase { addEventListener( diff --git a/packages/react-native-video/src/core/events/VideoPlayerEvents.ts b/packages/react-native-video/src/core/events/VideoPlayerEvents.ts index 488356d8..c9198b42 100644 --- a/packages/react-native-video/src/core/events/VideoPlayerEvents.ts +++ b/packages/react-native-video/src/core/events/VideoPlayerEvents.ts @@ -1,3 +1,3 @@ // Platform-specific versions: VideoPlayerEvents.native.ts, VideoPlayerEvents.web.ts // This file is the default fallback for TypeScript resolution. -export { VideoPlayerEvents } from "./VideoPlayerEvents.native"; +export { VideoPlayerEvents } from './VideoPlayerEvents.native'; diff --git a/packages/react-native-video/src/core/events/VideoPlayerEventsBase.ts b/packages/react-native-video/src/core/events/VideoPlayerEventsBase.ts index 5daf7277..5172e828 100644 --- a/packages/react-native-video/src/core/events/VideoPlayerEventsBase.ts +++ b/packages/react-native-video/src/core/events/VideoPlayerEventsBase.ts @@ -2,11 +2,11 @@ import { ALL_PLAYER_EVENTS, type JSVideoPlayerEvents, type AllPlayerEvents as PlayerEvents, -} from "../types/Events"; +} from '../types/Events'; import type { ListenerSubscription, VideoPlayerEventEmitterBase, -} from "../types/EventEmitter"; +} from '../types/EventEmitter'; export class VideoPlayerEventsBase { protected eventEmitter: VideoPlayerEventEmitterBase; diff --git a/packages/react-native-video/src/core/types/EventEmitter.ts b/packages/react-native-video/src/core/types/EventEmitter.ts index a193f8d4..63129aaf 100644 --- a/packages/react-native-video/src/core/types/EventEmitter.ts +++ b/packages/react-native-video/src/core/types/EventEmitter.ts @@ -6,9 +6,9 @@ import type { onProgressData, onVolumeChangeData, TimedMetadata, -} from "./Events"; -import type { TextTrack } from "./TextTrack"; -import type { VideoPlayerStatus } from "./VideoPlayerStatus"; +} from './Events'; +import type { TextTrack } from './TextTrack'; +import type { VideoPlayerStatus } from './VideoPlayerStatus'; /** * A subscription that can be used to remove a listener. diff --git a/packages/react-native-video/src/core/utils/sourceUtils.ts b/packages/react-native-video/src/core/utils/sourceUtils.ts index 0c82b1cb..ac2b184b 100644 --- a/packages/react-native-video/src/core/utils/sourceUtils.ts +++ b/packages/react-native-video/src/core/utils/sourceUtils.ts @@ -1,4 +1,4 @@ -import type { VideoPlayerSource } from "../../spec/nitro/VideoPlayerSource.nitro"; +import type { VideoPlayerSource } from '../../spec/nitro/VideoPlayerSource.nitro'; export const isVideoPlayerSource = (obj: any): obj is VideoPlayerSource => { return ( diff --git a/packages/react-native-video/src/core/video-view/VideoViewProps.ts b/packages/react-native-video/src/core/video-view/VideoViewProps.ts index d55538ee..c8393fe9 100644 --- a/packages/react-native-video/src/core/video-view/VideoViewProps.ts +++ b/packages/react-native-video/src/core/video-view/VideoViewProps.ts @@ -1,9 +1,9 @@ -import type { ViewProps, ViewStyle } from "react-native"; -import type { SurfaceType } from "../../spec/nitro/VideoViewViewManager.nitro"; -import type { ListenerSubscription } from "../types/EventEmitter"; -import type { VideoViewEvents } from "../types/Events"; -import type { ResizeMode } from "../types/ResizeMode"; -import type { VideoPlayer } from "../VideoPlayer"; +import type { ViewProps, ViewStyle } from 'react-native'; +import type { SurfaceType } from '../../spec/nitro/VideoViewViewManager.nitro'; +import type { ListenerSubscription } from '../types/EventEmitter'; +import type { VideoViewEvents } from '../types/Events'; +import type { ResizeMode } from '../types/ResizeMode'; +import type { VideoPlayer } from '../VideoPlayer'; export interface VideoViewProps extends Partial, ViewProps { /** diff --git a/packages/react-native-video/src/index.tsx b/packages/react-native-video/src/index.tsx index 2ede908a..3c1331ce 100644 --- a/packages/react-native-video/src/index.tsx +++ b/packages/react-native-video/src/index.tsx @@ -1,11 +1,11 @@ -export { useEvent } from "./core/hooks/useEvent"; -export { useVideoPlayer } from "./core/hooks/useVideoPlayer"; -export type * from "./core/types/Events"; -export type { IgnoreSilentSwitchMode } from "./core/types/IgnoreSilentSwitchMode"; -export type { MixAudioMode } from "./core/types/MixAudioMode"; -export type { ResizeMode } from "./core/types/ResizeMode"; -export type { TextTrack } from "./core/types/TextTrack"; -export type { VideoConfig, VideoSource } from "./core/types/VideoConfig"; +export { useEvent } from './core/hooks/useEvent'; +export { useVideoPlayer } from './core/hooks/useVideoPlayer'; +export type * from './core/types/Events'; +export type { IgnoreSilentSwitchMode } from './core/types/IgnoreSilentSwitchMode'; +export type { MixAudioMode } from './core/types/MixAudioMode'; +export type { ResizeMode } from './core/types/ResizeMode'; +export type { TextTrack } from './core/types/TextTrack'; +export type { VideoConfig, VideoSource } from './core/types/VideoConfig'; export type { LibraryError, PlayerError, @@ -16,12 +16,12 @@ export type { VideoErrorCode, VideoRuntimeError, VideoViewError, -} from "./core/types/VideoError"; -export type { VideoPlayerStatus } from "./core/types/VideoPlayerStatus"; +} from './core/types/VideoError'; +export type { VideoPlayerStatus } from './core/types/VideoPlayerStatus'; -export { VideoPlayer } from "./core/VideoPlayer"; -export { default as VideoView } from "./core/video-view/VideoView"; +export { VideoPlayer } from './core/VideoPlayer'; +export { default as VideoView } from './core/video-view/VideoView'; export type { VideoViewProps, VideoViewRef, -} from "./core/video-view/VideoViewProps"; +} from './core/video-view/VideoViewProps';