Please respect the results of the sharing, reproduced please indicate the source:
http://blog.csdn.net/hejjunlin/article/details/52349221
Preface: Starting from this article, will enter the multimedia framework, including MediaPlayer, Camera, Surface, Mediarecord, the next few are MediaPlayer related. Also look at the following agenda:
- State diagram of the MediaPlayer
- Idle state
- End State
- Error status
- Initialized status
- Prepared status
- Preparing status
- Started status
- Paused status
- Stopped status
- playbackcompleted status
MediaPlayer Introduction
The MediaPlayer class is a video/audio file and stream for controlling playback.
The main areas covered are as follows:
- State diagram
- Valid state and invalid state
- Permissions
- callback method
State diagram of the MediaPlayer
Playback control video/audio files and streams are managed by the state machine. Displays the MediaPlayer life cycle and is affected by the playback control operation.
Ellipse represents the state in which the MediaPlayer resides
Arcs represent playback control and drive the MediaPlayer state for transitions.
There are two types of arcs, one representing synchronous method calls with a single arrow, and another with two arrows representing asynchronous method calls
From the state diagram, we can see that MediaPlayer has some of the following States:
Idle state and end state
Error status
Initialized status
Prepared status
Started status
Paused status
Stopped status
playbackcompleted status
The first time to get blog update reminders, as well as more Android dry, source code Analysis , Welcome to follow my public number, sweep the bottom QR code or long press to identify two-dimensional code, you can pay attention to.
If you feel good, easy to praise, but also to the author's affirmation, can also share this public number to you more people, original not easy
Android Multimedia Framework Summary (i) MediaPlayer introduction state diagram and life cycle