play/pause not always tracking due "seeking"
mfn opened this issue · comments
Markus Podar commented
I'm not sure what's here exactly at fault, but the play/pause events in my case are not tracked because "seeking" is "true" all the time.
The workflow I see is the following:
- user initiates playing the video,
play
gets triggered for the first time - in this case,
currentTime === 0
which means theplay
beacon gets not sent; but that's ok (I guess), thestart
event was triggered before anyway. But nevertheless,seeking
gets set totrue
- if the user now hits
pause
, the check looks like this:if currentTime != duration && !seeking
. Since nowseeking
has been set totrue
and I don't see code setting it to false, play/pause will never trigger sendbeacon
I removed the seeking = true
in play
and in my limited testing it worked.
Markus Podar commented
After some more testing I think that in play
it was meant to reset seeking
to false
. Some testing showed good result.
However, there's one case which is still a problem after this change:
- play
- pause
- seek
- play
- The last play event is not triggered
Successive pause/play events however are triggered.
Michael Bensoussan commented
Hey @mfn,
You were right about the seeking = true
bug.
I fixed it in a previous commit.
I also fixed the issue with the play event not being sent after a seek.