We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 7378259 + 4b6fd6a commit 6ad7c03Copy full SHA for 6ad7c03
src/streaming/controllers/AbrController.js
@@ -141,7 +141,8 @@ function AbrController() {
141
let representation = dashManifestModel.getAdaptationForType(manifest, 0, type).Representation;
142
143
if (Array.isArray(representation)) {
144
- bitrateDict[type] = representation[Math.round(representation.length * ratioDict[type]) - 1].bandwidth;
+ let repIdx = Math.max(Math.round(representation.length * ratioDict[type]) - 1, 0);
145
+ bitrateDict[type] = representation[repIdx].bandwidth;
146
} else {
147
bitrateDict[type] = 0;
148
}
0 commit comments