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 audioEngine restore paused audio on show event #141

Merged
merged 1 commit into from Jun 13, 2019

Conversation

@umbrellaPP
Copy link
Contributor

umbrellaPP commented Jun 12, 2019

Re: cocos-creator/2d-tasks#1356

changeLog:

  • 修复原生平台,暂停音乐后,从后台切回前台,还会继续播放的 bug

底层自动做了处理,这里不需要再另外适配 _restore 和 _break,用空实现就好了

@jareguo jareguo requested a review from minggo Jun 12, 2019
@jareguo

This comment has been minimized.

Copy link
Contributor

jareguo commented Jun 12, 2019

@minggo 有空帮 review 下~

@minggo

This comment has been minimized.

Copy link
Collaborator

minggo commented Jun 13, 2019

底层自动做了处理

这个指的是?

@umbrellaPP umbrellaPP force-pushed the umbrellaPP:v2.2.0 branch from 201a374 to 92a6a05 Jun 13, 2019
@umbrellaPP

This comment has been minimized.

Copy link
Contributor Author

umbrellaPP commented Jun 13, 2019

这个指的是?

我在真机上测试,进入后台后他会自动暂停音频的播放,切回前台后会继续播放
这个应该是系统层级上做的操作,AudioEngine 应该没有做这个操作

之前做 _break _restore 这个操作,是因为 web 平台上,有些浏览器退到后台之后还会继续播放音频,所以需要手动暂停,切回前台后再继续播放
原生平台上应该不需要这个操作 @minggo

@minggo
minggo approved these changes Jun 13, 2019
@jareguo jareguo merged commit f5dcba7 into cocos-creator-packages:v2.2.0 Jun 13, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants
You can’t perform that action at this time.