I’m developing a site that shows videos from youtube, and I’m interested in knowing how many times each video has been played from my web. Youtube views doesn’t count, just the views from my web. I’ve found this approach for audio:
Tracking how many times an HTML5 audio element is played?
Can I use the same approach for videos? Someone has done this? How? I have found a similar question:
Tracking the number of times a video was played
But the answer is not satisfying for me, I need to do it without a third party service, if it is possible, of course.
I used the example from https://developer.mozilla.org/en-US/docs/Web/Events
I adapted it to do what I wanted: