Preface: We introduce MediaPlayer related method, some people say, there is no actual example, see not very clear, today in the analysis of MediaPlayer, incidentally a broadcast network video example. You can try it yourself. Today's analysis is the next few introduction of the various modules to pave.
The MediaPlayer framework in Android
MediaPlayer Play Video Main module
Play main module corresponding components
MediaPlayer method corresponding to valid state and invalid state
Case: MediaPlayer Play network video
MediaPlayer frame MediaPlayer Play video main module in Android
Play main module corresponding component MediaPlayer method corresponding valid state and invalid state MediaPlayer play network video
To demonstrate, I built a server locally and placed the video file in the root directory in Tomcat. The name is a video of Sanpan.mp4.
Case code
Set playback-related methods: MediaPlayer the understanding of each State in the previous article.
XML file:
Because it is a network video, remember to add access to the network in manifest
The above code has been uploaded to Baidu Cloud: (permanent link) https://pan.baidu.com/s/1jIpslQu
Android Multimedia Framework Summary (ii) MediaPlayer frame and broadcast network video case