wx audio volume control workaround (#5679)

This commit is contained in:
Yun Hsiao Wu
2019-11-05 17:35:43 +08:00
committed by pandamicro
parent 90dd788ff3
commit f5d5a617ab
+4
View File
@@ -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;