Skip to content
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

new feature - add remove sourcebuffer in every moment #120

Open
publicocean0 opened this issue Jul 14, 2016 · 3 comments
Open

new feature - add remove sourcebuffer in every moment #120

publicocean0 opened this issue Jul 14, 2016 · 3 comments

Comments

@publicocean0
Copy link

I imagine to have multiple audio /video tracks with different languages and a user can change on the fly the language.

It is interesting if developer can add/remove a audio track on the fly permitting to keep the position of stream. Probably it is necessary add a new sourcebuffer , add initialization buffer and then add the segment at right stream position.

@publicocean0
Copy link
Author

either firefox either chrome dont work in this case. I submited same feature also in firefox bugtracker, receiving positive feedbacks for this proposal

@wolenetz wolenetz added this to the VNext milestone Jul 14, 2016
@wolenetz
Copy link
Member

@publicocean0, thank you for reporting this issue.

The V1 version of the spec does not allow changes to number or type of tracks in a SourceBuffer after that SourceBuffer has parsed the first initialization segment appended to it (I understand this isn't the scenario you're asking for, though).
The V1 version of the spec leaves allowance for whether or not addSourceBuffer() supports more than the minimum required configurations as a quality of implementation issue. Chromium currently, as you correctly noted, does not support addSourceBuffer() once the HTMLMediaElement has reached HAVE_METADATA.

Web authors can perhaps work-around user agents which support the minimum required SourceBuffer configurations, but perhaps not the dynamic addition of new SourceBuffers once HAVE_METADATA has been reached, by one of the following:

  1. (Yes, ugly): Create a new media element on-demand to accomplish the desired track change. This is the most interoperable, but also perhaps the most jarring to UX as well as expensive if there are other track types (like video) which will need to be (likely refetched and) rebuffered into the new element by the MSE app.
  2. (In chrome, this functionality is currently behind an experimental flag): Make the initialization segments describe all your possible tracks, but only append media data for the currently selected/active track(s). Support for more than one audio or video track across all SourceBuffers for an HTMLMediaElement is similarly left as a quality of implementation issue in the V1 MSE spec, so this may not be interoperable in the near future.
  3. (Somewhat ugly): Dynamically append media data into the timeline for the track which is currently desired, but reuse the same previous SourceBuffer. Note that the app will need to take care to make sure that the buffered data is managed to be coherent with the audio language (as described in your scenario). This would probably be the second most interoperable at the moment.

Changing the minimum requirement for SourceBuffer configurations is beyond scope of MSE v1 spec changes (it's a substantive change). Triaging this issue as VNext, accordingly.

Comments are very welcome around this (including viability of or addition to the workarounds mentioned here).

@wolenetz wolenetz removed this from the VNext milestone Jun 9, 2020
@wolenetz wolenetz added this to the Backlog milestone Sep 21, 2020
@wolenetz wolenetz added the agenda Topic should be discussed in a group call label Sep 21, 2020
@wolenetz
Copy link
Member

With the changeTypee() incubation succeeding so far (shipped in multiple implementations), this issue seems less problematic. I'll keep it alive in the backlog though, in case web authors strongly desire this capability in MSE.

@mwatson2 mwatson2 removed the agenda Topic should be discussed in a group call label Sep 21, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants