リビジョン | d3d95fb0bc2ab2f61c7f15746b2d64078ef39af8 (tree) |
---|---|
日時 | 2016-02-12 14:25:44 |
作者 | itozyun <itozyun@user...> |
コミッター | itozyun |
Version 0.6.212, bug fixes X.WebAudio.
@@ -224,7 +224,7 @@ if( X_WebAudio_context ){ | ||
224 | 224 | _startPos : 0, |
225 | 225 | _endPosition : 0, |
226 | 226 | _startTime : 0, |
227 | - _timerID : 0, | |
227 | + //_timerID : 0, | |
228 | 228 | _interval : 0, |
229 | 229 | audioBuffer : null, |
230 | 230 | bufferSource : null, |
@@ -354,8 +354,8 @@ if( X_WebAudio_context ){ | ||
354 | 354 | //console.log( '> use onended' ); |
355 | 355 | //this.bufferSource.onended = this._onended || ( this._onended = X_Closure_create( this, this._onEnded ) ); |
356 | 356 | //} else { |
357 | - this._timerID && X_Timer_remove( this._timerID ); | |
358 | - this._timerID = X_Timer_once( end - begin, this, this._onEnded ); | |
357 | + //this._timerID && X_Timer_remove( this._timerID ); | |
358 | + //this._timerID = X_Timer_once( end - begin, this, this._onEnded ); | |
359 | 359 | //}; |
360 | 360 | |
361 | 361 | if( this.bufferSource.start ){ |
@@ -368,7 +368,8 @@ if( X_WebAudio_context ){ | ||
368 | 368 | this._startPos = begin; |
369 | 369 | this._endPosition = end; |
370 | 370 | this._startTime = X_WebAudio_context.currentTime * 1000; |
371 | - this._interval = this._interval || X_Timer_add( 1000, 0, this, this._onInterval ); | |
371 | + // this._interval = this._interval || X_Timer_add( 1000, 0, this, this._onInterval ); | |
372 | + this._interval = this._interval || X_Timer_add( 100, 0, this, this._onEnded ); | |
372 | 373 | }, |
373 | 374 | |
374 | 375 | _sourceDispose : function(){ |
@@ -377,17 +378,18 @@ if( X_WebAudio_context ){ | ||
377 | 378 | delete this.bufferSource; |
378 | 379 | }, |
379 | 380 | |
381 | + /* | |
380 | 382 | _onInterval : function(){ |
381 | 383 | if( !this.playing ){ |
382 | 384 | delete this._interval; |
383 | 385 | return X_CALLBACK_UN_LISTEN; |
384 | 386 | }; |
385 | 387 | this.disatcher[ 'dispatch' ]( X_EVENT_MEDIA_PLAYING ); |
386 | - }, | |
387 | - | |
388 | + }, */ | |
389 | + | |
388 | 390 | _onEnded : function(){ |
389 | 391 | var time; |
390 | - delete this._timerID; | |
392 | + //delete this._timerID; | |
391 | 393 | |
392 | 394 | if( this.playing ){ |
393 | 395 | time = X_WebAudio_context.currentTime * 1000 - this._startTime - this._endPosition + this._startPos | 0; |
@@ -397,9 +399,10 @@ if( X_WebAudio_context ){ | ||
397 | 399 | if( time < 0 ) return; |
398 | 400 | } else { |
399 | 401 | if( time < 0 ){ |
402 | + this.disatcher[ 'dispatch' ]( X_EVENT_MEDIA_PLAYING ); | |
400 | 403 | //console.log( '> onEnd crt:' + ( X_WebAudio_context.currentTime * 1000 ) + ' startTime:' + this._startTime + |
401 | 404 | // ' from:' + this._startPos + ' to:' + this._endPosition ); |
402 | - this._timerID = X_Timer_once( -time, this, this._onEnded ); | |
405 | + // this._timerID = X_Timer_once( -time, this, this._onEnded ); | |
403 | 406 | return; |
404 | 407 | }; |
405 | 408 | }; |
@@ -409,6 +412,9 @@ if( X_WebAudio_context ){ | ||
409 | 412 | this.looped = true; |
410 | 413 | this.disatcher[ 'dispatch' ]( X_EVENT_MEDIA_LOOPED ); |
411 | 414 | this.actualPlay(); |
415 | + } else { | |
416 | + delete this._interval; | |
417 | + return X_CALLBACK_UN_LISTEN; | |
412 | 418 | }; |
413 | 419 | } else { |
414 | 420 | this.actualPause(); |
@@ -420,8 +426,10 @@ if( X_WebAudio_context ){ | ||
420 | 426 | actualPause : function(){ |
421 | 427 | console.log( '[WebAudio] pause' ); |
422 | 428 | |
423 | - this._timerID && X_Timer_remove( this._timerID ); | |
424 | - delete this._timerID; | |
429 | + //this._timerID && X_Timer_remove( this._timerID ); | |
430 | + //delete this._timerID; | |
431 | + this._interval && X_Timer_remove( this._interval ); | |
432 | + delete this._interval; | |
425 | 433 | delete this.playing; |
426 | 434 | |
427 | 435 | if( this.bufferSource ){ |
@@ -112,7 +112,7 @@ if( X_Plugin_WMP_VERSION ){ // IETester で 6.x は不可 | ||
112 | 112 | _onTimer : function(){ |
113 | 113 | var progress, time; |
114 | 114 | |
115 | - // road 中の場合 | |
115 | + // load 中の場合 | |
116 | 116 | if( this._readyState === 1 ){ |
117 | 117 | if( 7 <= X_Plugin_WMP_VERSION ){ |
118 | 118 | progress = this._wmp[ 'network' ][ 'downloadProgress' ]; |