jeudi 26 février 2015

Using Backbone Events with HTML5 video playback events

I am trying to use backbone to listen for when a video has ended but I am getting undefined is not a function returned.


Trying to call another method from within a backbone view once video has ended:



playIOS: function() {
var $video = $('video'),
video = $video.get(0);
video.play();

this.listenTo( video, 'ended', this.videoEnded );
},

videoEnded: function() {
alert( 'Video Ended!' );
}


Clearly my method is not working. Is there a recommended solution for monitoring media playback events with Backbone?


Aucun commentaire:

Enregistrer un commentaire