• Share
  • Email
  • Embed
  • Like
  • Save
  • Private Content
Flash runtime on mobile
 

Flash runtime on mobile

on

  • 1,255 views

 

Statistics

Views

Total Views
1,255
Views on SlideShare
1,091
Embed Views
164

Actions

Likes
0
Downloads
5
Comments
0

4 Embeds 164

http://www.howardwu.info 124
http://www.haowu.info 33
http://xianguo.com 6
http://webcache.googleusercontent.com 1

Accessibility

Categories

Upload Details

Uploaded via as Adobe PDF

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

    Flash runtime on mobile Flash runtime on mobile Presentation Transcript

    • Introduction to Introduction toFlash Runtime Mobile FeaturesFlash Runtime Mobile Features White MasterFlash Runtime Globalization TeamFlash Runtime Globalization TeamHao Wu, Yi Zhai 1
    • 1. Features of Flash Runtime on Mobile  Accelerometer  GPS  Camera  Stage Video  Device Speaker Control2. Workshop – Native Extension 2
    • 3
    •  The Accelerometer class dispatches events based on activity detected by the devices motion sensor. This data represents the devices location or movement along a 3-dimensional axis. 4
    • 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
    • 6
    • 7
    •  The Geolocation class dispatches events in response to the devices location sensor. 8
    • var geolocation:Geolocation;if(Geolocation.isSupported){ geolocation = new Geolocation(); if(!geolocation.muted){ geolocation.setRequestedUpdateInterval(10000); geolocation.addEventListener(GeolocationEvent.UPDATE,updateHandler); }}private function updateHandler(e:GeolocationEvent):void{ trace(e.longitude); trace(e.latitude); trace(e.altitude); //Other properties: heading, speed, timestamp} //horizaontalAccuracy, VerticalAccuracy, 9
    • 10
    • 11
    •  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
    • 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
    • 14
    • 15
    • 16
    •  The StageVideo object uses the devices hardware acceleration capabilities, if available, to display live or recorded video in an application. Hardware acceleration capabilities are available on most devices 17
    • VideoStatus.ACCELERATER VideoStatus.SOFTWARE 最佳性能StageVideo 使用软件解码,用GPU合成 使用GPU解码并合成 最差的情况Video 使用硬件GPU解码,软件合成 使用软件解码并合成 18
    • 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
    • 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
    • 21
    • 22
    • Ear Piece Speaker Phone 23
    • Feature summary  Enable mobile app to toggle between earpiece and speakerphone AIR 2.7 > AIR 3.0No way to choose two speaks Easily access different speakersAll audio play back through media Enable the VOIP telephonyspeaker 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
    • 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
    • Play_button.addEventListener(MouseEvent.CLICK, playMusic);function playMusic(e:Event):void{ SoundMixer.audioPlaybackMode = “media”; SoundMixer.useSpeakerphoneForVoice = false; if(! playing) { sc = music.play(pos); playing = true; }} 26
    •  Microphone.isSupported Microphone.getMicrophone() Microphone.getEnhancedMicrophone() Microphone.setUseEchoSuppression() Microphone.setSilenceLevel(silenceLevel, timeout) SampleDataEvent.SAMPLE_DATA Microphone.activityLevel 27
    • … 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
    • NativeExtension 29
    • The native extensions feature enables the addition of third-party, native-codebacked ActionScript APIs to AIR applications. Normal apps NativeExtension apps A actionscript Library with Native Code implementation 30
    •  Enhance Performance  Zxing:ActionScript 2000ms, Android 10ms Expand functions  Autofocus for camera , Vibration … 31
    • 32
    • 33
    • 34
    • 35
    • An Android Project Provide Native Implementation for Native ExtensionA Flex Library Project Provide ActionScript API for Native Extension 36
    • Ane file A set of Actionscript with native code implementationA Flex Mobile Project Use the ane 37
    • 38