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 get auido state bug #3974

Merged
merged 1 commit into from Mar 9, 2019
Merged

Conversation

knoxHuang
Copy link
Contributor

Re: cocos-creator/2d-tasks#

Changes:

  • 这里漏了 PLAYING 的状态判断

@knoxHuang knoxHuang self-assigned this Mar 6, 2019
this._state = Audio.State.STOPPED;
}
else if (Audio.State.STOPPED === this._state && !elem.paused) {
Copy link
Contributor

Choose a reason for hiding this comment

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

其实这一段是因为有些浏览器里的 audio 不会触发 ended 事件
所以才需要强制将 audio 的状态更新为 STOPPED

PLAYING 状态可以不用考虑

Copy link
Contributor Author

@knoxHuang knoxHuang Mar 6, 2019

Choose a reason for hiding this comment

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

这里考虑到了 AudioSources 组件的情况,用的是同一个 audio,这样会导致第二个 play 的话,在获取 state 状态就错了

@PPpro
Copy link
Contributor

PPpro commented Mar 6, 2019

audioSource 确实需要更新

@pandamicro pandamicro merged commit 0a270c0 into cocos:v2.0-release Mar 9, 2019
pandamicro pushed a commit that referenced this pull request Mar 11, 2019
* Add RenderMode TS support (#3879)

Add spine assembler var define

* fix unit test for sprite (#3870)

* Fix 1.x to 2.x particle custom data is invalid bug (#3885)

* Improve particle definition data code (#3892)

* fix event failed to reorder after modifying zIndex for 2d-tasks/issues/1130 (#3895)

* Move BlendFunctionFactors to Sprite and ParticleSystem only (#3900)

* change API:loadSubpackage to load index.js (#3899)

* mark component.enabled as animatable (#3898)

* ban JIT support on baidugame (#3903)

* Fix dragonbones multiple texture bug (#3897)

* Fix dragonbones change cloth bug

* Adapt to old api-> on off once

* DragonBonesAsset do not store dragonBones data

* fix some error

* fix web spine debug draw color error

* Set limit time to 30s

* fix label rendering in open data context (#3911)

* fix: shaders have same uniform name, different type will effect wrong (#3876)

* fix: shaders have same uniform name, different type will effect wrong

* fix shaders have same uniform name, different type will effect wrong

* fix shaders have same uniform name, different type will effect wrong, refine

* add deprecated property in EditBox in v2.0 (#3912)

* Fix dragonbones exception (#3914)

* revert particles system attribute definition (#3919)

* fix emit target scale changed events twice (#3922)

* add the tween test case (#3908)

* add the tween test case

* modify the format of the test-tween.js

1. keep all chain method start at the char 'n' below

* fixed the tween bugs

* Fix spine premultipliedAlpha serialize bug (#3924)

* cancel disable dynamic atlas on chrome. (#3929)

* Add cache mode of label. (#3916)

* Add cache mode of label.

* fix revised comments of pr.

* Simplified variable name.

* share canvas pool.

* cancel use node color.

* modify comment and reserve _batchAsBitMap.

* optimize the assignment of color and delete blendFactor.

* delete reserveImage.

* modify to center alignment.

* modify letter-font do not use node color.

* add outline support of letter-font

* add letter atlas reset on editor when scene loaded.

* change LETTER to CHAR

* modify comment

* Wechat -> WeChat

* Add spine render mode chinese tip (#3933)

* fix label rendering error on native (#3936)

* fix label rendering error on native

* fix rendering error on native

* revert first commit

* clear letter atlas when scene launch. (#3938)

*  reset the CHAR mode to NONE on subdomin. (#3940)

* reset the CHAR mode to NONE on subdomin.

* reset CHAR mode on subdomin

* set rigidbody awake visible is false (#3941)

* fix canvasPool error on subdomin (#3942)

* update rigidbody awake tips and add awakeOnLoad (#3944)

* fix label error when font change on editor. (#3946)

* Rename skeleton RenderMode to AnimationCacheMode (#3947)

* Rename skeleton RenderMode to AnimationCacheMode

* Rename skeleton RenderMode to AnimationCacheMode

* fix label blur when using dark font color (#3949)

* optimize editBox style (#3952)

* To adapt the adjust of the webview impl in the jsb (#3697) (#3951)

* fix the problem of label that first modified is invalid. (#3959)

* Fix create ArmatureDisplay by code but no set asset, then invoke some api about event, will throw error (#3966)

* fix get auido state bug (#3974)

* small fixed

* small fixed
@jareguo
Copy link
Contributor

jareguo commented May 9, 2019

修复了 AudioSource 组件第二次播放时,获取的 state 状态错误的问题

minggo pushed a commit that referenced this pull request Feb 10, 2022
* compile ios verbose

* mac recompile
minggo pushed a commit that referenced this pull request Feb 10, 2022
* [v3.4.0] [ci] compile ios verbose (#3974
minggo added a commit that referenced this pull request Feb 10, 2022
* [ci] compile ios verbose (#3978)

* [v3.4.0] [ci] compile ios verbose (#3974

* Merge the code of v3.3.1 platform adaptation layer into the development branch (#3958)

* 1、Merge platform adaptation layer code into the development branch
2、It passed the test in windows and ohos system

* 1、Merge platform adaptation layer code into the development branch
2、It passed the test in windows and ohos system

* 1、Fix github compile windows error

* 1、Fix github compile windows error

* 1. Adjust the code format;
2. Fix js automatic generation binding
3. Adjust github CI compilation

* 1. Adjust the code format;
2. Fix js automatic generation binding
3. Adjust github CI compilation

* Solve mac and ios compilation failure

* Fix the problem of compilation of Windows-side simulator

* 1. Adapt the simulator to a new adaptation layer;
2. Fix the compilation warning of ios, and the implicit conversion failed;
3. Fix the mac compilation error, due to the problem of adding the link identification -all_load;

* 1.Add the isDisplayStats and setDisplayStats method to the screen interface

* Fix clang-tidy compilation warning

* Fix clang-tidy compilation warning

* Repair the emulator, compatible with mac and win

* 1、Repair detailed errors, including name modification and calling method modification
2、Delete redundant files in the template directory
3、Change the vibrate interface to vibrator
4、Fix word spelling errors

* Rename interfaces to modules

* Replace CC_ASSERT with CCASSERT

* Replace CC_ASSERT with CCASSERT

Co-authored-by: qiuguohua <>

* Remove all_flag in IOS (#4014)

* gfx: onAcquire callback (#4038)

* Solve the conflict between cocos/platform and template

Co-authored-by: minggo <nudtzxm@gmail.com>
Co-authored-by: 江战 <40414978+PatriceJiang@users.noreply.github.com>
Co-authored-by: Yun Hsiao Wu <yunhsiaow@gmail.com>
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

4 participants