spodlecki / videojs-event-tracking

Track events with VideoJS and keep an eye on performance metrics
MIT License
71 stars 16 forks source link

`tracking:play` event never triggered #43

Open bianchidotdev opened 2 weeks ago

bianchidotdev commented 2 weeks ago

Hey hey. I was just testing adding this plugin to my player and saw that I wasn't able to get a play (non-firstplay) event to fire. I think the trigger is just missing here. I may also be missing something though. Let me know - I can open a PR if you'd like.

https://github.com/spodlecki/videojs-event-tracking/blob/f6e5499ab390e11ab46cbafa1c2e7c662b2ac412/src/tracking/play.js#L43-L48

spodlecki commented 2 weeks ago

@bianchidotdev I only track the first time a user clicks "play," not every time the play button is pressed. This is because we're usually more interested in knowing whether the user chose to play the content at all, rather than counting every play action, which could include multiple pauses and plays. I found tracking every play event wasn't useful.

If you'd like to submit a pull request, can certainly add that event though. Please add to README if you do