-
Notifications
You must be signed in to change notification settings - Fork 101
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
feat: Add llhls preloadSegment, add parts to segments, and fix byterange for parts/preloadHints #137
Conversation
@@ -5,6 +5,21 @@ import Stream from '@videojs/vhs-utils/es/stream.js'; | |||
|
|||
const TAB = String.fromCharCode(0x09); | |||
|
|||
const parseByterange = function(byterangeString) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Moved all byterange parsing into here as we do this for map
, byterange
, and part
@@ -535,6 +543,11 @@ export default class ParseStream extends Stream { | |||
['BYTERANGE-START', 'BYTERANGE-LENGTH'].forEach(function(key) { | |||
if (event.attributes.hasOwnProperty(key)) { | |||
event.attributes[key] = parseInt(event.attributes[key], 10); | |||
|
|||
const subkey = key === 'BYTERANGE-LENGTH' ? 'length' : 'offset'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This one is a bit different as we have attributes for both offest
and length
@@ -92,6 +92,7 @@ export default class Parser extends Stream { | |||
let currentMap; | |||
// if specified, the active decryption key | |||
let key; | |||
let hasParts = false; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added this to keep renditionReport warnings firing if we get a rendition report before any parts.
currentUri.timeline = currentTimeline; | ||
} | ||
|
||
this.manifest.preloadSegment = currentUri; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
build preload segment if we get end
without getting an actual segment uri.
@@ -115,6 +116,29 @@ export default class Parser extends Stream { | |||
// to provide the offset, in which case it defaults to the next byte after the | |||
// previous segment | |||
let lastByterangeEnd = 0; | |||
// keep track of the last seen part's byte range end. | |||
let lastPartByterangeEnd = 0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
keep track of the current part byterange
|
good call on the byterange stuff @gkatsev I think I got locked in on making the code look similar to what it used to and didn't simplify enough. |
Co-authored-by: Garrett Singer <[email protected]>
…ts, unify byterange handling (videojs#137)
This does a few things: