X-Git-Url: http://git.osdn.net/view?p=pettanr%2FclientJs.git;a=blobdiff_plain;f=0.6.x%2Fjs%2F07_audio%2F02_XHTMLAudio.js;fp=0.6.x%2Fjs%2F07_audio%2F02_XHTMLAudio.js;h=1c88ae5cb9c1a49f8744289864f1a46e561c283d;hp=17ea8abfd7f48151ff13c0425c67bf1260241c7f;hb=4e4ab3be10850546063d4a4b93250ed142bb8cd2;hpb=b05bf97c1b3b1720e73af54017a48291a364d394 diff --git a/0.6.x/js/07_audio/02_XHTMLAudio.js b/0.6.x/js/07_audio/02_XHTMLAudio.js index 17ea8ab..1c88ae5 100644 --- a/0.6.x/js/07_audio/02_XHTMLAudio.js +++ b/0.6.x/js/07_audio/02_XHTMLAudio.js @@ -177,11 +177,11 @@ if( X_Audio_constructor ){ if( X_HTMLAudio_need1stTouch ){ raw.src = source; } else { - // if( this.autoplay ){ + if( this.autoplay ){ raw.preload = 'auto'; raw.autoplay = true; // Android 4.0-4.1.x で必要 //raw.autobuffer = true; - //}; + }; raw.src = source; raw.load(); // Android4.1.1 HTL21 では必要! }; @@ -379,7 +379,7 @@ if( X_Audio_constructor ){ if( this._touchState === 1 ){ if( e.type === X_HTMLAudio_playTrigger ){ this._touchState = 2; - this.disatcher[ 'asyncDispatch' ]( X_EVENT_MEDIA_TOUCH_FOR_LOAD ); + this.disatcher[ 'asyncDispatch' ]( X_EVENT_MEDIA_WAIT_FOR_TOUCH ); }; } else if( ended ){ @@ -407,7 +407,7 @@ if( X_Audio_constructor ){ actualPlay : function( forcePlay, forceReload ){ var raw = this[ '_rawObject' ], - e, begin, end; + begin, end; if( !raw ) return; @@ -425,11 +425,13 @@ if( X_Audio_constructor ){ }; if( this._touchState === 2 ){ - e = X_EventDispatcher_CURRENT_EVENTS[ X_EventDispatcher_CURRENT_EVENTS.length - 1 ]; + //@dev{ + var e = X_EventDispatcher_CURRENT_EVENTS[ X_EventDispatcher_CURRENT_EVENTS.length - 1 ]; if( !e || !e[ 'pointerType' ] ){ alert( 'タッチイベント以外での play! ' + ( e ? e.type : '' ) ); return; }; + //@} this._touchState = 3; } else if( this._readyState !== 3 && this._durationFixPhase < 2 ){ @@ -578,7 +580,9 @@ if( X_Audio_constructor ){ * - volume, muted iPhone(iOS4-6)、Android(2.3.6)では動作せず。 * - FireFox3.6, Android 2.3.6については、src変更後、load()を呼び出さないと切り替わらなかった。iPhoneはload()が不要。 */ - detect : function( proxy, source, ext ){ + detect : function( proxy, ext, hash ){ + // TODO hash.CBR + // 得意度で返す proxy[ 'asyncDispatch' ]( { type : X_EVENT_COMPLETE, canPlay : X_Audio_codecs[ ext ] } ); },