Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Android Media Framework - Code App, Level Up - [Dec. 2012]


Published on

Presentation about "Android Media Framework"

Event: Code App, Level Up
Organizer: EESTEC, FCSE
Date: 12.12.2012, Skopje, Macedonia

  • Be the first to comment

Android Media Framework - Code App, Level Up - [Dec. 2012]

  1. 1. Android Media Framework Viktor Stojanovski Android Developer @ Seavus 12.12.2012
  2. 2. Agenda  Media API  Introducing the Media Player  Playing Audio Files  Playing Video Files  Capturing Photos  Record Videos  Demo code  Q&A Session
  3. 3. Media API  All classes can be found in package  MediaPlayer class is responsible for playing both Audio and Video content.  MediaPlayter filetypes: Audio Video Picture AAC LC/LTP HE-AACv1 (AAC+) AMR-NB AMR-WB MP3 MIDI Ogg Vorbis PCM/WAVE H.263 H.264 AVC MPEG-4 SP JPEG PNG GIF BMP
  4. 4. Introducing the Media Player 1. Initialize the Media Player with media to play. 2. Prepare the Media Player for playback. 3. Start the playback. 4. Pause or stop the playback prior to its completing. 5. The playback is complete. Details:
  5. 5. Choose Stream to Use  Identify Which Audio Stream to Use    Android has separate audio streams for: Music, Alarms, Notifications, Call Ringer, System Sounds, In-Call volume) If you are not replacing Alarm Clock application, you will always use STREAM_MUSIC Use Hardware Volume Keys to Control Your App’s Audio Volume  By default, pressing the volume controls modify the volume of the active audio stream. If your app isn't currently playing anything, hitting the volume keys adjusts the ringer volume.
  6. 6. Playing Audio Files
  7. 7. Playing Video Files When a Video is initialized you can control the playback: - start - stopPlayback - pause - seekTo - setKeepScreenOn
  8. 8. Playing Video Files
  9. 9. Capturing Photos  Camera Permission  Invoke Intent for taking photo  Do the actual capturing  Catch the captured photo in your application
  10. 10. Record Videos  Camera Permission  Invoke Intent for recording video  Do the actual recording  Catch the recorded video in your application
  11. 11. Detecting Faces  Available from API Level 14 (Android 4.0)  Face detection is not necessarily available on every device, even those running Android 4.0 or above.  confidence ();  Returns a confidence factor between 0 and 1. This indicates how certain what has been found is actually a face. A confidence factor above 0.3 is usually good enough. More:
  12. 12. Read more … Chapter 15 Chapter 24