OSDN Git Service

Version 0.6.218, Fix the bug of X.Net & X.Audio.
[pettanr/clientJs.git] / 0.6.x / js / 07_audio / 03_XSilverlightAudio.js
index ea3dad7..09fa4cd 100644 (file)
@@ -53,7 +53,7 @@ if( X_Plugin_SILVER_LIGHT_VERSION ){
                        _lastState      : '',\r
                        _interval       : 0, // setInterval timer id\r
                        \r
-                       'Constructor' : function( disatcher, source, option ){\r
+                       'Constructor' : function( dispatcher, source, option ){\r
                                !X_SLAudio_uid && X_TEMP.slaudioInit();\r
                                \r
                                /*\r
@@ -61,7 +61,7 @@ if( X_Plugin_SILVER_LIGHT_VERSION ){
                                 * http://www.atmarkit.co.jp/fdotnet/dotnettips/902slobjcallfromjs/slobjcallfromjs.html\r
                                 * このページのサンプルは sl5+firefox32 環境で動いている。xaml を js から利用する形ではなく、.xap を sl4 以下で作るのがよさそう.\r
                                 */\r
-                               this.disatcher   = disatcher || this;\r
+                               this.dispatcher   = dispatcher || this;\r
                                this._source     = source;\r
                                // X.Audio._slOnload_ は不可\r
                        this._onload     = 'XAudioSilverlightOnLoad' + ( ++X_SLAudio_uid );\r
@@ -122,7 +122,7 @@ if( X_Plugin_SILVER_LIGHT_VERSION ){
                                                if( this.playing ){\r
                                                        //X_Timer_once( 16, this, this.actualPlay );\r
                                                } else {\r
-                                                       this.disatcher[ 'dispatch' ]( X_EVENT_ERROR ); // open failed\r
+                                                       this.dispatcher[ 'dispatch' ]( X_EVENT_ERROR ); // open failed\r
                                                        this[ 'kill' ]();                                                       \r
                                                };\r
                                                break;\r
@@ -130,7 +130,7 @@ if( X_Plugin_SILVER_LIGHT_VERSION ){
                                        case 'MediaOpened' :\r
                                                // http://msdn.microsoft.com/ja-jp/library/bb979710(VS.95).aspx\r
                                                this.duration = this[ '_rawObject' ][ 'NaturalDuration' ][ 'Seconds' ] * 1000;\r
-                               this.disatcher[ 'asyncDispatch' ]( X_EVENT_READY );\r
+                               this.dispatcher[ 'asyncDispatch' ]( X_EVENT_READY );\r
                                                break;\r
 \r
                                        case 'MediaEnded' :\r
@@ -157,10 +157,10 @@ if( X_Plugin_SILVER_LIGHT_VERSION ){
                                                        case 'Opening' :\r
                                                                switch( this._lastUserAction ){\r
                                                                        case 'play' :\r
-                                                                               this.disatcher[ 'dispatch' ]( X_EVENT_MEDIA_WAITING );\r
+                                                                               this.dispatcher[ 'dispatch' ]( X_EVENT_MEDIA_WAITING );\r
                                                                                break;\r
                                                                        case 'seek' :\r
-                                                                               this.disatcher[ 'dispatch' ]( X_EVENT_MEDIA_SEEKING );\r
+                                                                               this.dispatcher[ 'dispatch' ]( X_EVENT_MEDIA_SEEKING );\r
                                                                                break;\r
                                                                        case 'pause' :\r
                                                                                break;\r
@@ -177,7 +177,7 @@ if( X_Plugin_SILVER_LIGHT_VERSION ){
                                                                this.playing = false;\r
                                                                this._ended  = true;\r
                                                                this._paused = false;\r
-                                                               this.disatcher[ 'dispatch' ]( X_EVENT_ERROR );\r
+                                                               this.dispatcher[ 'dispatch' ]( X_EVENT_ERROR );\r
                                                                this[ 'kill' ]();\r
                                                                break;\r
 \r
@@ -195,7 +195,7 @@ if( X_Plugin_SILVER_LIGHT_VERSION ){
                                                                                //this.seekTime = 0;\r
                                                                                this._ended  = true;\r
                                                                                this._paused = false;\r
-                                                                               //this.disatcher[ 'dispatch' ]( X_EVENT_MEDIA_ENDED );\r
+                                                                               //this.dispatcher[ 'dispatch' ]( X_EVENT_MEDIA_ENDED );\r
                                                                                //this.setCurrentTime( this.startTime );\r
                                                                                break;\r
                                                                        case 'pause':\r
@@ -214,7 +214,7 @@ if( X_Plugin_SILVER_LIGHT_VERSION ){
                                                                //this.playing = true;\r
                                                                this._ended  = false;\r
                                                                this._paused = false;\r
-                                                               this.disatcher[ 'dispatch' ]( X_EVENT_MEDIA_PLAYING );\r
+                                                               this.dispatcher[ 'dispatch' ]( X_EVENT_MEDIA_PLAYING );\r
                                                                break;\r
 \r
                                                        // stop()\r
@@ -230,7 +230,7 @@ if( X_Plugin_SILVER_LIGHT_VERSION ){
                                                break;\r
 \r
                                        case X_EVENT_KILL_INSTANCE :\r
-                                               this.playing && this.disatcher[ 'dispatch' ]( X_EVENT_MEDIA_ENDED );\r
+                                               this.playing && this.dispatcher[ 'dispatch' ]( X_EVENT_MEDIA_ENDED );\r
                                                this.playing && this.actualPause();\r
                                        \r
                                                if( this._onload ){\r
@@ -297,7 +297,7 @@ if( X_Plugin_SILVER_LIGHT_VERSION ){
                                                delete this._interval;\r
                                                return X_CALLBACK_UN_LISTEN;\r
                                        };\r
-                                       this.disatcher[ 'dispatch' ]( X_EVENT_MEDIA_PLAYING );\r
+                                       this.dispatcher[ 'dispatch' ]( X_EVENT_MEDIA_PLAYING );\r
                                },\r
                                \r
                                _onEnded : function(){\r
@@ -315,7 +315,7 @@ if( X_Plugin_SILVER_LIGHT_VERSION ){
                                        console.log( '    > ' + time );\r
                                        this._ended && this[ '_rawObject' ].play();\r
                                        this._ended = false;\r
-                                       this.disatcher[ 'dispatch' ]( X_EVENT_MEDIA_WAITING );\r
+                                       this.dispatcher[ 'dispatch' ]( X_EVENT_MEDIA_WAITING );\r
                                        this._timerID = X_Timer_once( X_Audio_getEndTime( this ) - time, this, this._onEnded );\r
                                        return;\r
                                };\r
@@ -331,16 +331,16 @@ if( X_Plugin_SILVER_LIGHT_VERSION ){
                                \r
                                if( this.autoLoop ){\r
                                        console.log( '========= loop?' );\r
-                                       if( !( this.disatcher[ 'dispatch' ]( X_EVENT_MEDIA_BEFORE_LOOP ) & X_CALLBACK_PREVENT_DEFAULT ) ){\r
+                                       if( !( this.dispatcher[ 'dispatch' ]( X_EVENT_MEDIA_BEFORE_LOOP ) & X_CALLBACK_PREVENT_DEFAULT ) ){\r
                                                console.log( '========== loopした' );\r
                                                this.looped = true;\r
-                                               this.disatcher[ 'dispatch' ]( X_EVENT_MEDIA_LOOPED );\r
+                                               this.dispatcher[ 'dispatch' ]( X_EVENT_MEDIA_LOOPED );\r
                                                this.actualPlay();\r
                                        };\r
                                } else {\r
                                        console.log( '========= pause' );\r
                                        this.actualPause();\r
-                                       this.disatcher[ 'dispatch' ]( X_EVENT_MEDIA_ENDED );\r
+                                       this.dispatcher[ 'dispatch' ]( X_EVENT_MEDIA_ENDED );\r
                                };\r
                            };\r
                                },\r