feat: support temporal media fragment URIs#7721
feat: support temporal media fragment URIs#7721christriants wants to merge 6 commits intovideo-dev:masterfrom
Conversation
robwalch
left a comment
There was a problem hiding this comment.
If this were all encapsulated in an optional media fragment controller, then a config class would make it extendable, replaceable, and optional, so that apps configuring HLS.js could ignore media fragments or customize their handling.
1c07e23 to
4c3f772
Compare
4c3f772 to
a7c00b1
Compare
a7c00b1 to
7ce13b6
Compare
|
Thanks, @robwalch. I've addressed feedback by creating the |
|
Thanks for the feedback @robwalch! I've addressed your feedback. While investigating the seeking behavior question, I re-read the W3C Media Fragments URI spec and realized I missed some features including:
I tested these features out in hls.js, and also within browsers. So the PR has grown a bit because I've added support for these spec-compliant features, but all existing functionality remains unchanged. |
This PR will...
Add support for W3C Media Fragments URI (temporal dimension) to allow loading and playing specific time ranges of HLS streams using URL fragments like
video.m3u8#t=100,110.New functionality:
MEDIA_FRAGMENT_PARSEDandMEDIA_FRAGMENT_ENDevents for application integrationMore about
MediaFragmentController:This has been implemented as a separate, optional controller module (can be disabled via config). It listens to
MANIFEST_LOADINGevents to intercept and parse fragments, and attaches media element listeners only when fragment end time is specified. It should automatically detach listeners after pausing.Why is this Pull Request needed?
Media Fragment URIs are part of the W3C specification and are natively supported by browsers for direct video playback. However, we do not currently support this feature, meaning applications using
hls.jscannot use fragment URIs to link to specific time ranges in videos.Are there any points in the code the reviewer needs to double check?
Resolves issues:
Closes #5445
Testing:
Manual testing and demo available at: https://hlsjs-temporal-media-fragments.pages.dev/
Tested scenarios include:
#t=start,endChecklist