-
Notifications
You must be signed in to change notification settings - Fork 6.3k
Video and Audio Playback and Recording
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.
Needs Attention, Cliffnotes Here
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.
- http://mrbool.com/how-to-play-video-formats-in-android-using-videoview/28299
- http://developer.android.com/guide/topics/media/mediaplayer.html
- http://developer.android.com/training/managing-audio/index.html
- http://developer.android.com/guide/appendix/media-formats.html
- https://developers.google.com/youtube/android/player/
Created by CodePath with much help from the community. Contributed content licensed under cc-wiki with attribution required. You are free to remix and reuse, as long as you attribute and use a similar license.
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.