MediaUtil.java 文件源码

java
阅读 35 收藏 0 点赞 0 评论 0

项目:exciting-app 作者:
/**
 * 结束播放音频
 */
public static void stopPlayVoice() {
    if (player != null && player.isPlaying()) {
        player.release();
        player = null;
    }
    if (v_playVoice != null) {
        try {
            ((AnimationDrawable) v_playVoice.getBackground()).stop();
            ((AnimationDrawable) v_playVoice.getBackground())
                    .selectDrawable(0);
            v_playVoice = null;
        } catch (Exception e) {
            e.printStackTrace();
        }
        // 注意
        // :此处try\catch用来修复BUG——播放语音时,滑动观看交流信息再点击语音会卡死。若是播放时,来回滑动过多,也有几率造成卡死。
    }
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号