On the mediaplayer class of Android

Mediaplayer is commonly used in Android to play some media files. For audio files, you only need to use meidaplayer combined with a few sentences of code, but it is a little more complex for video files. A separate mediaplayer can only play audio files. If you want to play video, you also need surfaceview to cooperate with the display screen. For surfaceview, the separation mechanism between display and control is adopted in Android, that is, surfaceview is only responsible for displaying the screen, not controlling the video stream. Therefore, surfaceholder is also required to control the video stream. The key codes are as follows:

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>