You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As a videojs user now I need to get some information about "percent played" on some of my websites.
I've tried your code and it works, but I think the way it sends the percent played is not the easiest way to understand the information; I mean, when somebody plays 10% I get 10 as a value on my analytics. But if the video continues playing and reach 20% then "percent" = 20 is sent, so analytics shows "30" (10+20). I think the script should send 10 always if "percentplayedinterval" is set to 10. I was thinking about changing this piece of code
for percent in [0..99] by percentsPlayedInterval
if percentPlayed >= percent && percent not in percentsAlreadyTracked
if "start" in eventsToTrack && percent == 0 && percentPlayed > 0
sendbeacon( 'start', true )
else if "percentsPlayed" in eventsToTrack && percentPlayed != 0
sendbeacon( 'percent played', true, percent)
to this:
for percent in [0..99] by percentsPlayedInterval
if percentPlayed >= percent && percent not in percentsAlreadyTracked
if "start" in eventsToTrack && percent == 0 && percentPlayed > 0
sendbeacon( 'start', true )
else if "percentsPlayed" in eventsToTrack && percentPlayed != 0
sendbeacon( 'percent played', true, percentsPlayedInterval)
but before doing it I'd like to know if I'm omitting anything important, because you chase to use "percent" instead of "percentsPlayedInterval" on "sendbeacon" and probably you have your reasons.
Thank you for your time and your great project.
The text was updated successfully, but these errors were encountered:
Hi.
As a videojs user now I need to get some information about "percent played" on some of my websites.
I've tried your code and it works, but I think the way it sends the percent played is not the easiest way to understand the information; I mean, when somebody plays 10% I get 10 as a value on my analytics. But if the video continues playing and reach 20% then "percent" = 20 is sent, so analytics shows "30" (10+20). I think the script should send 10 always if "percentplayedinterval" is set to 10. I was thinking about changing this piece of code
to this:
but before doing it I'd like to know if I'm omitting anything important, because you chase to use "percent" instead of "percentsPlayedInterval" on "sendbeacon" and probably you have your reasons.
Thank you for your time and your great project.
The text was updated successfully, but these errors were encountered: