Skip to content

Commit

Permalink
Remove FORCED_MEDIA_SOURCE
Browse files Browse the repository at this point in the history
  • Loading branch information
peaBerberian committed Jun 28, 2024
1 parent 7512dba commit a7b5049
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 13 deletions.
6 changes: 0 additions & 6 deletions src/compat/browser_compatibility_types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -230,12 +230,6 @@ export interface IMediaElementEventMap {
* implement it.
*/
export interface IMediaElement extends IEventTarget<IMediaElementEventMap> {
/**
* Optional property allowing to force a specific MSE Implementation when
* relying on a given `IMediaElement`.
*/
FORCED_MEDIA_SOURCE?: new () => IMediaSource;

/* From `HTMLMediaElement`: */
autoplay: boolean;
buffered: TimeRanges;
Expand Down
5 changes: 1 addition & 4 deletions src/main_thread/init/utils/create_media_source.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,10 +75,7 @@ function createMediaSource(
// make sure the media has been correctly reset
const oldSrc = isNonEmptyString(mediaElement.src) ? mediaElement.src : null;
resetMediaElement(mediaElement, oldSrc);
const mediaSource = new MainMediaSourceInterface(
generateMediaSourceId(),
"FORCED_MEDIA_SOURCE" in mediaElement ? mediaElement.FORCED_MEDIA_SOURCE : undefined,
);
const mediaSource = new MainMediaSourceInterface(generateMediaSourceId());
unlinkSignal.register(() => {
mediaSource.dispose();
});
Expand Down
5 changes: 2 additions & 3 deletions src/mse/main_media_source_interface.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ export default class MainMediaSourceInterface
* You can then obtain a link to that `MediaSource`, for example to link it
* to an `HTMLMediaElement`, through the `handle` property.
*/
constructor(id: string, forcedMediaSource?: new () => IMediaSource) {
constructor(id: string) {
super();
this.id = id;
this.sourceBuffers = [];
Expand All @@ -83,8 +83,7 @@ export default class MainMediaSourceInterface
}

log.info("Init: Creating MediaSource");
const mediaSource =
forcedMediaSource !== undefined ? new forcedMediaSource() : new MediaSource_();
const mediaSource = new MediaSource_();
const handle = (mediaSource as unknown as { handle: MediaProvider }).handle;
this.handle = isNullOrUndefined(handle)
? /* eslint-disable-next-line @typescript-eslint/ban-types */
Expand Down

0 comments on commit a7b5049

Please sign in to comment.