ANE-Video is a native extension for playing videos on iOS and Android. The extension can play a remote video using its URL, showing a graphical player during the reproduction. It’s possible to show and hide the player, as well as enqueue songs for playing.
After a video is reproduced, the next one in the queue is played. An event is fired every time the current video changes. It’s also possible to clear the queue or jump to the next video available.
Sample
import com.freshplanet.ane.AirVideo.AirVideo; private var _videoList:Array; protected function get videoList() : Array { if (_videoList == null) { var listFile:File = File.applicationDirectory.resolvePath("videos.txt"); var listStream:FileStream = new FileStream(); listStream.open(listFile, FileMode.READ); var list:String = listStream.readUTFBytes(listStream.bytesAvailable); _videoList = list.split("\n"); } return _videoList; } protected function onAddedToStage(event:Event):void { AirVideo.getInstance().logEnabled = true; AirVideo.getInstance().addEventListener(AirVideo.CURRENT_VIDEO_CHANGED, onCurrentVideoChanged, false, 0, true); for each (var video:String in videoList) { AirVideo.getInstance().addVideoToQueue(video); } AirVideo.getInstance().showPlayer(); } protected function onCurrentVideoChanged(event:Event):void { trace("Current video: " + AirVideo.getInstance().currentVideo + " - " + AirVideo.getInstance().queue.length + " videos in queue"); if (AirVideo.getInstance().currentVideo == null) { AirVideo.getInstance().hidePlayer(); } }
RT @as3gamegears: New: ANE-Video (native extension for playing videos on iOS and Android) http://t.co/H9mKjVVf3h #as3 #flash #gamedev
Hello, i have some problem with AirVideo.
I’m trying to use the class but i got an error:
Variable AirVideo is not defined.
I already added the .ane and the AirVideo.as to my classpath.
Added the extension in my XML.
I’m using Flash Builder 4.7 with Samsung Galaxy 10.1 to debug.
Thanks!