clappr / flashls-playback

[WIP] Clappr Flashls based playback
BSD 3-Clause "New" or "Revised" License
1 stars 1 forks source link

[FlasHLS] Inconsistent state when pausing immediately after calling play #9

Open towerz opened 8 years ago

towerz commented 8 years ago

When discussing some details on how to detect whether FlasHLS is enabled for a given source, @mikeevstropov discovered that calling player.play(); player.pause() doesn't work correctly.

I tried checking on http://cdn.clappr.io and the playback seemingly tries to pause before loading the source, instead of delaying it. I ran the following code:

var player = new Clappr.Player({
  source: 'http://www.streambox.fr/playlists/x36xhzz/x36xhzz.m3u8',
  parentId: '#player-wrapper',
  baseUrl: '/latest',
  poster: 'http://clappr.io/poster.png',
  mute: true,
  height: 360,
  width: 640,
  plugins: [Clappr.FlasHLS]
});

And instead of interacting, I ran the following on the console:

> player.play();player.pause()
VM4200:1 INFO:FlasHLS Clappr (version: 0.4.13 - flashls: 0.4.4.20, id: o88)
VM4201:1 INFO:HLSNetStream:close
VM4202:1 INFO:HLSNetStream:pause
VM4207:1 INFO:HLSNetStream:play(-1)
VM4208:1 INFO:HLSNetStream:seek(-1)
VM4218:1 INFO:Setting audio track to 0
VM4219:1 INFO:enough download bandwidth, adjust start level from 0 to 4
VM4249:1 INFO:Video decoding:software
> console.log(player.core.getCurrentPlayback().currentState)
VM4273:2 PLAYING

Note that the expected behavior is that the playback would be in the PAUSED or PAUSED_BUFFERING state.

mikeevstropov commented 8 years ago

And. When player.play is calling after CONTAINER_LOADEDMETADATA event, it works correctly.

player.play();
player.listenToOnce(
    player.core.getCurrentContainer(),
    Clappr.Events.CONTAINER_LOADEDMETADATA,
    function () { player.pause() }
);
iongion commented 8 years ago

If I do what @mikeevstropov uses, I get this:

The play() request was interrupted by a call to pause()

I try to load an m3u8, wait for metadata and then immediately pause and seek to 0

leandromoreira commented 8 years ago

@iongion this issue is a chrome related and known issue https://bugs.chromium.org/p/chromium/issues/detail?id=593273