Skip to content

Commit

Permalink
update function name
Browse files Browse the repository at this point in the history
  • Loading branch information
Florent-Bouisset committed Nov 14, 2024
1 parent 0605c9b commit a5cbf86
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down Expand Up @@ -69,7 +69,7 @@ export default function prepareSourceBuffer(
resetMediaElement(videoElement, objectURL);
});
}
disableRemotePlayback(videoElement, cleanUpSignal);
disableRemotePlaybackOnManagedMediaSource(videoElement, cleanUpSignal);

mediaSource.addEventListener("mediaSourceOpen", onSourceOpen);
return () => {
Expand Down
9 changes: 6 additions & 3 deletions src/main_thread/init/multi_thread_content_initializer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down Expand Up @@ -460,7 +463,7 @@ export default class MultiThreadContentInitializer extends ContentInitializer {
resetMediaElement(mediaElement, mediaSourceLink.value);
});
}
disableRemotePlayback(
disableRemotePlaybackOnManagedMediaSource(
mediaElement,
this._currentMediaSourceCanceller.signal,
);
Expand Down Expand Up @@ -1791,7 +1794,7 @@ export default class MultiThreadContentInitializer extends ContentInitializer {
resetMediaElement(mediaElement, url);
});
mediaSourceStatus.setValue(MediaSourceInitializationStatus.Attached);
disableRemotePlayback(
disableRemotePlaybackOnManagedMediaSource(
mediaElement,
this._currentMediaSourceCanceller.signal,
);
Expand Down
4 changes: 2 additions & 2 deletions src/main_thread/init/utils/create_media_source.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
) {
Expand Down Expand Up @@ -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();
});
Expand Down

0 comments on commit a5cbf86

Please sign in to comment.