diff --git a/src/experimental/tools/VideoThumbnailLoader/prepare_source_buffer.ts b/src/experimental/tools/VideoThumbnailLoader/prepare_source_buffer.ts index 215163c776..40fbd1ebe2 100644 --- a/src/experimental/tools/VideoThumbnailLoader/prepare_source_buffer.ts +++ b/src/experimental/tools/VideoThumbnailLoader/prepare_source_buffer.ts @@ -19,7 +19,7 @@ import type { IMediaElement } from "../../../compat/browser_compatibility_types" import log from "../../../log"; import { resetMediaElement, - disableRemotePlayback, + disableRemotePlaybackOnManagedMediaSource, } from "../../../main_thread/init/utils/create_media_source"; import { SourceBufferType } from "../../../mse"; import type { MainSourceBufferInterface } from "../../../mse/main_media_source_interface"; @@ -69,7 +69,7 @@ export default function prepareSourceBuffer( resetMediaElement(videoElement, objectURL); }); } - disableRemotePlayback(videoElement, cleanUpSignal); + disableRemotePlaybackOnManagedMediaSource(videoElement, cleanUpSignal); mediaSource.addEventListener("mediaSourceOpen", onSourceOpen); return () => { diff --git a/src/main_thread/init/multi_thread_content_initializer.ts b/src/main_thread/init/multi_thread_content_initializer.ts index 579debcaa7..3b76ee679d 100644 --- a/src/main_thread/init/multi_thread_content_initializer.ts +++ b/src/main_thread/init/multi_thread_content_initializer.ts @@ -59,7 +59,10 @@ import sendMessage from "./send_message"; import type { ITextDisplayerOptions } from "./types"; import { ContentInitializer } from "./types"; import createCorePlaybackObserver from "./utils/create_core_playback_observer"; -import { resetMediaElement, disableRemotePlayback } from "./utils/create_media_source"; +import { + resetMediaElement, + disableRemotePlaybackOnManagedMediaSource, +} from "./utils/create_media_source"; import type { IInitialTimeOptions } from "./utils/get_initial_time"; import getInitialTime from "./utils/get_initial_time"; import getLoadedReference from "./utils/get_loaded_reference"; @@ -460,7 +463,7 @@ export default class MultiThreadContentInitializer extends ContentInitializer { resetMediaElement(mediaElement, mediaSourceLink.value); }); } - disableRemotePlayback( + disableRemotePlaybackOnManagedMediaSource( mediaElement, this._currentMediaSourceCanceller.signal, ); @@ -1791,7 +1794,7 @@ export default class MultiThreadContentInitializer extends ContentInitializer { resetMediaElement(mediaElement, url); }); mediaSourceStatus.setValue(MediaSourceInitializationStatus.Attached); - disableRemotePlayback( + disableRemotePlaybackOnManagedMediaSource( mediaElement, this._currentMediaSourceCanceller.signal, ); diff --git a/src/main_thread/init/utils/create_media_source.ts b/src/main_thread/init/utils/create_media_source.ts index 602730e0d4..1baa39c876 100644 --- a/src/main_thread/init/utils/create_media_source.ts +++ b/src/main_thread/init/utils/create_media_source.ts @@ -71,7 +71,7 @@ export function resetMediaElement( * @param {CancellationSignal} cancellationSignal - The signal that, when triggered, * restores the `disableRemotePlayback` attribute to its original value. */ -export function disableRemotePlayback( +export function disableRemotePlaybackOnManagedMediaSource( mediaElement: IMediaElement, cancellationSignal: CancellationSignal, ) { @@ -115,7 +115,7 @@ function createMediaSource( const oldSrc = isNonEmptyString(mediaElement.src) ? mediaElement.src : null; resetMediaElement(mediaElement, oldSrc); const mediaSource = new MainMediaSourceInterface(generateMediaSourceId()); - disableRemotePlayback(mediaElement, unlinkSignal); + disableRemotePlaybackOnManagedMediaSource(mediaElement, unlinkSignal); unlinkSignal.register(() => { mediaSource.dispose(); });