How do I add an id tag, when a person clicks presses the Play Button on HTML video? We are trying to track usage.
<video width="728" height="410" controls>
<source src={testURL} type="video/mp4" />
Your browser does not support the video tag.
</video>
2
Answers
You can add an event listener on your video tag and run your code whenever the video starts playing.
You can add an event listener to the play button of the HTML video and then use the setAttribute method to add an id tag to the video element. If this help!