Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.

  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint

Playing Audio and Video

Playing audio and video is handled by the MediaPlayer object. This object conveniently abstracts the handling of specific media types from the developer. This section investigates the media player, the formats it supports, and how it is controlled.

Media Player Supported Formats

So, what is the media player, and how do you control it?

The media player supports the following formats:

  • Audio
    • AAC LC/LTP
    • HE-AACv1 (AAC+)
    • HE-AACv2 (Enhanced AAC+)
    • AMR-NB
    • AMR-WB
    • MP3
    • MIDI
    • Ogg Vorbis
    • PCM/WAVE
    • FLAC (as of Android 3.1)
  • Video
    • H.263
    • H.264 AVC
    • MPEG-4 SP
    • VP8

Playing back any of this media with the MediaPlayer object is a five-step process:

1. Initialize a MediaPlayer object.
2. Prepare the media player for playback.
3. Start the playback.

  

You are currently reading a PREVIEW of this book.

                                                                                                                    

Get instant access to over $1 million worth of books and videos.

  

Start a Free Trial


  
  • Safari Books Online
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint