Android Multimedia Framework Summary (i) MediaPlayer introduction state diagram and life cycle

Source: Internet
Author: User

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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.