console.log( 'WebAudio buffer ready' );
- this.autoplay && X_Timer_once( 16, this, this.play );
+ this.autoplay && !X_WebAudio_need1stTouch && X_Timer_once( 16, this, this.actualPlay );
},
actualPlay : function(){
- var begin, end;
+ var e, begin, end;
- console.log( '[WebAudio] play abuf:' + !!this.audioBuffe );
+ console.log( '[WebAudio] play abuf:' + !!this.audioBuffer );
if( !this.audioBuffer ){
this.autoplay = true;
return;
};
+ if( X_WebAudio_need1stTouch ){
+ e = X_EventDispatcher_CURRENT_EVENTS[ X_EventDispatcher_CURRENT_EVENTS.length - 1 ];
+ if( !e || !e[ 'pointerType' ] ){
+ alert( 'タッチイベント以外での play! ' + ( e ? e.type : '' ) );
+ return;
+ };
+ };
+
end = X_Audio_getEndTime( this );
begin = X_Audio_getStartTime( this, end, true );