IAC 2024 - IA Fast Track to Search Focused AI Solutions
Flash runtime on mobile
1. Introduction to
Introduction to
Flash Runtime Mobile Features
Flash Runtime Mobile Features White Master
Flash Runtime Globalization Team
Flash Runtime Globalization Team
Hao Wu, Yi Zhai
1
2. 1. Features of Flash Runtime on Mobile
Accelerometer
GPS
Camera
Stage Video
Device Speaker Control
2. Workshop – Native Extension
2
4. The Accelerometer class dispatches events based on activity detected by the
device's motion sensor. This data represents the device's location or
movement along a 3-dimensional axis.
4
5. var accelerometer:Accelerometer;
if(Accelerometer.isSupported){
accelerometer = new Accelerometer();
accelerometer.addEventListener(AccelerometerEvent.UPDATE,
updateHandler);
}
private function updateHandler (e:AccelerometerEvent):void{
trace(e.accelerationX);
trace(e.accelerationY);
trace(e.accelerationZ);
trace(e.timestamp)
}
5
12. CameraUI
The CameraUI class allows you to capture a still image or video using the
default camera application on a device.
CameraRoll
The CameraRoll class allows you to access image data in the system media
library or "camera roll."
12
13. if (CameraUI.isSupported){
myCam = new CameraUI();
myCam.addEventListener(MediaEvent.COMPLETE, onComplete);
myCam.launch(MediaType.IMAGE);
}
if (CameraRoll.supportsBrowseForImage){
roll = new CameraRoll();
roll.addEventListener(MediaEvent.SELECT,onMediaSelect);
roll.browseForImage();
}
13
17. The StageVideo object uses the device's hardware acceleration capabilities, if
available, to display live or recorded video in an application. Hardware
acceleration capabilities are available on most devices
17
19. private static const FILE_NAME:String = "media/Test_original.mp4";
var sv:StageVideo;
var nc:NetConnection;
var ns:NetStream;
nc = new NetConnection();
nc.connect(null);
ns = new NetStream(nc);
stage.addEventListener(StageVideoAvailabilityEvent.STAGE_VIDEO_AVAILABILITY,
onStageVideoState);
19
20. private function onStageVideoState(event:StageVideoAvailabilityEvent):void{
// Detect if StageVideo is available and decide what to do in toggleStageVideo
toggleStageVideo(available = inited = (event.availability ==
StageVideoAvailability.AVAILABLE));
}
private function toggleStageVideo(on:Boolean):void{
sv = stage.stageVideos[0];
sv.attachNetStream(ns);
ns.play(FILE_NAME);
}
20
24. Feature summary
Enable mobile app to toggle between earpiece and speakerphone
AIR 2.7 > AIR 3.0
No way to choose two speaks Easily access different speakers
All audio play back through media Enable the VOIP telephony
speaker
Enumerate all the speakers attached to
device on mobile and desktop
Use cases
New Adobe Directory/Connect for Android, with VoIP feature
More AIR-based enterprise apps, integrating Flash Media Gateway
24
25. AudioPlaybackMode Speakerphone in iOS Category be Audio Output Route
use used (Headphone)
Media 0 MediaPlayback Device Speaker
(Headphone)
Media 1 MediaPlayback Device Speaker
(Headphone)
AudioPlaybackMode Speakerphone in use iOS Category be used Audio Output Route
(Headphone)
Voice 0 PlayAndRecord Phone Receiver
(Headphone)
Voice 1 PlayAndRecord Device Speaker
25
28. …
Front-facing camera support
Android Market licensing integration
Captive runtime support for Android
Stagetext
Flash Access on Android
Mobile background app audio playback for iOS
Enable HW Video decoding on various chipsets
Native Extensions on Mobile
28
30. The native extensions feature enables the addition of third-party, native-code
backed ActionScript APIs to AIR applications.
Normal apps NativeExtension apps
A actionscript Library with Native Code implementation
30
31. Enhance Performance
Zxing:ActionScript 2000ms, Android 10ms
Expand functions
Autofocus for camera , Vibration …
31