mirror of
https://github.com/zoriya/react-native-video.git
synced 2026-06-02 19:11:03 +00:00
style: normalize quotes to single in non-web files
This commit is contained in:
@@ -1,21 +1,21 @@
|
|||||||
import { Platform } from "react-native";
|
import { Platform } from 'react-native';
|
||||||
import { NitroModules } from "react-native-nitro-modules";
|
import { NitroModules } from 'react-native-nitro-modules';
|
||||||
import type { VideoPlayer as VideoPlayerImpl } from "../spec/nitro/VideoPlayer.nitro";
|
import type { VideoPlayer as VideoPlayerImpl } from '../spec/nitro/VideoPlayer.nitro';
|
||||||
import type { VideoPlayerSource } from "../spec/nitro/VideoPlayerSource.nitro";
|
import type { VideoPlayerSource } from '../spec/nitro/VideoPlayerSource.nitro';
|
||||||
import type { IgnoreSilentSwitchMode } from "./types/IgnoreSilentSwitchMode";
|
import type { IgnoreSilentSwitchMode } from './types/IgnoreSilentSwitchMode';
|
||||||
import type { MixAudioMode } from "./types/MixAudioMode";
|
import type { MixAudioMode } from './types/MixAudioMode';
|
||||||
import type { TextTrack } from "./types/TextTrack";
|
import type { TextTrack } from './types/TextTrack';
|
||||||
import type { NoAutocomplete } from "./types/Utils";
|
import type { NoAutocomplete } from './types/Utils';
|
||||||
import type { VideoConfig, VideoSource } from "./types/VideoConfig";
|
import type { VideoConfig, VideoSource } from './types/VideoConfig';
|
||||||
import {
|
import {
|
||||||
tryParseNativeVideoError,
|
tryParseNativeVideoError,
|
||||||
VideoRuntimeError,
|
VideoRuntimeError,
|
||||||
} from "./types/VideoError";
|
} from './types/VideoError';
|
||||||
import type { VideoPlayerBase } from "./types/VideoPlayerBase";
|
import type { VideoPlayerBase } from './types/VideoPlayerBase';
|
||||||
import type { VideoPlayerStatus } from "./types/VideoPlayerStatus";
|
import type { VideoPlayerStatus } from './types/VideoPlayerStatus';
|
||||||
import { createPlayer } from "./utils/playerFactory";
|
import { createPlayer } from './utils/playerFactory';
|
||||||
import { createSource } from "./utils/sourceFactory";
|
import { createSource } from './utils/sourceFactory';
|
||||||
import { VideoPlayerEvents } from "./events/VideoPlayerEvents";
|
import { VideoPlayerEvents } from './events/VideoPlayerEvents';
|
||||||
|
|
||||||
class VideoPlayer extends VideoPlayerEvents implements VideoPlayerBase {
|
class VideoPlayer extends VideoPlayerEvents implements VideoPlayerBase {
|
||||||
private _player: VideoPlayerImpl | undefined;
|
private _player: VideoPlayerImpl | undefined;
|
||||||
@@ -196,9 +196,9 @@ class VideoPlayer extends VideoPlayerEvents implements VideoPlayerBase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
set ignoreSilentSwitchMode(value: IgnoreSilentSwitchMode) {
|
set ignoreSilentSwitchMode(value: IgnoreSilentSwitchMode) {
|
||||||
if (__DEV__ && !["ios"].includes(Platform.OS)) {
|
if (__DEV__ && !['ios'].includes(Platform.OS)) {
|
||||||
console.warn(
|
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(
|
async replaceSourceAsync(
|
||||||
source:
|
source: VideoSource | VideoConfig | NoAutocomplete<VideoPlayerSource> | null
|
||||||
| VideoSource
|
|
||||||
| VideoConfig
|
|
||||||
| NoAutocomplete<VideoPlayerSource>
|
|
||||||
| null,
|
|
||||||
): Promise<void> {
|
): Promise<void> {
|
||||||
this.updateMemorySize();
|
this.updateMemorySize();
|
||||||
|
|
||||||
await this.wrapPromise(
|
await this.wrapPromise(
|
||||||
this.player.replaceSourceAsync(
|
this.player.replaceSourceAsync(
|
||||||
source === null ? null : createSource(source),
|
source === null ? null : createSource(source)
|
||||||
),
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
this.updateMemorySize();
|
this.updateMemorySize();
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import type { AllPlayerEvents as PlayerEvents } from "../types/Events";
|
import type { AllPlayerEvents as PlayerEvents } from '../types/Events';
|
||||||
import type { ListenerSubscription } from "../types/EventEmitter";
|
import type { ListenerSubscription } from '../types/EventEmitter';
|
||||||
import { VideoPlayerEventsBase } from "./VideoPlayerEventsBase";
|
import { VideoPlayerEventsBase } from './VideoPlayerEventsBase';
|
||||||
|
|
||||||
export class VideoPlayerEvents extends VideoPlayerEventsBase {
|
export class VideoPlayerEvents extends VideoPlayerEventsBase {
|
||||||
addEventListener<Event extends keyof PlayerEvents>(
|
addEventListener<Event extends keyof PlayerEvents>(
|
||||||
|
|||||||
@@ -1,3 +1,3 @@
|
|||||||
// Platform-specific versions: VideoPlayerEvents.native.ts, VideoPlayerEvents.web.ts
|
// Platform-specific versions: VideoPlayerEvents.native.ts, VideoPlayerEvents.web.ts
|
||||||
// This file is the default fallback for TypeScript resolution.
|
// This file is the default fallback for TypeScript resolution.
|
||||||
export { VideoPlayerEvents } from "./VideoPlayerEvents.native";
|
export { VideoPlayerEvents } from './VideoPlayerEvents.native';
|
||||||
|
|||||||
@@ -2,11 +2,11 @@ import {
|
|||||||
ALL_PLAYER_EVENTS,
|
ALL_PLAYER_EVENTS,
|
||||||
type JSVideoPlayerEvents,
|
type JSVideoPlayerEvents,
|
||||||
type AllPlayerEvents as PlayerEvents,
|
type AllPlayerEvents as PlayerEvents,
|
||||||
} from "../types/Events";
|
} from '../types/Events';
|
||||||
import type {
|
import type {
|
||||||
ListenerSubscription,
|
ListenerSubscription,
|
||||||
VideoPlayerEventEmitterBase,
|
VideoPlayerEventEmitterBase,
|
||||||
} from "../types/EventEmitter";
|
} from '../types/EventEmitter';
|
||||||
|
|
||||||
export class VideoPlayerEventsBase {
|
export class VideoPlayerEventsBase {
|
||||||
protected eventEmitter: VideoPlayerEventEmitterBase;
|
protected eventEmitter: VideoPlayerEventEmitterBase;
|
||||||
|
|||||||
@@ -6,9 +6,9 @@ import type {
|
|||||||
onProgressData,
|
onProgressData,
|
||||||
onVolumeChangeData,
|
onVolumeChangeData,
|
||||||
TimedMetadata,
|
TimedMetadata,
|
||||||
} from "./Events";
|
} from './Events';
|
||||||
import type { TextTrack } from "./TextTrack";
|
import type { TextTrack } from './TextTrack';
|
||||||
import type { VideoPlayerStatus } from "./VideoPlayerStatus";
|
import type { VideoPlayerStatus } from './VideoPlayerStatus';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A subscription that can be used to remove a listener.
|
* A subscription that can be used to remove a listener.
|
||||||
|
|||||||
@@ -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 => {
|
export const isVideoPlayerSource = (obj: any): obj is VideoPlayerSource => {
|
||||||
return (
|
return (
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
import type { ViewProps, ViewStyle } from "react-native";
|
import type { ViewProps, ViewStyle } from 'react-native';
|
||||||
import type { SurfaceType } from "../../spec/nitro/VideoViewViewManager.nitro";
|
import type { SurfaceType } from '../../spec/nitro/VideoViewViewManager.nitro';
|
||||||
import type { ListenerSubscription } from "../types/EventEmitter";
|
import type { ListenerSubscription } from '../types/EventEmitter';
|
||||||
import type { VideoViewEvents } from "../types/Events";
|
import type { VideoViewEvents } from '../types/Events';
|
||||||
import type { ResizeMode } from "../types/ResizeMode";
|
import type { ResizeMode } from '../types/ResizeMode';
|
||||||
import type { VideoPlayer } from "../VideoPlayer";
|
import type { VideoPlayer } from '../VideoPlayer';
|
||||||
|
|
||||||
export interface VideoViewProps extends Partial<VideoViewEvents>, ViewProps {
|
export interface VideoViewProps extends Partial<VideoViewEvents>, ViewProps {
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
export { useEvent } from "./core/hooks/useEvent";
|
export { useEvent } from './core/hooks/useEvent';
|
||||||
export { useVideoPlayer } from "./core/hooks/useVideoPlayer";
|
export { useVideoPlayer } from './core/hooks/useVideoPlayer';
|
||||||
export type * from "./core/types/Events";
|
export type * from './core/types/Events';
|
||||||
export type { IgnoreSilentSwitchMode } from "./core/types/IgnoreSilentSwitchMode";
|
export type { IgnoreSilentSwitchMode } from './core/types/IgnoreSilentSwitchMode';
|
||||||
export type { MixAudioMode } from "./core/types/MixAudioMode";
|
export type { MixAudioMode } from './core/types/MixAudioMode';
|
||||||
export type { ResizeMode } from "./core/types/ResizeMode";
|
export type { ResizeMode } from './core/types/ResizeMode';
|
||||||
export type { TextTrack } from "./core/types/TextTrack";
|
export type { TextTrack } from './core/types/TextTrack';
|
||||||
export type { VideoConfig, VideoSource } from "./core/types/VideoConfig";
|
export type { VideoConfig, VideoSource } from './core/types/VideoConfig';
|
||||||
export type {
|
export type {
|
||||||
LibraryError,
|
LibraryError,
|
||||||
PlayerError,
|
PlayerError,
|
||||||
@@ -16,12 +16,12 @@ export type {
|
|||||||
VideoErrorCode,
|
VideoErrorCode,
|
||||||
VideoRuntimeError,
|
VideoRuntimeError,
|
||||||
VideoViewError,
|
VideoViewError,
|
||||||
} from "./core/types/VideoError";
|
} from './core/types/VideoError';
|
||||||
export type { VideoPlayerStatus } from "./core/types/VideoPlayerStatus";
|
export type { VideoPlayerStatus } from './core/types/VideoPlayerStatus';
|
||||||
|
|
||||||
export { VideoPlayer } from "./core/VideoPlayer";
|
export { VideoPlayer } from './core/VideoPlayer';
|
||||||
export { default as VideoView } from "./core/video-view/VideoView";
|
export { default as VideoView } from './core/video-view/VideoView';
|
||||||
export type {
|
export type {
|
||||||
VideoViewProps,
|
VideoViewProps,
|
||||||
VideoViewRef,
|
VideoViewRef,
|
||||||
} from "./core/video-view/VideoViewProps";
|
} from './core/video-view/VideoViewProps';
|
||||||
|
|||||||
Reference in New Issue
Block a user