How to call a function on video end ? (HTML5 and mediaelementjs)
问题 i am using mediaelementjs for playing video on my website but i need to call some function at the END/pause of video.So please tell me how an i do this? Thanks in advance 回答1: You need to create a new EventListener for the ended and pause events. Example: YourMediaElement.addEventListener('ended', function(){ //Your Code goes here }); Update: This method should be applied on the success handler of creating the element, as is shown in the example on the bottom of the page at MediaElementJS.com