diff --git a/packages/react-native-video/src/core/VideoPlayer.web.ts b/packages/react-native-video/src/core/VideoPlayer.web.ts index d08b1304..a931b83c 100644 --- a/packages/react-native-video/src/core/VideoPlayer.web.ts +++ b/packages/react-native-video/src/core/VideoPlayer.web.ts @@ -15,6 +15,7 @@ import type { VideoPlayerStatus } from './types/VideoPlayerStatus'; import { VideoPlayerEvents } from './events/VideoPlayerEvents'; import { MediaSessionHandler } from './web/MediaSession'; import { WebEventEmitter } from './web/WebEventEmitter'; +import { WebMediaProxy } from './web/WebMediaProxy'; import type { VideoStore } from './web/VideoStore'; function setExternalSubtitles( @@ -84,22 +85,10 @@ function selectTrack( } class VideoPlayer extends VideoPlayerEvents implements WebVideoPlayer { - private video: HTMLVideoElement; - private _storeRef: WeakRef | null = null; + private _media: WebMediaProxy; private mediaSession: MediaSessionHandler | null = null; private _source: NativeVideoConfig | undefined; - /** Returns store if alive, null if destroyed or disconnected. */ - private get _store(): VideoStore | null { - const store = this._storeRef?.deref() ?? null; - return store?.destroyed ? null : store; - } - - /** Store when available, video element fallback. */ - private get media(): VideoStore | HTMLVideoElement { - return this._store ?? this.video; - } - /** * Creates a detached