You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@royale.apache.org by pi...@apache.org on 2020/10/29 15:34:13 UTC

[royale-asjs] branch develop updated: HTML: Add couple of missing methods to Video - play, pause, load and property paused

This is an automated email from the ASF dual-hosted git repository.

piotrz pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/royale-asjs.git


The following commit(s) were added to refs/heads/develop by this push:
     new 2c8a0b6  HTML: Add couple of missing methods to Video - play, pause, load and property paused
2c8a0b6 is described below

commit 2c8a0b6d7894b0dd8e84400d5e8ab628e306c2e1
Author: Piotr Zarzycki <pi...@gmail.com>
AuthorDate: Thu Oct 29 16:33:32 2020 +0100

    HTML: Add couple of missing methods to Video - play, pause, load and property paused
---
 .../org/apache/royale/html/elements/Video.as       | 81 +++++++++++++++++++++-
 1 file changed, 79 insertions(+), 2 deletions(-)

diff --git a/frameworks/projects/HTML/src/main/royale/org/apache/royale/html/elements/Video.as b/frameworks/projects/HTML/src/main/royale/org/apache/royale/html/elements/Video.as
index f06e434..e26e694 100644
--- a/frameworks/projects/HTML/src/main/royale/org/apache/royale/html/elements/Video.as
+++ b/frameworks/projects/HTML/src/main/royale/org/apache/royale/html/elements/Video.as
@@ -54,12 +54,12 @@ package org.apache.royale.html.elements
         private var _autoplay:Boolean;
 
         /**
-         *  Whether the input is autofocused
+         *  Whether the video is autoplay
          *
          *  @langversion 3.0
          *  @playerversion Flash 10.2
          *  @playerversion AIR 2.6
-         *  @productversion Royale 0.9
+         *  @productversion Royale 0.9.8
          */
         public function get autoplay():Boolean
         {
@@ -73,6 +73,7 @@ package org.apache.royale.html.elements
                 return (element as HTMLVideoElement).autoplay;
             }
         }
+
         public function set autoplay(value:Boolean):void
         {
             COMPILE::SWF
@@ -85,6 +86,82 @@ package org.apache.royale.html.elements
             }
         }
 
+        COMPILE::SWF
+        private var _paused:Boolean;
+
+        /**
+         *  Whether the video is paused
+         *
+         *  @langversion 3.0
+         *  @playerversion Flash 10.2
+         *  @playerversion AIR 2.6
+         *  @productversion Royale 0.9.8
+         */
+        public function get paused():Boolean
+        {
+            COMPILE::SWF
+            {
+                return _paused;
+            }
+
+            COMPILE::JS
+            {
+                return (element as HTMLVideoElement).paused;
+            }
+        }
+
+        COMPILE::JS
+        /**
+         *  Start video
+         *
+         *  @langversion 3.0
+         *  @playerversion Flash 10.2
+         *  @playerversion AIR 2.6
+         *  @productversion Royale 0.9.8
+         */
+        public function play()
+        {
+            COMPILE::JS
+            {
+                (element as HTMLMediaElement).play();
+            }
+        }
+
+        COMPILE::JS
+        /**
+         *  Pause video
+         *
+         *  @langversion 3.0
+         *  @playerversion Flash 10.2
+         *  @playerversion AIR 2.6
+         *  @productversion Royale 0.9.8
+         */
+        public function pause()
+        {
+            COMPILE::JS
+            {
+                (element as HTMLMediaElement).pause();
+            }
+        }
+
+        COMPILE::JS
+        /**
+         *  Resets the media element to its initial state and begins the process of selecting
+         *  a media source and loading the media in preparation for playback to begin at the beginning.
+         *
+         *  @langversion 3.0
+         *  @playerversion Flash 10.2
+         *  @playerversion AIR 2.6
+         *  @productversion Royale 0.9.8
+         */
+        public function load()
+        {
+            COMPILE::JS
+            {
+                (element as HTMLMediaElement).load();
+            }
+        }
+
         COMPILE::JS
         override protected function createElement():WrappedHTMLElement
         {