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

fix replay audio after audio stop on alipay platform #29

Merged
merged 2 commits into from Nov 14, 2019

Conversation

PPpro
Copy link
Collaborator

@PPpro PPpro commented Nov 14, 2019

changeLog:

  • 修复支付宝上停止播放后,又重新开始播放的问题

原因是 audio.seek(0) 之后底层又让他重新播放了。这里直接就调用 audio.stop() 接口吧

之前用 pause() + seek(0) 主要是因为在微信百度上,调 stop 之后,currentTime 是不会设置为 0 的
但是这个问题本身就不应该是我们来做处理的,stop 之后的 currentTime 是什么,取决于平台方的底层实现。引擎适配层不做处理

以后类似这样的 issue,我们都不应该处理 cocos/2d-tasks#1447
如果真的要解决应该反馈给平台方处理

@PPpro PPpro requested review from knoxHuang and holycanvas Nov 14, 2019
@holycanvas
Copy link
Contributor

@holycanvas holycanvas commented Nov 14, 2019

audio.seek(0);
audio.stop();

能绕过么

@holycanvas
Copy link
Contributor

@holycanvas holycanvas commented Nov 14, 2019

currentTime给微信反馈过么

@PPpro
Copy link
Collaborator Author

@PPpro PPpro commented Nov 14, 2019

很早之前应该有反馈过。。。

@PPpro
Copy link
Collaborator Author

@PPpro PPpro commented Nov 14, 2019

目前先用这种方式绕过

audio.seek(0);
audio.stop();

@holycanvas
Copy link
Contributor

@holycanvas holycanvas commented Nov 14, 2019

再反馈一次吧,估计都忘了

this._element.seek(0);
this._element.stop();
Copy link
Contributor

@holycanvas holycanvas Nov 14, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

注释下为什么这么 hack 吧,第一眼看到完全懵的。然后有demo么,再跟微信反馈一次吧

@holycanvas holycanvas merged commit fbc687c into cocos-creator-packages:v2.2.1-release Nov 14, 2019
@PPpro PPpro deleted the 221_audio branch Nov 7, 2020
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

Successfully merging this pull request may close these issues.

None yet

2 participants