How to detect when a HTML5 <video> is played for the first time?

Viewed 3503

This will fire the alert each time the play button is clicked. So it will be fired the first time the video is played but also on subsequent plays and if the user pauses then then plays again:

$('video').bind('play', function() {
   alert('I have been played!');
});

I need to fire an event only once when the video is played for the first time. How can this be done?

Perhaps the jquery one function can be combined with this to make it happen?

2 Answers
Related