As we have the full Flash Player (and Adobe AIR) on Android devices, playback of video files is as simple as it normally is on the desktop. The main consideration is whether the video is optimized for playback on mobile, or not.
This recipe involves the playback of a video file that has been packaged along with our application. We could just as easily reference an HTTP address or even local storage on the Android device, so long as it is a file format and codec, which can be played back through Flash Platform runtimes. You will want to prepare this file ahead of time.
We will create a Video
object, add it to the Stage
, and stream a file in through a basic NetConnection
and NetStream
pair:
1. First, import the following classes into your project:
import flash.display.Sprite; import flash.display.StageAlign; import flash.display.StageScaleMode; import flash.events.NetStatusEvent; import flash.media.Video; import...