-
Notifications
You must be signed in to change notification settings - Fork 421
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: transmux before append (TBA) and low latency http streaming (LHLS) #494
Conversation
@@ -210,15 +225,7 @@ export class MasterPlaylistController extends videojs.EventTarget { | |||
}); | |||
|
|||
this.triggerPresenceUsage_(this.master(), media); | |||
|
|||
try { |
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 is handled by a sourceopen
on the media source in handleSourceOpen_()
@@ -276,30 +283,6 @@ export class MasterPlaylistController extends videojs.EventTarget { | |||
this.audioSegmentLoader_.load(); | |||
} | |||
} | |||
|
|||
if (!updatedPlaylist.endList) { |
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.
Presumably we no longer have to update seekable
or deal with durationchange
since we are using a native media source. This code should have lived in our non-native media source I think.
@@ -395,10 +378,6 @@ export class MasterPlaylistController extends videojs.EventTarget { | |||
this.tech_.trigger({type: 'usage', name: 'hls-aes'}); | |||
} | |||
|
|||
if (Hls.Playlist.isFmp4(media)) { | |||
this.tech_.trigger({type: 'usage', name: 'hls-fmp4'}); |
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 code was moved to setupSegmentLoaderListeners_()
and we trigger the usage event when a segmentLoader
triggers an fmp4
event.
@@ -472,24 +461,31 @@ export class MasterPlaylistController extends videojs.EventTarget { | |||
}, ABORT_EARLY_BLACKLIST_SECONDS); | |||
}); | |||
|
|||
this.mainSegmentLoader_.on('reseteverything', () => { | |||
// If playing an MTS stream, a videojs.MediaSource is listening for |
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.
we use a native media source so reseteverything
and segmenttimemapping
are no longer fired or needed.
043f330
to
db5f24f
Compare
* @private | ||
*/ | ||
handleSourceEnded_() { | ||
if (!this.inbandTextTracks_.metadataTrack_) { |
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.
mostly taken and modified from the sourceended
handler in html-media-source
98ec660
to
fdfd3a3
Compare
// even if the media source is open and source buffers are not | ||
// updating, something about the media source being in an invalid state. | ||
this.logger_(`Setting duration from ${this.mediaSource.duration} => ${newDuration}`); | ||
try { |
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.
The try catch here was moved into sourceUpdaters actions.duration
handler. Most of the rest of this logic is reformatted but unchanged.
068da21
to
9aec73c
Compare
// loader and not restart the audio loaders | ||
mainSegmentLoader.resetEverything(); | ||
return; | ||
if (type === 'AUDIO') { |
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.
I think this just handles moving from demuxed audio/video to muxed audio/video in a better way.
* | ||
* @return {Boolean} true if the playlist contains fMP4 | ||
*/ | ||
export const isFmp4 = function(media) { |
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.
We now use util/codecs.js#isLikelyFmp4Data()
to determine if a segment is fmp4 during media segment requests. Then we add segment.isFmp4
to the segment object.
f21c2d2
to
373e4ea
Compare
|
||
for (let trackId in segment.captionStreams) { | ||
if (!sourceBuffer.inbandTextTracks_[trackId]) { | ||
player.tech_.trigger({type: 'usage', name: 'hls-608'}); |
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.
all of this logic was the same as createCaptionsTrackIfNotExists
.
export const addTextTrackData = function(sourceHandler, captionArray, metadataArray) { | ||
let Cue = window.WebKitDataCue || window.VTTCue; | ||
|
||
if (captionArray) { |
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 is/was addCaptionData
, not sure why we repeated the logic here, but it was removed and is now done in segment-loader
.
74b70cc
to
f757166
Compare
this.pendingCallback_ = null; | ||
this.sourceBuffer_.removing = false; | ||
|
||
this.logger_(`buffered [${printableRange(this.buffered())}]`); |
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 logic is now in the onUpdateend
function right above the class for this file.
sourceUpdater: this, | ||
action: actions.callback(callback), | ||
name: 'callback' | ||
}); | ||
} | ||
} |
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.
I think this file will eventually need some updates. Some places we have function that pass a type
and are generic for audio and video. Then others functions are prepended with audio
or video
(IE audioTimestampOffset
vs videoTimestampOffset
) and they do nearly the same thing.
* | ||
* @param {SegmentInfo} segmentInfo - The current active request information | ||
*/ | ||
probeSegmentInfo(segmentInfo) { |
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.
All of the probe logic seems to have been moved into src/util/segment
and I think we store syncinfo on the playlist now.
} | ||
}); | ||
|
||
transmuxer.on('caption', function(caption) { |
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.
I think caption
and id3Frame
takes the place of transmuxer.captionStream
?
5dac930
to
2590492
Compare
12f62c3
to
cabf2c1
Compare
cabf2c1
to
3781b26
Compare
c632c4c
to
adfb2cc
Compare
1d5a23b
to
ee5bcbb
Compare
af9912b
to
cf2030e
Compare
cf2030e
to
41aadb3
Compare
Description
This takes most of the changes from #466, gesinger#10, and changes that have occurred in master since both of those and packages them up.
I still have the following to do:
mux.js
segmentTimingInfo
/videoSegmentTimingInfo
andtimingInfo
/videoTimingInfo
.This is based on the following, which will have to be merged first: