Refactor/Rename PlaybackObserver to MediaElementMonitor - #1754
Open
peaBerberian wants to merge 2 commits into
Open
Refactor/Rename PlaybackObserver to MediaElementMonitor#1754peaBerberian wants to merge 2 commits into
PlaybackObserver to MediaElementMonitor#1754peaBerberian wants to merge 2 commits into
Conversation
peaBerberian
force-pushed
the
poc/common-init-renaming
branch
from
October 9, 2025 14:18
af6e10d to
b7b34ed
Compare
peaBerberian
force-pushed
the
misc/renaming-playback-observer
branch
from
October 9, 2025 14:20
6652566 to
0fa2c02
Compare
peaBerberian
force-pushed
the
misc/renaming-playback-observer
branch
from
October 9, 2025 17:26
0fa2c02 to
d725569
Compare
peaBerberian
force-pushed
the
dev
branch
4 times, most recently
from
October 13, 2025 20:54
6cfd206 to
1e55170
Compare
peaBerberian
force-pushed
the
misc/renaming-playback-observer
branch
7 times, most recently
from
October 31, 2025 14:54
ba8892f to
5833b27
Compare
peaBerberian
force-pushed
the
misc/renaming-playback-observer
branch
from
November 12, 2025 14:43
5833b27 to
950fc06
Compare
peaBerberian
force-pushed
the
misc/renaming-playback-observer
branch
from
December 10, 2025 15:12
950fc06 to
ec1a402
Compare
github-actions
Bot
force-pushed
the
dev
branch
from
December 10, 2025 15:50
a42734c to
29372ac
Compare
peaBerberian
force-pushed
the
misc/renaming-playback-observer
branch
from
December 10, 2025 17:25
ec1a402 to
aebf9df
Compare
peaBerberian
force-pushed
the
dev
branch
2 times, most recently
from
December 19, 2025 19:49
d4be192 to
9ad6758
Compare
peaBerberian
force-pushed
the
dev
branch
7 times, most recently
from
June 4, 2026 16:11
470c3f8 to
3dde189
Compare
peaBerberian
force-pushed
the
misc/renaming-playback-observer
branch
7 times, most recently
from
August 6, 2026 17:26
e6bc908 to
51d01f0
Compare
peaBerberian
force-pushed
the
misc/renaming-playback-observer
branch
from
August 7, 2026 14:34
51d01f0 to
0a37193
Compare
peaBerberian
force-pushed
the
dev
branch
2 times, most recently
from
August 7, 2026 15:08
01b00b9 to
3a8968e
Compare
peaBerberian
force-pushed
the
misc/renaming-playback-observer
branch
2 times, most recently
from
August 11, 2026 15:30
60fac4e to
ee3e55c
Compare
peaBerberian
force-pushed
the
misc/renaming-playback-observer
branch
from
September 1, 2026 09:43
ee3e55c to
731c46d
Compare
|
✅ Automated performance checks have passed on commit DetailsPerformance tests 1st run outputNo significative change in performance for tests:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
TL;DR: This is a code simplification proposal to set a single interface for all
HTMLMediaElementinteractions, under a class namedMediaElementMonitor. This is just a merge of the previousPlaybackObservermodule (which monitors playback) and of previously directHTMLMediaElementaccess (which would now be avoided in profit of callingMediaElementMonitormethods).Based on #1645
I worked on multiple R&D subjects recently that needed a re-thinking of how we interact with the media element in the core logic:
The "preload" work (to preload a content in-memory before playback).
Here the idea was to make most core RxPlayer modules work optionally "headlessly" during a preloading phase (without an actual media element to play on), and to then be able to "hot swap" the media element at any point if the content needed to be actually played - with the intent of speeding up loading time for future contents.
The "Core Dump" work (a planned API to output an extensive snapshot of the RxPlayer state and playback conditions on playback errors - for debugging, logging and advanced experimental mitigations purposes of platform issues).
Here I needed to be able to access many media properties at once and both their current states but also their last pre-error status.
On both of those subjects, I found that passing around both the media element and a
PlaybackObservereverywhere was awkward and unnecessary: thePlaybackObserveralready contains the media element and has to be used for some side-effects: e.g. seeking has to go through it.So I propose here to just define a single interface to the media element.
The most difficult step has been to know what to name that thing. Initially I went with
MediaElementInterface, but it didn't seem to be really indicative of what 99% of its use is, which is to monitor playback conditions.So in the end I just went with
MediaElementMonitor. Though it also allows side-effect on the media element (seeking, settingsrc...)Not everything is simplified yet (there are still places when I rely on the two), but it's a good first step.