This repository has been archived by the owner on Jan 29, 2019. It is now read-only.
Fix disabled audio for a single audio only source buffer #152
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
When loading an audio only playlist, we would create a single source buffer that had only audio codecs. When changes to the audio tracks happen, the
HtmlMediaSource
would update which source buffer has ownership of audio. When themain
audio track is enabled, we used the assumption that audio is muxed into the main playlist, and alternate audio is not being used, so audio would be enabled in the "combined" source buffer, and disabled in the "audio only" source buffer. However, in the case of audio only playlist, the "combined" source buffer would only have an audio codec, which was incorrectly being marked as the "audio only" source buffer, so audio would be disabled and prevent data from ever being appended.This problem was hidden by a race condition between contrib-hls
MasterPlaylistController
completing the first media playlist request and theMediaSource
triggering thesourceopen
event. If thesourceopen
event happened second, the audio track change event listeners would be setup later, avoiding this bug.This change checks to see if there is only one source buffer, and if so make sure it is always active and enables audio based on the source buffer's audio codec information.
Addresses:
videojs/videojs-contrib-hls#1186
videojs/videojs-contrib-hls#1179
Audio only in Flash also has some issues when we detect that the type is
audio/mp2t
. This address that by allowing audio onlyFlashSourceBuffer
s to be created.