We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
大佬我想监听播放器播放状态试过几种办法我能 想到的但是无果 在探索过程中发现下面问题: 1、我在 vuex中设置了一个参数isPlaying 默认false 目的是用来判断是否播放 并且在获取数据之后改变这个值true 2、我在update 生命周期中判断 这个值 假如是真的话就调用 this.$refs.player.play(); 3、然后我打印this.$refs.player.isPlaying 显示是false (并且会打印两次), aplayer的播放状态参数 isPlaying 并没有立即改变过来 4、除过第一首之后打印的值都是true ,使用 this.$nextTick 结果也一样
因为我想做一个歌曲展开面板 里面的按钮可以控制播放或者暂停 现在我不知道该怎么搞了 求大佬给个思路 能监听播放器播放状态
The text was updated successfully, but these errors were encountered:
@OneKissAndOneShot player.toggle() 可以控制播放器播放/暂停,player.isPlaying 是播放器当前的状态。你可以不用自己去判断该调 play() 还是 pause(),直接通过 isPlaying 来显示不同的按钮,点击的时候调 toggle() 就可以了。
player.toggle()
player.isPlaying
play()
pause()
isPlaying
toggle()
如果不太明白的话,不妨贴一些你的代码?
Sorry, something went wrong.
我先试试看
@OneKissAndOneShot 使用方面的问题你可以加入 Discord 来讨论
No branches or pull requests
大佬我想监听播放器播放状态试过几种办法我能 想到的但是无果 在探索过程中发现下面问题:
1、我在 vuex中设置了一个参数isPlaying 默认false 目的是用来判断是否播放 并且在获取数据之后改变这个值true
2、我在update 生命周期中判断 这个值 假如是真的话就调用 this.$refs.player.play();
3、然后我打印this.$refs.player.isPlaying 显示是false (并且会打印两次), aplayer的播放状态参数 isPlaying 并没有立即改变过来
4、除过第一首之后打印的值都是true ,使用 this.$nextTick 结果也一样
因为我想做一个歌曲展开面板 里面的按钮可以控制播放或者暂停 现在我不知道该怎么搞了
求大佬给个思路 能监听播放器播放状态
The text was updated successfully, but these errors were encountered: