c553bc5d by David LaPalomento

Don't patch HLS until after MediaSource opens

If Flash-based source buffers are being used, the HLS source handler isn't available until later in the player lifecycle. Wait a bit before spying on drainBuffer() to account for that possible delay.
1 parent ac8cb5e1
...@@ -3079,12 +3079,12 @@ test('does not process update end until buffered value has been set', function() ...@@ -3079,12 +3079,12 @@ test('does not process update end until buffered value has been set', function()
3079 src: 'master.m3u8', 3079 src: 'master.m3u8',
3080 type: 'application/vnd.apple.mpegurl' 3080 type: 'application/vnd.apple.mpegurl'
3081 }); 3081 });
3082
3083 openMediaSource(player);
3082 origDrainBuffer = player.tech_.hls.drainBuffer; 3084 origDrainBuffer = player.tech_.hls.drainBuffer;
3083 player.tech_.hls.drainBuffer = function() { 3085 player.tech_.hls.drainBuffer = function() {
3084 drainBufferCallCount++; 3086 drainBufferCallCount++;
3085 }; 3087 };
3086
3087 openMediaSource(player);
3088 standardXHRResponse(requests.shift()); // master 3088 standardXHRResponse(requests.shift()); // master
3089 standardXHRResponse(requests.shift()); // media 3089 standardXHRResponse(requests.shift()); // media
3090 3090
......