- case 'timeupdate' : // 通常の再生が行われ現在の再生位置の変化が起こった場合に発生\r
- if( X_Audio_HTMLAudioWrapper_ieMobile9Fix ){\r
- if( this._playForDuration === 1 ){\r
- console.log( 'tu ' + this._rawObject.duration );\r
- if( !this.duration && X_Type_isFinite( this._rawObject.duration ) ){\r
- this.duration = this.duration || this._rawObject.duration * 1000;\r
- this._playForDuration = 2;\r
- \r
- //this.proxy.asyncDispatch( 'loadedmetadata' );\r
- //this.proxy.asyncDispatch( 'loadeddata' );\r
- //this.proxy.asyncDispatch( 'canplay' );\r
- //this.proxy.asyncDispatch( 'canplaythrough' );\r
- loaded = true;\r
- //console.log( 'durationFix が完了' + this.duration );\r
- break;\r
+ // TODO firefox で 短い音声でtimeupdate, ended が発火しない <- 最後の音に無音部分を追加する\r
+ case 'timeupdate' : // 通常の再生が行われ現在の再生位置の変化が起こった場合に発生\r
+ if( this._seekingFixON ){\r
+ eventType = X_EVENT_MEDIA_SEEKING;\r
+ } else\r
+ if( this._durationFixPhase === 8 ){\r
+ this._durationFixPhase = 0;\r
+ this._readyState |= 1;\r
+ } else\r
+ if( this._durationFixPhase === 4 ){ // 1 or 2\r
+ duration = raw.duration;\r
+ eventType = X_EVENT_MEDIA_WAITING;\r
+ } else\r
+ if( this._touchState === 3 && !X_HTMLAudio_durationFix ){\r
+ this._touchState = 0;\r
+ this._readyState |= 1;\r
+ } else\r
+ if( ( now = this.getActualCurrentTime() ) === this._lastCurrentTime ){\r
+ eventType = X_EVENT_MEDIA_WAITING;\r
+ } else\r
+ if( X_HTMLAudio_playStartFix && ( now < this._lastCurrentTime ) ){\r
+ eventType = X_EVENT_MEDIA_WAITING;\r
+ //console.log( '@Firefox44.0.2 !! ' + now + ' / ' + this._lastCurrentTime );\r
+ // Firefox44.0.2 で音声の再生開始に難あり...\r
+ // 20回程度 currentTime の更新に失敗する....\r
+ this.actualPlay();\r
+ } else\r
+ if( this.playing ){\r
+ end = X_Audio_getEndTime( this ) + this._shortPlayFixTime;\r
+\r
+ //console.log( '@ ' + now + ' / ' + this._lastCurrentTime + ' / ' + end );// Firefox44.0.2 で音声の再生開始に難あり...\r
+\r
+ if( ( 0 + end <= 0 + now ) || // 0+ なぜか iem9 で必要,,,\r
+ ( now < this._lastCurrentTime && now < 2000 ) ){\r
+ //( ( X_HTMLAudio_endedFixAOSP2 || X_HTMLAudio_endedFixAOSP4 ) && ( now < this._lastCurrentTime && now < 1000 ) ) ){\r
+ // loop して0付近に戻った場合\r
+ // iOS8.4 ではこのタイミングで now が last より 0.1秒後退している場合がある\r
+ // iOS7.1 ではもっと小さい場合がある,,,\r
+ if( this.autoLoop ){\r
+ console.log( '☆★☆ 曲の最後に到達 @timeupdate now-end:' + ( now - end ) + ' now:' + now + ' last:' + this._lastCurrentTime );\r
+ ended = true;\r
+ //if( X_HTMLAudio_endedFixIOS ) actualEnded = true;\r