X-Git-Url: http://git.osdn.jp/view?a=blobdiff_plain;f=0.6.x%2Fjs%2F07_audio%2F02_XHTMLAudio.js;h=3e84d3dc4404a9207f5c592e875f14402a611b82;hb=0a4e04fb0af6e1b2e452d1a8c0822e723d32a0ee;hp=c1258a3c44bd2b560547ebc5352fd0f0849cf95b;hpb=8e63f506d14490e852fa557d326ca91f9cdd3baf;p=pettanr%2FclientJs.git diff --git a/0.6.x/js/07_audio/02_XHTMLAudio.js b/0.6.x/js/07_audio/02_XHTMLAudio.js index c1258a3..3e84d3d 100644 --- a/0.6.x/js/07_audio/02_XHTMLAudio.js +++ b/0.6.x/js/07_audio/02_XHTMLAudio.js @@ -8,9 +8,11 @@ var X_Audio_HTMLAudio_playTrigger = 6 <= X_UA[ 'iOS' ] ? 'loadeddata' : X_UA[ 'iOS' ] < 5 ? 'stalled' : X_UA[ 'iOS' ] ? 'suspend' : - X_UA[ 'AndroidBrowser2' ] ? 'stalled' : // Android 2.3.5(SBM101SH) では stalled は発生しない,,, + X_UA[ 'AndroidBrowser2' ] || X_UA[ 'AndroidBrowser3' ] ? 'stalled' : // Android 2.3.5(SBM101SH) では stalled は発生しない,,, X_UA[ 'AndroidBrowser4' ] ? 'loadeddata' : - X_UA[ 'OperaMobile' ] || X_UA[ 'OperaTablet' ] ? 'loadeddata' : 'loadeddata', //'canplay', + X_UA[ 'OperaMobile' ] || X_UA[ 'OperaTablet' ] ? 'loadeddata' : + //X_UA[ 'WinPhone' ] && X_UA[ 'IE9' ] ? 'canplay' : + 'loadeddata', //'canplay', X_Audio_HTMLAudioWrapper, X_Audio_constructor = window[ 'Audio' ] || window.HTMLAudioElement, X_Audio_rawAudio, @@ -39,6 +41,8 @@ if( X_Audio_constructor && !X_Audio_HTMLAudioWrapper_badOperaAndroid ){ //引数なしで new Audio() とすると、Operaでエラーになるそうなので注意。 X_Audio_rawAudio = new X_Audio_constructor( '' ); + // https://html5experts.jp/miyuki-baba/3766/ + // Chrome for Android31 で HE-AAC が低速再生されるバグ if( X_Audio_rawAudio.canPlayType ){ X_Audio_codecs = { 'mp3' : X_Audio_rawAudio.canPlayType('audio/mpeg'), @@ -164,7 +168,7 @@ if( X_Audio_constructor && !X_Audio_HTMLAudioWrapper_badOperaAndroid ){ X_Audio_HTMLAudioWrapper_badOperaAndroid && alert( e.type ); - //console.log( e.type ); + X_Audio_HTMLAudioWrapper_ieMobile9Fix && e.type !== 'timeupdate' && console.log( e.type ); switch( e.type ){ case 'loadstart' : // ブラウザがコンテンツの検索を開始した場合に発生 @@ -264,7 +268,7 @@ if( X_Audio_constructor && !X_Audio_HTMLAudioWrapper_badOperaAndroid ){ if( this.playing ){ end = X_AudioWrapper_getEndTime( this ); now = this.getActualCurrentTime(); - //console.log( end + ' / ' + now ); + console.log( end + ' / ' + now ); if( 0 + end <= 0 + now ){ // なぜか iem9 で必要,,, if( this.autoLoop ){ if( !( this.target[ 'dispatch' ]( X_EVENT_MEDIA_BEFORE_LOOP ) & X_Callback_PREVENT_DEFAULT ) ){ @@ -347,11 +351,11 @@ if( X_Audio_constructor && !X_Audio_HTMLAudioWrapper_badOperaAndroid ){ // もし kill 後に autoplayTimer で呼ばれても、_closed==true なので平気 if( this._closed ) return; - if( !this._loaded /* && !X_Audio_Sprite_inTouchAction */ ){ + if( !this._loaded && !X_Audio_HTMLAudioWrapper_ieMobile9Fix /* && !X_Audio_Sprite_inTouchAction */ ){ this.autoplay = true; return; }; - + if( X_Audio_HTMLAudioWrapper_ieMobile9Fix && this._playForDuration === 0 ){ console.log( 'DurationFix開始 - ' + this[ '_rawObject' ].duration ); this._playForDuration = 1; @@ -377,7 +381,7 @@ if( X_Audio_constructor && !X_Audio_HTMLAudioWrapper_badOperaAndroid ){ X_Timer_once( 0, this, this._fixForChrome ); this[ '_rawObject' ].volume = 0; } else { - this[ '_rawObject' ].volume = this.gain; + this[ '_rawObject' ].volume = X_Audio_HTMLAudioWrapper_ieMobile9Fix ? 1 : this.gain; }; this[ '_rawObject' ].play(); this.playing = true; @@ -438,7 +442,7 @@ if( X_Audio_constructor && !X_Audio_HTMLAudioWrapper_badOperaAndroid ){ this.actualPlay(); } else if( result & 4 ){ - this[ '_rawObject' ].volume = this.gain; + this[ '_rawObject' ].volume = X_Audio_HTMLAudioWrapper_ieMobile9Fix ? 1 : this.gain; }; }