-
Notifications
You must be signed in to change notification settings - Fork 428
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
Initial DASH Support #8
Conversation
…before appending data
…out source buffer emitter
It would be nice to have |
src/videojs-http-streaming.js
Outdated
return options; | ||
} | ||
|
||
// upsert the content types based on the selected playlist |
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.
upsert
src/videojs-http-streaming.js
Outdated
@@ -418,6 +455,18 @@ class HlsHandler extends Component { | |||
this.masterPlaylistController_.on('selectedinitialmedia', () => { | |||
// Add the manual rendition mix-in to HlsHandler | |||
renditionSelectionMixin(this); | |||
|
|||
if (this.options_.sourceType === 'dash') { |
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.
It'd be nice to put this in like a this.setupEmeOptions_()
// if the first mime type has muxed video and audio then we shouldn't wait on the | ||
// second source buffer | ||
mimeTypes.length > 1 && mimeTypes[0].indexOf(',') === -1 ? | ||
new videojs.EventTarget() : null; |
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 might want to think about expanding this emitter concept to its own controller class. When we start tearing apart flash and pulling the muxer into vhs and removing contrib-media-sources, we will still need a place for some of the contrib-media-sources logic to live e.g. buffer management logic that was added to address the edge/ie corruption issues
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 agree that we may end up needing that, but for now I think it's best to hold off. We may not get to it for a while, and if we do get to it sooner, it may end up having different requirements than we suppose right now.
} | ||
} | ||
|
||
media(playlist) { |
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.
Would it be possible to get function comments here? Mostly I'm asking as this has a few pieces of nuance (the playlist can be a string or object, and thus will be handled differently, as well as the fact that it is both a getter and a setter).
|
||
const mediaChange = !this.media_ || playlist.uri !== this.media_.uri; | ||
|
||
this.state = 'HAVE_METADATA'; |
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.
Are these states doc'ed anywhere? Might be nice to have them doc'ed in some form, as it might make debugging easier (particularly if there is a sequence to these events).
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.
these states mimic the PlaylistLoader states
https://github.com/videojs/http-streaming/blob/master/docs/arch.md
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.
Ah nice, this is what I was looking for.
for (let i = 0; i < this.master.playlists.length; i++) { | ||
const phonyUri = `placeholder-uri-${i}`; | ||
|
||
this.master.playlists[i].uri = phonyUri; |
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.
should also add resolvedUri
here, quite a few places outside of this class use resolvedUri
instead of uri
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.
maybe not quite a few since media-groups has source type checking now, but there is a spot in MPC and external plugins may look for it
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 forgot, it actually gets added in setupMediaPlaylists
Note: requires linking or building videojs-contrib-eme (to ensure a build in dist/)
@@ -516,7 +516,7 @@ export default class SyncController extends videojs.EventTarget { | |||
time: segment.start, | |||
accuracy: 0 | |||
}; | |||
} else if (playlist.discontinuityStarts.length) { | |||
} else if (playlist.discontinuityStarts && playlist.discontinuityStarts.length) { |
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 will probably depend on how we plan to handle multi-period dash, and this extra check isn't problematic in anyway, but m3u8-parser always attaches an empty array for discontinuityStarts
. If we plan to treat multi-period dash as discontinuities, then this check may be unnecessary, but still ok to be there
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.
Good call. I think we can just leave it in until we handle multi-period dash in the mpd-parser (so we know for sure).
const sourceType = simpleTypeFromSourceType(type); | ||
|
||
if (sourceType === 'dash') { | ||
if (!options.hls.overrideNative && Hls.supportsNativeDash) { |
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 we should always override native DASH playback
// isn't the most appropriate form of reference for video.js (since all APIs should | ||
// be provided through core video.js), it is a common pattern for plugins, and vhs | ||
// will act accordingly. | ||
_player.vhs = this; |
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 need this to map to deprecated player.dash
and player.hls
.
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.
Did we have a player.hls
? I though just player.tech_.hls
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.
Uses could access player.hls.representations
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 forgot that it's already available (albeit deprecated). Since it still exists they should be able to continue to use it without issue.
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.
Requires a videojs-contrib-eme version
package.json
Outdated
@@ -92,6 +92,7 @@ | |||
"global": "^4.3.0", | |||
"m3u8-parser": "2.1.0", | |||
"mux.js": "4.3.2", | |||
"mpd-parser": "0.0.1", |
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.
mpd-parser is now on 0.2.0
package.json
Outdated
@@ -134,6 +135,7 @@ | |||
"shelljs": "^0.5.3", | |||
"sinon": "1.10.2", | |||
"uglify-js": "^2.5.0", | |||
"videojs-contrib-eme": "http://github.com/gesinger/videojs-contrib-eme#options-rework", |
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.
Remember to point to a contrib-eme version with the necessary changes
Looks good to me |
Lead Maintainers: | ||
- Jon-Carlos Rivera [@imbcmdth](https://github.com/imbcmdth) | ||
- Joe Forbes [@forbesjo](https://github.com/forbesjo) | ||
- Matthew Neil [@mjneil](https://github.com/mjneil) |
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.
nice
@@ -105,6 +106,29 @@ const getCodecs = function(media) { | |||
return defaultCodecs; | |||
}; | |||
|
|||
const audioProfileFromDefault = (master, audioGroupId) => { |
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.
Maybe this would be a good opportunity to move this and other codec related helper functions into util/codecs.js
to help cleanup this file a bit?
}; | ||
}; | ||
|
||
const setupEmeOptions = (hlsHandler) => { |
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.
probably would be better to use vhsHandler
naming
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.
just realized, are we not making name changes for HlsHandler
my hls->vhs name change suggestions probably shouldn't be done then
@@ -546,7 +622,7 @@ const HlsSourceHandler = function(mode) { | |||
tech.hls = new HlsHandler(source, tech, localOptions); |
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.
Do we want to make this be tech.vhs
and point tech.hls = tech.vhs
for backwards comp?
<MPD xmlns="urn:mpeg:dash:schema:mpd:2011" profiles="urn:mpeg:dash:profile:full:2011" minBufferTime="1.5" mediaPresentationDuration="PT4S"> | ||
<Period> | ||
<BaseURL>main/</BaseURL> | ||
<AdaptationSet mimeType="video/mp4"> |
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.
Should we add an AdaptionSet for vtt since mpd-parser 0.2.0 supports vtt now?
Going to merge this and open the suggested comments in a new PR. |
chrome canary support
…e-updater-duration Use source updater to update media source duration
Description
Initial DASH support with DRM support via videojs-contrib-eme
Will update the documentation, but wanted to put the PR up for early review.
Requirements Checklist