mirror of
https://github.com/shaka-project/shaka-player.git
synced 2026-06-16 16:16:40 +03:00
fix(HLS): Fix disableAudio and disableVideo when loading a media playlist (#8642)
This commit is contained in:
committed by
GitHub
parent
f86245c9cc
commit
ccd31aa9d9
+21
-12
@@ -939,18 +939,27 @@ shaka.hls.HlsParser = class {
|
||||
mediaPlaylistType = streamInfo.stream.type;
|
||||
|
||||
// Wrap the stream from that stream info with a variant.
|
||||
variants.push({
|
||||
id: 0,
|
||||
language: this.getLanguage_(languageValue),
|
||||
disabledUntilTime: 0,
|
||||
primary: true,
|
||||
audio: mediaPlaylistType == 'audio' ? streamInfo.stream : null,
|
||||
video: mediaPlaylistType == 'video' ? streamInfo.stream : null,
|
||||
bandwidth: streamInfo.stream.bandwidth || 0,
|
||||
allowedByApplication: true,
|
||||
allowedByKeySystem: true,
|
||||
decodingInfos: [],
|
||||
});
|
||||
let variantAllowed = true;
|
||||
if (this.config_.disableAudio && streamInfo.type == 'audio') {
|
||||
variantAllowed = false;
|
||||
} else if (this.config_.disableVideo && streamInfo.type == 'video' &&
|
||||
!streamInfo.stream.codecs.includes(',')) {
|
||||
variantAllowed = false;
|
||||
}
|
||||
if (variantAllowed) {
|
||||
variants.push({
|
||||
id: 0,
|
||||
language: this.getLanguage_(languageValue),
|
||||
disabledUntilTime: 0,
|
||||
primary: true,
|
||||
audio: streamInfo.type == 'audio' ? streamInfo.stream : null,
|
||||
video: streamInfo.type == 'video' ? streamInfo.stream : null,
|
||||
bandwidth: streamInfo.stream.bandwidth || 0,
|
||||
allowedByApplication: true,
|
||||
allowedByKeySystem: true,
|
||||
decodingInfos: [],
|
||||
});
|
||||
}
|
||||
} else {
|
||||
this.parseMasterVariables_(variablesTags);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user