安卓开发如何实现播放网络视频?用什么思路?
发布网友
发布时间:2022-04-23 01:39
我来回答
共1个回答
热心网友
时间:2023-10-10 09:36
用android Library的mediaplayer class
// steps show as following
1 Create a MediaPlayer instance through the create() method (idle state).
2 Initialize the MediaPlayer with the media source to play (initialized state).
3 Prepare the MediaPlayer for playback through the prepare() method (preparing
and prepared states).
4 Play the MediaPlayer through the start() method (started state).
5 Duringplayback,ifdesired,youcanpause,stop,orreplaytheMediaPlayer(started,
paused, playback complete, and stopped states).
6 Once playback is finished, make sure to release the MediaPlayer’s associated re-
sources by calling release() (end state).