diff --git a/src/streaming/controllers/AbrController.js b/src/streaming/controllers/AbrController.js index 6bf9bd5212..3bf7ff9009 100644 --- a/src/streaming/controllers/AbrController.js +++ b/src/streaming/controllers/AbrController.js @@ -496,7 +496,7 @@ function AbrController() { setElementSize(); } const streamInfo = streamProcessorDict[streamId][type].getStreamInfo(); - const representation = adapter.getAdaptationForType(streamInfo.index, type, streamInfo).Representation; + const representation = adapter.getAdaptationForType(streamInfo.index, type, streamInfo).Representation_asArray; let newIdx = idx; if (elementWidth > 0 && elementHeight > 0) { @@ -557,7 +557,7 @@ function AbrController() { if (configBitrate === -1) { if (configRatio > -1) { const streamInfo = streamProcessorDict[streamId][type].getStreamInfo(); - const representation = adapter.getAdaptationForType(streamInfo.index, type, streamInfo).Representation; + const representation = adapter.getAdaptationForType(streamInfo.index, type, streamInfo).Representation_asArray; if (Array.isArray(representation)) { const repIdx = Math.max(Math.round(representation.length * configRatio) - 1, 0); configBitrate = representation[repIdx].bandwidth / 1000; diff --git a/test/unit/mocks/AdapterMock.js b/test/unit/mocks/AdapterMock.js index c36f0147e6..3e9b2a43ff 100644 --- a/test/unit/mocks/AdapterMock.js +++ b/test/unit/mocks/AdapterMock.js @@ -79,6 +79,23 @@ function AdapterMock() { { width: 900 } + ], + Representation_asArray: [ + { + width: 500 + }, + { + width: 750 + }, + { + width: 900 + }, + { + width: 900 + }, + { + width: 900 + } ] }; };