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
Allow for other media sources and destinations (i.e encapsulate MSE concerns into buffer controller only) #60
Conversation
…cerns into MSE-specialized buffer-controller 3. Renames functions and attribute names from video to media (as it can also be audio DOM elements used)
@mangui Would be great if you could check this out whenever you find time :) |
@tchakabam regarding 2, that would bring a bunch of refactoring. could you elaborate with another use case ? |
@mangui On certain platforms, MSE might not be the (only / available) way to decode a stream. We might use That'll also enable to integrate it with open JS codecs implementations (where we will play stuff onto a canvas / web audio sink eventually but MSE is not involved). Also you might just want to download HLS data without actually playing it, just for means of prefetching or offline synchronization. It makes sense to decouple the concerns here. Furthermore architecturally, I think it would make more sense to chain the elements in a stream-like way. HLS is a protocol that provides data to a player, lets not make the implementation dependent what technology the player is using to play that data :) |
And not to be forgotten: custom encryption modes, custom integration with DRM services and/or EME (Encrypted Media Extensions), where you will want to take the media payload and write your own coupling around these APIs (EME & MSE) or something custom. It could even be fed into Flash - essentially the great thing here is to have a transport implementation of HLS in JavaScript and to be able to leverage it onto any existing or future playback technology. |
understood @tchakabam
you can remove SOURCE_ATTACHED/SOURCE_DETACHED the doc (API ...) should be updated as well to reflect those changes |
…changed spec. Renamed video occurences to media.
OK cool 👍 I know its a bit of a refactoring but on the long run I think it makes a lot of sense. There was already the "StreamBufferController" on the branch I was working on but I removed it for now because it's still in development and it would make this PR a mess. But I will push this soon when we have merged this, and you'll see what the idea was :) Anyway its already possible to substitute the "standard" MSEBufferController by an own implementation by passing it in the config now. But I refrained from putting the latter class in an own directory for now since its the only actual implementation of this component at this day. Ideally i think it also needs only one implementation, but it could be decoupled from MSE and simply push data to downstream components like the demuxer and decoder, eventually the sink will be MSE. That should also make it simpler to use different demuxers, like integrating with mux.js or other stuff for example if it would be necessary. Looks good from your side with the latest changes now? |
@@ -35,6 +35,7 @@ | |||
}, | |||
"dependencies": { | |||
"babelify": "^6.1.2", | |||
"stream-browserify": "^2.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.
not needed ?
yes @tchakabam , looks good ! |
Conflicts: src/controller/mse-buffer-controller.js src/hls.js
@mangui OK done. reason why i had |
there are still some reference to attachMediaElement/detachMediaElement |
k should be good now ;) |
@@ -96,49 +97,21 @@ class Hls { | |||
this.bufferController.destroy(); | |||
//this.fpsController.destroy(); | |||
this.url = null; | |||
this.detachVideo(); | |||
this.detachMediaElement(); |
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 you sure ? 😄
perfect, will test and merge tomorrow. |
@mangui I think that makes perfect sense as a name! but i'll let you do the renaming now ;) |
🍻 |
will check tomorrow finally |
Fix exception thrown from log when start pos is not immediately known
OK so this is my first PR on the project, it might not be a great fix or a big improvement, but its a start. Some things we need to get straight first from my perspective ..
There are several concerns:
video
element but any HTML5 Media DOM, so alsoaudio
. That would work in principle, but I needed to change the name of functions and attributes still. Will add audio-only stream to tests asap.It would be great if hls.js could extend to these architectural ideas and not narrowing down to one API (MSE) but have "one input many outputs".
Then I hope in the future I can also contribute "real features" ;)