Skip to content

Video and Audio Playback and Recording

Nathan Esquenazi edited this page Mar 1, 2014 · 22 revisions

Overview

In Android apps, there are often cases where we need to play audio or video files. Checking the Supported Media Formats we can see that several audio formats (MP3, AAC, FLAC, Vorbis) and several video formats (H.264, MPEG-4) are playable by default. Let's take a look at how to play media within an app using MediaPlayer and VideoView. We will also look at how to record or capture media with the MediaRecorder.

Needs Attention, Cliffnotes Here

Audio Playback and Capture

In this section we will take a look at how to play audio content using the MediaPlayer and capture audio with the MediaRecorder.

Playing Local Audio

...

Playing Streaming Audio

...

Capturing Audio

...

Video Playback and Capture

In this section we will take a look at how to play video content using the VideoView and capture video with the MediaRecorder.

Playing Local Video

...

Playing Streaming Video

...

Capturing Video

...

Streaming from 3gp Youtube Source

There are a few ways of video playback on the android device. Most of which include downloading the content to the device for playback. If you want to stream a video from a network hosted source. the youtube api gives you the ability to do so using their provided 3gp stream. The provided YouTube Android Player API allows you to do so with very little code.

References

Finding these guides helpful?

We need help from the broader community to improve these guides, add new topics and keep the topics up-to-date. See our contribution guidelines here and our topic issues list for great ways to help out.

Check these same guides through our standalone viewer for a better browsing experience and an improved search. Follow us on twitter @codepath for access to more useful Android development resources.

Clone this wiki locally