fix: wrap onwarn values in an object as expected by the playlist-loader #1428
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.
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