Add test case for high-bandwidth resolution filtering
When all multiple variant streams were usable based on bandwidth, resolutionPlusOne could be set to the lowest bandwidth variant on the first pass through the resolution filtering loop.
Showing
1 changed file
with
26 additions
and
0 deletions
... | @@ -852,6 +852,32 @@ test('selects the correct rendition by player dimensions', function() { | ... | @@ -852,6 +852,32 @@ test('selects the correct rendition by player dimensions', function() { |
852 | 852 | ||
853 | }); | 853 | }); |
854 | 854 | ||
855 | test('selects the highest bitrate playlist when the player dimensions are ' + | ||
856 | 'larger than any of the variants', function() { | ||
857 | var playlist; | ||
858 | player.src({ | ||
859 | src: 'manifest/master.m3u8', | ||
860 | type: 'application/vnd.apple.mpegurl' | ||
861 | }); | ||
862 | openMediaSource(player); | ||
863 | requests.shift().respond(200, null, | ||
864 | '#EXTM3U\n' + | ||
865 | '#EXT-X-STREAM-INF:BANDWIDTH=1000,RESOLUTION=2x1\n' + | ||
866 | 'media.m3u8\n' + | ||
867 | '#EXT-X-STREAM-INF:BANDWIDTH=1,RESOLUTION=1x1\n' + | ||
868 | 'media1.m3u8\n'); // master | ||
869 | standardXHRResponse(requests.shift()); // media | ||
870 | player.hls.bandwidth = 1e10; | ||
871 | |||
872 | player.width(1024); | ||
873 | player.height(768); | ||
874 | |||
875 | playlist = player.hls.selectPlaylist(); | ||
876 | |||
877 | equal(playlist.attributes.BANDWIDTH, | ||
878 | 1000, | ||
879 | 'selected the highest bandwidth variant'); | ||
880 | }); | ||
855 | 881 | ||
856 | test('does not download the next segment if the buffer is full', function() { | 882 | test('does not download the next segment if the buffer is full', function() { |
857 | var currentTime = 15; | 883 | var currentTime = 15; | ... | ... |
-
Please register or sign in to post a comment