mirror of
https://github.com/shaka-project/shaka-player.git
synced 2026-06-14 15:56:38 +03:00
fix(HLS): Fix switching between muxed and alternate audios (#8741)
Fixes https://github.com/shaka-project/shaka-player/issues/8737
This commit is contained in:
committed by
GitHub
parent
4ac3c97c8c
commit
c1e2f7aab5
@@ -2670,7 +2670,8 @@ shaka.hls.HlsParser = class {
|
||||
|
||||
if (type == ContentType.VIDEO || type == ContentType.AUDIO) {
|
||||
for (const otherStreamInfo of this.uriToStreamInfosMap_.values()) {
|
||||
if (!otherStreamInfo.loadedOnce && otherStreamInfo.type == type) {
|
||||
if (!otherStreamInfo.loadedOnce && otherStreamInfo.type == type &&
|
||||
!otherStreamInfo.stream.isAudioMuxedInVideo) {
|
||||
// To aid manifest filtering, assume before loading that all video
|
||||
// renditions have the same MIME type. (And likewise for audio.)
|
||||
otherStreamInfo.stream.mimeType = realStream.mimeType;
|
||||
|
||||
@@ -2980,6 +2980,7 @@ shaka.media.StreamingEngine = class {
|
||||
if (audioMediaState.segmentIterator) {
|
||||
audioMediaState.segmentIterator.resetToLastIndependent();
|
||||
}
|
||||
this.cancelUpdate_(audioMediaState);
|
||||
}
|
||||
const videoMediaState = this.mediaStates_.get(ContentType.VIDEO);
|
||||
if (videoMediaState) {
|
||||
@@ -2993,14 +2994,14 @@ shaka.media.StreamingEngine = class {
|
||||
if (videoMediaState.segmentIterator) {
|
||||
videoMediaState.segmentIterator.resetToLastIndependent();
|
||||
}
|
||||
this.cancelUpdate_(videoMediaState);
|
||||
}
|
||||
/**
|
||||
* @type {!Map<shaka.util.ManifestParserUtils.ContentType,
|
||||
* shaka.extern.Stream>}
|
||||
*/
|
||||
const streamsByType = new Map();
|
||||
if (this.currentVariant_.audio &&
|
||||
!this.currentVariant_.audio.isAudioMuxedInVideo) {
|
||||
if (this.currentVariant_.audio) {
|
||||
streamsByType.set(ContentType.AUDIO, this.currentVariant_.audio);
|
||||
}
|
||||
if (this.currentVariant_.video) {
|
||||
|
||||
Reference in New Issue
Block a user