安卓开发如何实现播放网络视频?用什么思路?

2024-12-25 23:44:33
推荐回答(1个)
回答1:

用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).