希望各位英雄好汉路过能够提出宝贵的建议,谢谢!
5 个解决方案
#1
用异步的prepare()方法,用回调prepareListener回调函数,当回调还没有执行时,应该提示Loading ,提高用户体验。
#2
嗯,想法不错,还有其他办法避免prepare时间太长这种情况吗?
#3
确实是用birdsaction 所说的异步方法prepareAsync ,而prepare是个同步方法,对于播放本地多媒体文件比较适合,官方文档也是这么说的:
public void prepareAsync ()
Prepares the player for playback, asynchronously. After setting the datasource and the display surface, you need to either call prepare() or prepareAsync(). For streams, you should call prepareAsync(), which returns immediately, rather than blocking until enough data has been buffered.
public void prepareAsync ()
Prepares the player for playback, asynchronously. After setting the datasource and the display surface, you need to either call prepare() or prepareAsync(). For streams, you should call prepareAsync(), which returns immediately, rather than blocking until enough data has been buffered.
#4
先这样,这种情况一方面取决于系统自身对这种格式解码能力,其他方面暂时不太好说
#5
你自己也说了,这种情况一方面取决于系统自身对这种格式解码能力,这个速度不是你能控制的,哪有其他方案,或者你改改系统试试?
#1
用异步的prepare()方法,用回调prepareListener回调函数,当回调还没有执行时,应该提示Loading ,提高用户体验。
#2
嗯,想法不错,还有其他办法避免prepare时间太长这种情况吗?
#3
确实是用birdsaction 所说的异步方法prepareAsync ,而prepare是个同步方法,对于播放本地多媒体文件比较适合,官方文档也是这么说的:
public void prepareAsync ()
Prepares the player for playback, asynchronously. After setting the datasource and the display surface, you need to either call prepare() or prepareAsync(). For streams, you should call prepareAsync(), which returns immediately, rather than blocking until enough data has been buffered.
public void prepareAsync ()
Prepares the player for playback, asynchronously. After setting the datasource and the display surface, you need to either call prepare() or prepareAsync(). For streams, you should call prepareAsync(), which returns immediately, rather than blocking until enough data has been buffered.
#4
先这样,这种情况一方面取决于系统自身对这种格式解码能力,其他方面暂时不太好说
#5
你自己也说了,这种情况一方面取决于系统自身对这种格式解码能力,这个速度不是你能控制的,哪有其他方案,或者你改改系统试试?