OnEnded event does not fire in dojo dialog

I try to trigger an event when the movie ends. The movie appears when you click the link and is in the dojo dialog box. I am using a tag to play a movie and trying to use dojo connect to get a warning when a movie finishes playing using the onEnded attribute. However, nothing happens. Any ideas on what is my problem? The code is as follows:

dialog = new dijit.Dialog({ content: "<embed id='video' src='http://www.tizag.com/files/html/htmlexample.mpeg' autostart='true' controller='false'/>" }); dialog.show(); dojo.connect(dojo.byId("video"), "onEnded", function(e){alert(e);}); 
+4
source share
1 answer

Typically, existing DOM events are lowercased , and custom dijit events are camelCased . Assuming I got the search right, the correct event for the binding is onended , without the upper case "E":

Detect when HTML5 video ends

 dojo.connect(dojo.byId("video"), "onended", function(e){alert(e);}); 
0
source

Source: https://habr.com/ru/post/1384756/


All Articles