Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

如何彻底清空播放列表? #222

Open
jarvan11 opened this issue Mar 21, 2024 · 1 comment
Open

如何彻底清空播放列表? #222

jarvan11 opened this issue Mar 21, 2024 · 1 comment

Comments

@jarvan11
Copy link

1.先在页面正常播放音频A,然后在页面退出前,调用:
StarrySky.with().stopMusic()
StarrySky.with().clearPlayList()
2.如果在其他页面调用:StarrySky.with().restoreMusic(),此时又会播放音频A了,这个音频A清不掉吗?
请问如何彻底清空播放列表?在步骤1,添加一个空的播放列表,也不行,
如:StarrySky.with().addPlayList(mutableListOf())

@jarvan11
Copy link
Author

1.先在页面正常播放音频A,然后在页面退出前,调用: StarrySky.with().stopMusic() StarrySky.with().clearPlayList() 2.如果在其他页面调用:StarrySky.with().restoreMusic(),此时又会播放音频A了,这个音频A清不掉吗? 请问如何彻底清空播放列表?在步骤1,添加一个空的播放列表,也不行, 如:StarrySky.with().addPlayList(mutableListOf())

看源码,应该是ExoPlayback类里面的变量 currSongInfo没置空导致的,能否在调用clearPlayList()时置空一下currSongInfo,或者提供一个置空的方法?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant