Using the Media APIs
Android supports playing audio and video content under the
android.media package. In this chapter, we are going to explore the media APIs from this package.
At the heart of the
android.media package is the
android.media.MediaPlayer class. The
MediaPlayer class is responsible for playing both audio and video content. The content for this class can come from the following sources:
- Web: You can play content from the Web via a URL.
apkfile: You can play content that is packaged as part of your
.apkfile. You can package the media content as a resource or as an asset (within the
- SD card: You can play content that resides on the device's SD card.
The MediaPlayer is capable of decoding quite a few different content ...