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

Conversation

@umbrellaPP
Copy link
Collaborator

umbrellaPP commented Nov 14, 2019

changeLog:

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

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

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

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

@umbrellaPP umbrellaPP requested review from knoxHuang and holycanvas Nov 14, 2019
@holycanvas

This comment has been minimized.

Copy link
Contributor

holycanvas commented Nov 14, 2019

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

能绕过么

@holycanvas

This comment has been minimized.

Copy link
Contributor

holycanvas commented Nov 14, 2019

currentTime给微信反馈过么

@umbrellaPP

This comment has been minimized.

Copy link
Collaborator Author

umbrellaPP commented Nov 14, 2019

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

@umbrellaPP umbrellaPP force-pushed the umbrellaPP:221_audio branch from 31b34ec to 6acf75c Nov 14, 2019
@umbrellaPP

This comment has been minimized.

Copy link
Collaborator Author

umbrellaPP commented Nov 14, 2019

目前先用这种方式绕过

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

This comment has been minimized.

Copy link
Contributor

holycanvas commented Nov 14, 2019

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

@umbrellaPP umbrellaPP force-pushed the umbrellaPP:221_audio branch from ddbd3bd to 6acf75c Nov 14, 2019
this._element.seek(0);
this._element.stop();

This comment has been minimized.

Copy link
@holycanvas

holycanvas Nov 14, 2019

Contributor

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

@umbrellaPP umbrellaPP force-pushed the umbrellaPP:221_audio branch from f5c97c9 to 950776d Nov 14, 2019
@holycanvas holycanvas merged commit fbc687c into cocos-creator-packages:v2.2.1-release Nov 14, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.