Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: wrap onwarn values in an object as expected by the playlist-loader #1428

Merged

Conversation

ianjaku
Copy link
Contributor

@ianjaku ianjaku commented Sep 26, 2023

Description

Hey, apologies for not first opening an issue, but it's a very small fix.
When debugging an issue in one of my projects I noticed the debug log: VIDEOJS: DEBUG: VHS: PlaylistLoader > m3u8-parser warn for [URL]: undefined.

This is caused by PlaylistLoader#parseManifest_ expecting onwarn to be called with an object that has a message parameter. In manifest.js#parseManifest the onwarn method is sometimes called with a string. It's also called with a message object inside the m3u8 parser.

Specific Changes proposed

We could either change onwarn to always return a string, or return a message object from inside manifest.js#parseManifest.
In this fix I went with the latter as to not break any usage of parseManifest.

Please let me know if anything is unclear, I'll be happy to append the PR.

Requirements Checklist

  • Bug fixed
  • Reviewed by Two Core Contributors

@welcome
Copy link

welcome bot commented Sep 26, 2023

💖 Thanks for opening this pull request! 💖

Things that will help get your PR across the finish line:

  • Run npm run lint -- --errors locally to catch formatting errors earlier.
  • Include tests when adding/changing behavior.
  • Include screenshots and animated GIFs whenever possible.

We get a lot of pull requests on this repo, so please be patient and we will get back to you as soon as we can.

@codecov
Copy link

codecov bot commented Sep 28, 2023

Codecov Report

Merging #1428 (5c7edd6) into main (dd5e2af) will not change coverage.
The diff coverage is 50.00%.

@@           Coverage Diff           @@
##             main    #1428   +/-   ##
=======================================
  Coverage   85.98%   85.98%           
=======================================
  Files          42       42           
  Lines       10428    10428           
  Branches     2412     2412           
=======================================
  Hits         8967     8967           
  Misses       1461     1461           
Files Coverage Δ
src/manifest.js 93.57% <50.00%> (ø)

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

Copy link
Contributor

@mister-ben mister-ben left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

Copy link
Contributor

@adrums86 adrums86 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:shipit:

@ianjaku
Copy link
Contributor Author

ianjaku commented Oct 18, 2023

Is there a way to get this merged without writing additional tests?

The change is extremely simple, and there is no regression as this was untested behaviour before the change.

@mister-ben mister-ben merged commit beccfa1 into videojs:main Oct 18, 2023
5 of 6 checks passed
@welcome
Copy link

welcome bot commented Oct 18, 2023

Congrats on merging your first pull request! 🎉🎉🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants