flowplayer / flowplayer-viewport-autoplay

Plugin to start playback when visible in viewport
MIT License
0 stars 2 forks source link

Scrolling off early pauses, but overlaying fp-pause element is shown on return #1

Closed phloxic closed 7 years ago

phloxic commented 7 years ago

That is: on return the player is paused, does not resume, so an fp-play element should be shown - or the player should resume.

phloxic commented 7 years ago

@tipiirai - regardless of the UI "status display": I need to know the exact expected behavior. Mainly it's not clear when it should pause when scrolling out of view. Currently it sometimes does, it sometimes does not.

Technically (while it's still mute) it also needs sometimes 2 clicks to resume, sometimes 1 ...

tipiirai commented 7 years ago

When using the plugin the player should always pause when it's outside the viewport. Regardless of the state. And it should resume when it's on the viewport, but not when the user has manually pressed pause.

When the player is muted (with the extra layer) the player should unmute and play with one click. 2 clicks is an issue.

I noticed this is surprisingly complex given the seemingly simple feature. Maybe there is still a case that the above didn't cover?

phloxic commented 7 years ago

Thanks for the clarification, that helps. So:

  1. player must always pause when scrolled out of view
  2. player should resume on scroll into view if it was scrolled out of view in playing state
  3. exception to 2.: first autoplay (that's already a hint to the problem)
  4. should always react to first click - first step, more complex on touch devices

autoplay and especially muted autoplay can quickly become a can of worms, not least because of https://github.com/flowplayer/flowplayer/issues/1259 - ping @nnarhinen

I'll have a go.

The way it looks to me right now, I would also suggest to enable this only when both autoplay and muted are set; at least for the time being, otherwise it becomes even more confusing.

nnarhinen commented 7 years ago

No.

It should use the viewport autoplay stuff without the "Click to unmute" overlay when muted is false

phloxic commented 7 years ago

ok - at least for the moment I will start with muted, one step at a time. There is even more of a muddle with muted unset when mutedAutoplay is supported. - api.muted is always undefined ...

phloxic commented 7 years ago

Fixed - @tipiirai, please check at https://releases.flowplayer.org/viewport-autoplay/index.html