From f5d5a617ab61ba56b0d0ef653a6da375844c8c2d Mon Sep 17 00:00:00 2001 From: Yun Hsiao Wu Date: Tue, 5 Nov 2019 17:35:43 +0800 Subject: [PATCH] wx audio volume control workaround (#5679) --- cocos/audio/assets/player-wx.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/cocos/audio/assets/player-wx.ts b/cocos/audio/assets/player-wx.ts index f3186319b8..3bd5d297e3 100644 --- a/cocos/audio/assets/player-wx.ts +++ b/cocos/audio/assets/player-wx.ts @@ -48,6 +48,10 @@ export class AudioPlayerWX extends AudioPlayer { constructor (info: IAudioInfo) { super(info); this._audio = info.clip; + // [HACK] volume property doesn't work on some devices during the first playthrough + this._audio.play(); + this._audio.stop(); + this._audio.onPlay(() => { if (this._state === PlayingState.PLAYING) { return; } this._state = PlayingState.PLAYING;