X-Git-Url: http://git.osdn.jp/view?a=blobdiff_plain;f=0.6.x%2Fjs%2F07_audio%2F03_XSilverlightAudio.js;h=d6b41e49770ebdf0c234e3959132ba1d3486a954;hb=512e08f4d38eab417f9651277e8a50c08535cb07;hp=aa90277add47dab1f3eb810f3e99ab20300bd672;hpb=ada5c01a35945aced14a0f6b159035cf76668670;p=pettanr%2FclientJs.git diff --git a/0.6.x/js/07_audio/03_XSilverlightAudio.js b/0.6.x/js/07_audio/03_XSilverlightAudio.js index aa90277..d6b41e4 100644 --- a/0.6.x/js/07_audio/03_XSilverlightAudio.js +++ b/0.6.x/js/07_audio/03_XSilverlightAudio.js @@ -15,7 +15,7 @@ var X_SLAudio, X_SLAudio_uid = 0; -if( X[ 'Pulgin' ][ 'Silverlight' ] ){ +if( X_Plugin_SILVER_LIGHT_VERSION ){ X_TEMP.slaudioInit = function(){ // @@ -30,7 +30,7 @@ if( X[ 'Pulgin' ][ 'Silverlight' ] ){ s.type = 'text/xaml'; }; - document.getElementsByTagName( 'head' )[ 0 ].appendChild( s ); + X_elmHead.appendChild( s ); s.text = ''; delete X_TEMP.slaudioInit; @@ -131,8 +131,6 @@ if( X[ 'Pulgin' ][ 'Silverlight' ] ){ // http://msdn.microsoft.com/ja-jp/library/bb979710(VS.95).aspx this.duration = this[ '_rawObject' ][ 'NaturalDuration' ][ 'Seconds' ] * 1000; this.disatcher[ 'asyncDispatch' ]( X_EVENT_READY ); - - this.autoplay && X_Timer_once( 16, this, this.actualPlay ); break; case 'MediaEnded' : @@ -253,7 +251,7 @@ if( X[ 'Pulgin' ][ 'Silverlight' ] ){ // もし kill 後に autoplayTimer で呼ばれても、_closed==true なので平気 if( this.error ) return; if( !this.duration ){ - this.autoplay = true; + this._playReserved = true; return; }; @@ -323,7 +321,7 @@ if( X[ 'Pulgin' ][ 'Silverlight' ] ){ }; time -= X_Audio_getEndTime( this ); - if( time < 0 ){ + if( time < -50 ){ console.log( ' > まだ終わらない ' + time ); this._ended && this[ '_rawObject' ].play(); this._ended = false; @@ -349,16 +347,14 @@ if( X[ 'Pulgin' ][ 'Silverlight' ] ){ // SilverlightAudio.pause actualPause : function(){ - if( this.error /* || !this.playing */ ) return; + if( this.error ) return; this._lastUserAction = 'pause'; - this.seekTime = this.getActualCurrentTime(); this.playing = false; this._paused = true; this._ended = false; this[ '_rawObject' ].pause(); - //this.disatcher[ 'dispatch' ]( 'pause' ); }, getActualCurrentTime : function(){ @@ -366,6 +362,8 @@ if( X[ 'Pulgin' ][ 'Silverlight' ] ){ }, afterUpdateState : function( result ){ + var end, halfway; + if( result & 3 ){ // seek this.actualPlay(); } else @@ -409,12 +407,15 @@ if( X[ 'Pulgin' ][ 'Silverlight' ] ){ canPlay : { 'mp3' : true, + 'm4a' : true, 'wma' : true, 'wav' : true }, detect : function( proxy, source, ext ){ - proxy[ 'asyncDispatch' ]( { type : X_EVENT_COMPLETE, canPlay : ext === 'mp3' || ext === 'wma' || ext === 'wav' } ); + // TODO source = .mp3#CBR + // 得意度で返す + proxy[ 'asyncDispatch' ]( { type : X_EVENT_COMPLETE, canPlay : ext === 'mp3' || ext === 'm4a' || ext === 'wma' || ext === 'wav' } ); }, klass : X_SLAudio