Quantcast
Channel: Adobe Community : Unanswered Discussions - AIR Development
Viewing all articles
Browse latest Browse all 2010

StageWebView in Android - Help

$
0
0

Hi Guys,

Im using StageWebView to play youtube videos in Android and iOS.

In iOS it's ok, but in Android, the video do not start.

When the user press click to play, the video load but do not work (play) .

The video plays only when i press the fullscreen button.

Can anybody help me ?

I will put my code here, but if anybody will have a code that works, i accept

Ah! i can't put <application android:hardwareAccelerated="true"/> in xml. The flash don't accept.

Thanks you guys

 

Im using:

- Flash CC 2014

- Air 16.0.0.222

- Android 4.4.4

 

:: MY CODE ::

import flash.display.StageAlign;

import flash.display.StageScaleMode;

import flash.events.Event;

import flash.geom.Rectangle;

import flash.media.StageWebView;

import flash.events.ErrorEvent;

 

stage.align = StageAlign.TOP_LEFT;

stage.scaleMode = StageScaleMode.NO_SCALE;

 

var w : int = 540;

var h : int = 720; //304;

 

var testview:StageWebView = new StageWebView();

testview.stage = this.stage;

testview.viewPort = new Rectangle(0, 0, w,h);

testview.loadString( getHTML5Player("oaJwulqZdkk") );

 

testview.addEventListener(ErrorEvent.ERROR, onError);

function onError(event:ErrorEvent):void {

  erro.text = "not able to reach location: "+ event.errorID;

}

 

function getHTML5Player( videoId : String ) : String

{

   return "<iframe id=\"player\" type=\"text/html\" width=\"540\" height=\"304\"" +

  "src=\"http://www.youtube.com/embed/"+videoId+"?rel=0\ ?hd=1\ ?fs=1\" frameborder=\"0\"> </iframe>";

}


Viewing all articles
Browse latest Browse all 2010

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>