EspoirX / StarrySky

🔥A Powerful and Streamline MusicLibrary(一个丰富的音乐播放封装库,支持多种音频格式,完美解决你的问题。)
https://github.com/EspoirX/StarrySky
MIT License
1.4k stars 211 forks source link

锁屏页点暂停后,再点播放,播放出现问题 #127

Closed teprinciple closed 4 years ago

teprinciple commented 5 years ago

锁屏页点击暂停时, MusicService中不应该 mediaSession.setActive(false) ,置为false将断开与锁屏页的连接。所以这里暂停时不应设置,停止才设置。

     /**
     * 暂停或停止时回调
     */
    @Override
    public void onPlaybackStop() {
        mediaSession.setActive(false);  
        mDelayedStopHandler.removeCallbacksAndMessages(null);
        mDelayedStopHandler.sendEmptyMessageDelayed(0, STOP_DELAY);
        stopForeground(true);
    }
EspoirX commented 4 years ago

最新版本已解决