fix: Added a warning when tracks are being added before player init#1317
Open
spuppo-mux wants to merge 1 commit intomuxinc:mainfrom
Open
fix: Added a warning when tracks are being added before player init#1317spuppo-mux wants to merge 1 commit intomuxinc:mainfrom
spuppo-mux wants to merge 1 commit intomuxinc:mainfrom
Conversation
|
@spuppo-mux is attempting to deploy a commit to the Mux Team on Vercel. A member of the Team first needs to authorize it. |
✅ Snyk checks have passed. No issues have been found so far.
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse. |
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.
Closes https://github.com/muxinc/devextravaganza/issues/215
Relates to a behavior we often see (mainly on Safari) that adding a track to the player element before it initializes, causes playback to buffer indefinitely. For example https://github.com/muxinc/devextravaganza/issues/215.
While this PR does not fix the issue, it adds a warning so this behavior is easier to identify.
An example where this could happen is if on React a user were to write this it would log a warning:
To address this they should do something like this:
Note
Low Risk
Low risk: adds console warnings only; behavior and data flow for chapters/cue points remain unchanged aside from extra logging that could be noisy in some apps.
Overview
Adds a guard in
MuxVideoBaseElement.addCuePoints()andaddChapters()toconsole.warnwhen these are called before the media element has acurrentSrc, nudging callers to wait for initial load (e.g.,loadstart). No functional change to how cue points/chapters are added beyond emitting the warning.Reviewed by Cursor Bugbot for commit ce3c216. Bugbot is set up for automated code reviews on this repo. Configure here.