@@ -231,6 +231,7 @@ public static Object[] addActionListener(HTML5Video jsvideo, ActionListener list
231231 public Void apply (Object jsevent ) {
232232 String name = (/** @j2sNative jsevent.type || */
233233 "?" );
234+ System .out .println ("HTML5Video " + name );
234235 ActionEvent e = new ActionEvent (new Object [] { jsvideo , jsevent }, 12345 , name ,
235236 System .currentTimeMillis (), 0 );
236237 listener .actionPerformed (e );
@@ -258,7 +259,6 @@ public Void apply(Object jsevent) {
258259 * @param listeners an array of event/listener pairs created by
259260 * addActionListener
260261 */
261- @ SuppressWarnings ("unused" )
262262 public static void removeActionListener (HTML5Video jsvideo , Object [] listeners ) {
263263 if (listeners == null ) {
264264 for (int i = 0 ; i < eventTypes .length ; i ++) {
@@ -314,7 +314,7 @@ public static JLabel createLabel(Object source) {
314314 * @param maxWidth
315315 * @return
316316 */
317- public static JDialog createDialog (Frame parent , Object source , int maxWidth , Runnable whenReady ) {
317+ public static JDialog createDialog (Frame parent , Object source , int maxWidth , Function < HTML5Video , Void > whenReady ) {
318318 JDialog dialog = new JDialog (parent );
319319 Container p = dialog .getContentPane ();
320320 p .setLayout (new BoxLayout (p , BoxLayout .Y_AXIS ));
@@ -347,7 +347,7 @@ public void actionPerformed(ActionEvent e) {
347347 dialog .pack ();
348348// dialog.setVisible(false);
349349 if (whenReady != null )
350- whenReady .run ( );
350+ whenReady .apply ( jsvideo );
351351 }
352352
353353 }, "canplaythrough" );
@@ -427,6 +427,10 @@ public static boolean nextFrame(HTML5Video jsvideo, double dt) {
427427 return canSeek .booleanValue ();
428428 }
429429
430+ public static int getFrameCount (HTML5Video jsvideo ) {
431+ return (int ) (getDuration (jsvideo ) / 0.033334 );
432+ }
433+
430434// HTMLMediaElement properties
431435
432436// audioTracks
0 commit comments