Processing
 

How to stop video autoplaying (stageWebView in Air for iOS - Flash)

19/03/2012 02:16#1

Joined at: 7 months ago

Post: 10

Thank: 0

Thanked: 0

Is there a reason a stageWebView may be autoplaying? As soon as it loads, it will start playing, but the funny thing with it is that the Play Icon stays there even while it's already playing. I was hoping to have it paused when it loads and only play if the user requires it to be played.

import flash.geom.Rectangle; import flash.media.StageWebView; import flash.filesystem.File;  var webView:StageWebView = new StageWebView(); var path:String = new File(new File("app:/video.mp4").nativePath).url;  webView = new StageWebView(); webView.stage = this.stage; webView.viewPort = new Rectangle(100, 100, 400, 300); webView.loadURL(path); 

I can't pick anything out of my code that looks like it would be causing the error?

02/05/2012 00:06Top#2

Joined at: 9 months ago

Post: 8

Thank: 0

Thanked: 0

Consider using StageVideo instead. It is supported on iOS.

01/03/2016 20:23Top#3

Joined at: 6 months ago

Post: 1

Thank: 0

Thanked: 0

From Adobe Air 21 release notes (http://fpdownload.macromedia.com/pub/labs/flashruntimes/shared/air21_flashplayer21_releasenotes.pdf)

Media Auto Play for iOS & Android Starting AIR 21, we are introducing Media Auto Play support for AIR iOS & Android applications. Using this feature, ActionScript developers can enable media auto play inside StageWebView. To enable this, autoplay should also be enabled in the HTML5 video tag. (More info on HTML5 video tag : http://www.w3schools.com/tags/tag_video.asp). Please use swf-version 32 or greater and namespace 21.0 or greater to access this feature.

var webView:StageWebView = new StageWebView(); webView.stage = stage; webView.viewPort = new Rectangle( 0, 0, 400, 300 ); webView.mediaPlaybackRequiresUserAction = false;// To enable autoplay in given web view webView.addEventListener(Event.COMPLETE, <handleComplete>); webView.addEventListener(ErrorEvent.ERROR, <handleError>); webView.loadURL("http://any/webpage/with/autoplay/enabled/video.html”) 
Similar articles

Open a folder in finder/explorer from a webpage?

5 years ago - Reply: 2 - Views: 80

How do I escape a reserved word in Actionscript?

5 years ago - Reply: 2 - Views: 198

Save PPS/PPT files as SWF using C#

5 years ago - Reply: 2 - Views: 171

Ways of making a graphic/visual novel in flash

6 years ago - Reply: 3 - Views: 114

Use PhoneGap + HTML5 and an Embedded Flash Movie

5 years ago - Reply: 2 - Views: 96

View word docs and PDF in browser?

5 years ago - Reply: 2 - Views: 52

ActionScript 3 Read JPEG quality

7 years ago - Reply: 2 - Views: 59

Export/Test Movie Issues

5 years ago - Reply: 3 - Views: 38

Flash always on top in Android browser workaround?

5 years ago - Reply: 2 - Views: 149

Sending Json Form from Flash AS3

5 years ago - Reply: 2 - Views: 29

parsing a swf/fla (using php?)

6 years ago - Reply: 2 - Views: 44

Getting high FPS on Flash/AIR games for mobile?

4 years ago - Reply: 2 - Views: 58

vé máy bay vé máy bay giá rẻ ve may bay ve may bay gia re vé máy bay vé máy bay giá rẻ ve may bay ve may bay gia re vé máy bay vé máy bay giá rẻ ve may bay ve may bay gia re vé máy bay vé máy bay giá rẻ ve may bay ve may bay gia re vé máy bay vé máy bay giá rẻ ve may bay ve may bay gia re vé máy bay vé máy bay giá rẻ ve may bay ve may bay gia re vé máy bay vé máy bay giá rẻ ve may bay ve may bay gia re