Changeset 1214


Ignore:
Timestamp:
08/18/10 10:40:46 (3 years ago)
Author:
pablo
Message:

Updating new JavaScript API to use "jw" prefix. This is necessary for IE compatibility, since "play()" and "stop()" are not valid ExternalInterface callback names for the ActiveX Flash plugin.

Location:
trunk/fl5
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/fl5/doc/publishers/javascriptapi.rst

    r1135 r1214  
    119119   Currently active bitrate level, in case multipe bitrates are supplied to the player. This is only useful for  :ref:`httpstreaming` and :ref:`rtmpstreaming`. Note that *0* always refers to the highest quality bitrate. 
    120120 
    121 .. describe:: position 
    122  
    123    current playback position, in seconds (e.g. *13.2*). 
    124  
    125121.. describe:: state 
    126122 
     
    192188 
    193189 
    194 .. describe:: item ( index:Number ) 
     190.. describe:: ITEM ( index:Number ) 
    195191 
    196192   Start playback of a specific item in the playlist. If *index* isn't set, the current playlistitem will start. 
    197193 
    198 .. describe:: link ( index:Number ) 
     194.. describe:: LINK ( index:Number ) 
    199195 
    200196   Navigate to the *link* of a specific item in the playlist. If *index* is not set, the player will navigate to the link of the current playlistitem. 
    201197 
    202 .. describe:: load ( url:String ) 
     198.. describe:: LOAD ( url:String ) 
    203199 
    204200   Load a new media file or playlist into the player. The *url* must always be sent. 
    205201 
    206 .. describe:: mute ( state:Boolean ) 
     202.. describe:: MUTE ( state:Boolean ) 
    207203 
    208204   Mute or unmute the player's sound. If the *state* is not set, muting will be toggled. 
    209205 
    210 .. describe:: next 
     206.. describe:: NEXT 
    211207 
    212208   Jump to the next entry in the playlist.  No parameters. 
    213209 
    214 .. describe:: play ( state:Boolean ) 
     210.. describe:: PLAY ( state:Boolean ) 
    215211 
    216212   Play (set *state* to *true*) or pause (set *state* to *false*) playback. If the *state* is not set, the player will toggle playback. 
    217213 
    218 .. describe:: prev 
     214.. describe:: PREV 
    219215 
    220216   Jump to the previous entry in the playlist.  No parameters. 
    221217 
    222 .. describe:: seek ( position:Number ) 
     218.. describe:: SEEK ( position:Number ) 
    223219 
    224220   Seek to a certain position in the currently playing media file. The *position* must be in seconds (e.g. *65* for one minute and five seconds).  
     
    228224      Seeking does not work if the player is in the *IDLE* state. Make sure to check the *state* variable before attempting to seek. Additionally, for the *video* media :ref:`provider <mediaformats>`, the player can only seek to portions of the video that are already loaded. Other media providers do not have this additional restriction. 
    229225 
    230 .. describe:: stop 
     226.. describe:: STOP 
    231227 
    232228   Stop playback of the current playlist entry and unload it. The player will revert to the *IDLE* state and the poster image will be shown. No parameters. 
    233229 
    234 .. describe:: volume ( percentage:Number ) 
     230.. describe:: VOLUME ( percentage:Number ) 
    235231 
    236232   Change the audio volume of the player to a certain percentage (e.g. *90*). If the player is muted, it will automatically be unmuted when a volume event is sent. 
     
    243239----------------- 
    244240 
    245 In order to let JavaScript respond to player updates, you can assign listener functions to various events the player fires. An example of such event is the *volume* one, when the volume of the player is changed. The player will call the listener function with one parameter, a *key:value* populated object that contains more info about the event. 
     241In order to let JavaScript respond to player updates, you can assign listener functions to various events the player fires. An example of such event is the *VOLUME* event, when the volume of the player is changed. The player will call the listener function with one parameter, a *key:value* populated object that contains more info about the event. 
    246242 
    247243In the naming of the listener functions, the internal architecture of the JW Player sines through a little. Internally, the player is built using a Mode-View-Controller design pattern: 
     
    258254      alert('the playback state is changed from '+obj.oldstate+' to '+obj.newstate); 
    259255   }; 
    260    player.addModelListener("state","stateTracker"); 
     256   player.addModelListener("STATE","stateTracker"); 
    261257 
    262258   function volumeTracker(obj) { 
    263259      alert('the audio volume is changed to: '+obj.percentage'+ percent'); 
    264260   }; 
    265    player.addControllerListener("volume","volumeTracker"); 
     261   player.addControllerListener("VOLUME","volumeTracker"); 
    266262 
    267263If you only need to listen to a certain event for a limited amount of time (or just once), use the *removeModelListener()* and removeControllerListener()* functions to unsubscribe your listener function. The syntax is exactly the same: 
     
    269265.. code-block:: html 
    270266 
    271    player.removeModelListener("state","stateTracker"); 
    272    player.removeControllerListener("volume","volumeTracker"); 
     267   player.removeModelListener("STATE","stateTracker"); 
     268   player.removeControllerListener("VOLUME","volumeTracker"); 
    273269 
    274270.. note::  
     
    281277Here's an overview of all events the *Model* sends. Note that the data of every event contains the *id*, *version* and *client* parameters that are also sent on :ref:`playerReady <javascriptapi>`. 
    282278 
    283 .. describe:: error 
     279.. describe:: ERROR 
    284280 
    285281   Fired when a playback error occurs (e.g. when the video is not found or the stream is dropped). Data: 
     
    287283   * *message* ( String ): the error message, e.g. *file not found*  or *no suiteable playback codec found*. 
    288284 
    289 .. describe:: loaded 
    290  
    291    Fired while the player is busy loading the currently playing media item. This event is never sent for :ref:`rtmpstreaming`, since that protocol does not preload content. Data: 
    292  
    293    * *loaded* ( Number ): the number of bytes of the media file that are currently loaded. 
    294    * *total* ( Number ): the total filesize of the media file, in bytes. 
    295    * *offset* (Number): the byte position of the media file at which loading started. This is always 0, except when using :ref:`httpstreaming`. 
    296  
    297 .. describe:: meta 
     285.. describe:: BUFFER 
     286 
     287   Fired when the player loads some media into its buffer. 
     288 
     289   * *percentage* ( Number ): The percentage (0-100) of seconds buffered versus the media's duration.  i.e. if the media is 60 seconds long, and half of the video has been buffered, a buffer event will be fired with percentage=50. 
     290 
     291.. describe:: META 
    298292 
    299293   Fired when metadata on the currently playing media file is received. The exact metadata that is sent with this event varies per individual media file. Here are some examples: 
     
    334328Here's an overview of all events the *Controller* sends. Note that the data of every event contains the *id*, *version* and *client* parameters that are also sent on :ref:`playerReady <javascriptapi>`. 
    335329 
    336 .. describe:: item 
     330.. describe:: ITEM 
    337331 
    338332   Fired when the player switches to a new playlist entry. The new item will immediately start playing. Data: 
     
    340334  * *index* ( Number ): playlist index of the media file that starts playing. 
    341335 
    342 .. describe:: mute 
     336.. describe:: MUTE 
    343337 
    344338   Fired when the player's audio is muted or unmuted. Data: 
     
    346340   * *state* ( Boolean ): the new mute state. If *true*, the player is muted. 
    347341  
    348 .. describe:: play 
     342.. describe:: PLAY 
    349343 
    350344   Fired when the player toggles playback (playing/paused). Data: 
     
    352346   * *state* ( Boolean ): the new playback state. If *true*, the player plays. If *false*, the player pauses. 
    353347 
    354 .. describe:: playlist 
     348.. describe:: PLAYLIST 
    355349 
    356350   Fired when a new playlist (a single file is also pushed as a playlist!) has been loaded into the player. Data: 
     
    358352   * *playlist* ( Array ): The new playlist. It has exactly the same structure as the return of the *getPlaylist()* call. 
    359353 
    360 .. describe:: resize 
     354.. describe:: RESIZE 
    361355 
    362356   Fired when the player is resized. This includes entering/leaving fullscreen mode. Data: 
     
    366360   * *width* ( Number ): The overall width of the player. 
    367361 
    368 .. describe:: seek 
     362.. describe:: SEEK 
    369363 
    370364   Fired when the player is seeking to a new position in the video/sound/image. Parameters: 
     
    372366   * *position* ( Number ): the new position in the file, in seconds (e.g. *150* for two and a half minute). 
    373367 
    374 .. describe:: stop 
     368.. describe:: STOP 
    375369 
    376370   Fired when the player stops loading and playing. The playback state will turn to *IDLE* and the position of a video will be set to 0. No data. 
    377371 
    378 .. describe:: volume 
     372.. describe:: VOLUME 
    379373 
    380374   Fired when the volume level is changed. Data: 
  • trunk/fl5/src/com/longtailvideo/jwplayer/events/MediaEvent.as

    r960 r1214  
    163163                public var bufferPercent:Number         = -1; 
    164164                public var duration:Number                      = -1; 
    165                 public var metadata:Object                      = {}; 
     165                public var metadata:Object                      = null; 
    166166                public var position:Number                      = -1; 
    167167                public var offset:Number                        = 0; 
  • trunk/fl5/src/com/longtailvideo/jwplayer/player/JavascriptAPI.as

    r1207 r1214  
    3333                 
    3434                /** Delay the response to PlayerReady to allow the external interface to initialize in some browsers **/ 
    35                 private function playerReady(evt:PlayerEvent):void { 
     35                protected function playerReady(evt:PlayerEvent):void { 
    3636                        var timer:Timer = new Timer(50, 1); 
    3737                        timer.addEventListener(TimerEvent.TIMER_COMPLETE, function(timerEvent:TimerEvent):void { 
     
    7474                        try { 
    7575                                // Event handlers 
    76                                 ExternalInterface.addCallback("addEventListener", js_addEventListener); 
    77                                 ExternalInterface.addCallback("removeEventListener", js_removeEventListener); 
     76                                ExternalInterface.addCallback("jwAddEventListener", js_addEventListener); 
     77                                ExternalInterface.addCallback("jwRemoveEventListener", js_removeEventListener); 
    7878                                 
    7979                                // Getters 
    80                                 ExternalInterface.addCallback("getBandwidth", js_getBandwidth); 
    81                                 ExternalInterface.addCallback("getBuffer", js_getBuffer); 
    82                                 ExternalInterface.addCallback("getDuration", js_getDuration); 
    83                                 ExternalInterface.addCallback("getFullscreen", js_getFullscreen); 
    84                                 ExternalInterface.addCallback("getHeight", js_getHeight); 
    85                                 ExternalInterface.addCallback("getLevel", js_getLevel); 
    86                                 ExternalInterface.addCallback("getLockState", js_getLockState); 
    87                                 ExternalInterface.addCallback("getMute", js_getMute); 
    88 //                              ExternalInterface.addCallback("getPlaylist", js_getPlaylist); // This is handled by the compatibility API 
    89                                 ExternalInterface.addCallback("getPosition", js_getPosition); 
    90                                 ExternalInterface.addCallback("getState", js_getState); 
    91                                 ExternalInterface.addCallback("getWidth", js_getWidth); 
    92                                 ExternalInterface.addCallback("getVersion", js_getVersion); 
    93                                 ExternalInterface.addCallback("getVolume", js_getVolume); 
     80                                ExternalInterface.addCallback("jwGetBandwidth", js_getBandwidth); 
     81                                ExternalInterface.addCallback("jwGetBuffer", js_getBuffer); 
     82                                ExternalInterface.addCallback("jwGetDuration", js_getDuration); 
     83                                ExternalInterface.addCallback("jwGetFullscreen", js_getFullscreen); 
     84                                ExternalInterface.addCallback("jwGetHeight", js_getHeight); 
     85                                ExternalInterface.addCallback("jwGetLevel", js_getLevel); 
     86                                ExternalInterface.addCallback("jwGetLockState", js_getLockState); 
     87                                ExternalInterface.addCallback("jwGetMute", js_getMute); 
     88                                ExternalInterface.addCallback("jwGetPlaylist", js_getPlaylist); 
     89                                ExternalInterface.addCallback("jwGetPosition", js_getPosition); 
     90                                ExternalInterface.addCallback("jwGetState", js_getState); 
     91                                ExternalInterface.addCallback("jwGetWidth", js_getWidth); 
     92                                ExternalInterface.addCallback("jwGetVersion", js_getVersion); 
     93                                ExternalInterface.addCallback("jwGetVolume", js_getVolume); 
    9494 
    9595                                // Player API Calls 
    96                                 ExternalInterface.addCallback("play", js_play); 
    97                                 ExternalInterface.addCallback("pause", js_pause); 
    98                                 ExternalInterface.addCallback("stop", js_stop); 
    99                                 ExternalInterface.addCallback("seek", js_seek); 
    100                                 ExternalInterface.addCallback("load", js_load); 
    101                                 ExternalInterface.addCallback("playlistItem", js_playlistItem); 
    102                                 ExternalInterface.addCallback("playlistNext", js_playlistNext); 
    103                                 ExternalInterface.addCallback("playlistPrev", js_playlistPrev); 
    104                                 ExternalInterface.addCallback("mute", js_mute); 
    105                                 ExternalInterface.addCallback("volume", js_volume); 
     96                                ExternalInterface.addCallback("jwPlay", js_play); 
     97                                ExternalInterface.addCallback("jwPause", js_pause); 
     98                                ExternalInterface.addCallback("jwStop", js_stop); 
     99                                ExternalInterface.addCallback("jwSeek", js_seek); 
     100                                ExternalInterface.addCallback("jwLoad", js_load); 
     101                                ExternalInterface.addCallback("jwPlaylistItem", js_playlistItem); 
     102                                ExternalInterface.addCallback("jwPlaylistNext", js_playlistNext); 
     103                                ExternalInterface.addCallback("jwPlaylistPrev", js_playlistPrev); 
     104                                ExternalInterface.addCallback("jwMute", js_mute); 
     105                                ExternalInterface.addCallback("jwVolume", js_volume); 
    106106                                 
    107107                                 
     
    117117                 ***********************************************/ 
    118118                 
    119                 private function js_addEventListener(eventType:String, callback:String):void { 
     119                protected function js_addEventListener(eventType:String, callback:String):void { 
    120120                        if (!_listeners[eventType]) { 
    121121                                _listeners[eventType] = []; 
     
    125125                } 
    126126                 
    127                 private function js_removeEventListener(eventType:String, callback:String):void { 
     127                protected function js_removeEventListener(eventType:String, callback:String):void { 
    128128                        var callbacks:Array = _listeners[eventType]; 
    129129                        if (callbacks) { 
     
    137137                 
    138138                 
    139                 private function listenerCallback(evt:PlayerEvent):void { 
     139                protected function listenerCallback(evt:PlayerEvent):void { 
    140140                        var args:Object; 
    141141                         
    142142                        if (evt is MediaEvent) 
    143143                                args = listnerCallbackMedia(evt as MediaEvent); 
    144                         else if (evt is PlaylistEvent) 
     144                        else if (evt is PlayerStateEvent) 
    145145                                args = listenerCallbackState(evt as PlayerStateEvent); 
    146146                        else if (evt is ViewEvent && (evt as ViewEvent).data != null) 
     
    157157                } 
    158158                 
    159                 private function merge(obj1:Object, obj2:Object):Object { 
     159                protected function merge(obj1:Object, obj2:Object):Object { 
    160160                        var newObj:Object = {}; 
    161161                         
     
    171171                } 
    172172                 
    173                 private function listnerCallbackMedia(evt:MediaEvent):Object { 
    174                         switch(evt.type) { 
    175                                 case MediaEvent.JWPLAYER_MEDIA_BUFFER: 
    176                                         return { 
    177                                                 bufferPercent:  evt.bufferPercent,       
    178                                                 offset:                 evt.offset, 
    179                                                 duration:               evt.duration, 
    180                                                 position:               evt.position 
    181                                         }; 
    182                                         break; 
    183                                 case MediaEvent.JWPLAYER_MEDIA_TIME: 
    184                                         return { 
    185                                                 offset:                 evt.offset, 
    186                                                 duration:               evt.duration, 
    187                                                 position:               evt.position 
    188                                         }; 
    189                                         break; 
    190                                 case MediaEvent.JWPLAYER_MEDIA_VOLUME: 
    191                                         return { 
    192                                                 volume:                 evt.volume 
    193                                         }; 
    194                                         break; 
    195                                 case MediaEvent.JWPLAYER_MEDIA_MUTE: 
    196                                         return { 
    197                                                 mute:                   evt.mute 
    198                                         }; 
    199                                         break; 
    200                                 case MediaEvent.JWPLAYER_MEDIA_ERROR: 
    201                                         return { 
    202                                                 message:                evt.mute 
    203                                         }; 
    204                                         break; 
    205                                 case MediaEvent.JWPLAYER_MEDIA_META: 
    206                                         Logger.log("got metadata: " + Strings.print_r(evt.metadata)); 
    207                                          
    208                                         return {metadata: evt.metadata}; 
    209                                         break; 
    210                         } 
    211                         return {}; 
    212                 } 
    213                  
    214                  
    215                 private function listenerCallbackState(evt:PlayerStateEvent):Object { 
     173                protected function listnerCallbackMedia(evt:MediaEvent):Object { 
     174                        var returnObj:Object = {}; 
     175 
     176                        if (evt.bufferPercent >= 0)             returnObj.bufferPercent = evt.bufferPercent; 
     177                        if (evt.duration >= 0)                          returnObj.duration = evt.duration; 
     178                        if (evt.message != undefined)           returnObj.message = evt.message; 
     179                        if (evt.metadata != null)                       returnObj.metadata = evt.metadata; 
     180                        if (evt.offset >= 0)                            returnObj.offset = evt.offset; 
     181                        if (evt.position >= 0)                          returnObj.position = evt.position; 
     182 
     183                        if (evt.type == MediaEvent.JWPLAYER_MEDIA_MUTE) 
     184                                returnObj.mute = evt.mute; 
     185                         
     186                        if (evt.type == MediaEvent.JWPLAYER_MEDIA_VOLUME) 
     187                                returnObj.volume = evt.volume; 
     188 
     189                        return returnObj; 
     190                } 
     191                 
     192                 
     193                protected function listenerCallbackState(evt:PlayerStateEvent):Object { 
    216194                         if (evt.type == PlayerStateEvent.JWPLAYER_PLAYER_STATE) { 
    217195                                return { newstate: evt.newstate, oldstate: evt.oldstate }; 
     
    219197                } 
    220198                 
    221  
    222                  
    223199                /*********************************************** 
    224200                 **                 GETTERS                   ** 
    225201                 ***********************************************/ 
    226202                 
    227                 private function js_getBandwidth():Number { 
     203                protected function js_getBandwidth():Number { 
    228204                        return _player.config.bandwidth; 
    229205                } 
    230206 
    231                 private function js_getBuffer():Number { 
     207                protected function js_getBuffer():Number { 
    232208                        return _playerBuffer; 
    233209                } 
    234210                 
    235                 private function js_getDuration():Number { 
     211                protected function js_getDuration():Number { 
    236212                        return _player.playlist.currentItem.duration; 
    237213                } 
    238214                 
    239                 private function js_getFullscreen():Boolean { 
     215                protected function js_getFullscreen():Boolean { 
    240216                        return _player.config.fullscreen; 
    241217                } 
    242218 
    243                 private function js_getHeight():Number { 
     219                protected function js_getHeight():Number { 
    244220                        return _player.config.height; 
    245221                } 
    246222                 
    247                 private function js_getLevel():Number { 
     223                protected function js_getLevel():Number { 
    248224                        return _player.playlist.currentItem.currentLevel; 
    249225                } 
    250226                 
    251                 private function js_getLockState():Boolean { 
     227                protected function js_getLockState():Boolean { 
    252228                        return _player.locked; 
    253229                } 
    254230                 
    255                 private function js_getMute():Boolean { 
     231                protected function js_getMute():Boolean { 
    256232                        return _player.config.mute; 
    257233                } 
    258234                 
    259                 private function js_getPlaylist():Array { 
     235                protected function js_getPlaylist():Array { 
    260236                        return JavascriptSerialization.playlistToArray(_player.playlist); 
    261237                } 
    262238                 
    263                 private function js_getPosition():Number { 
     239                protected function js_getPosition():Number { 
    264240                        return _playerPosition; 
    265241                } 
    266242                 
    267                 private function js_getState():String { 
     243                protected function js_getState():String { 
    268244                        return _player.state; 
    269245                } 
    270246 
    271                 private function js_getWidth():Number { 
     247                protected function js_getWidth():Number { 
    272248                        return _player.config.width; 
    273249                } 
    274250 
    275                 private function js_getVersion():String { 
     251                protected function js_getVersion():String { 
    276252                        return _player.version; 
    277253                } 
    278254 
    279                 private function js_getVolume():Number { 
     255                protected function js_getVolume():Number { 
    280256                        return _player.config.volume; 
    281257                } 
     
    285261                 ***********************************************/ 
    286262         
    287                 private function js_play(playstate:*=null):void { 
     263                protected function js_play(playstate:*=null):void { 
    288264                        if (playstate != null && playstate != "") { 
    289265                                if ((playstate is Boolean && playstate === true) || String(playstate).toLowerCase() == "true") { 
     
    299275                 
    300276                 
    301                 private function js_pause():void { 
     277                protected function js_pause():void { 
    302278                        playToggle(); 
    303279                } 
    304280                 
    305                 private function playToggle():void { 
     281                protected function playToggle():void { 
    306282                        if (_player.state == PlayerState.IDLE || _player.state == PlayerState.PAUSED) { 
    307283                                _player.play(); 
     
    311287                } 
    312288                 
    313                 private function js_stop():void { 
     289                protected function js_stop():void { 
    314290                        _player.stop(); 
    315291                } 
    316292                 
    317                 private function js_seek(position:Number=0):void { 
     293                protected function js_seek(position:Number=0):void { 
    318294                        _player.seek(position); 
    319295                } 
    320296                 
    321                 private function js_load(toLoad:*):void { 
     297                protected function js_load(toLoad:*):void { 
    322298                        _player.load(toLoad); 
    323299                } 
    324300                 
    325                 private function js_playlistItem(item:Number):void { 
     301                protected function js_playlistItem(item:Number):void { 
    326302                        _player.playlistItem(item); 
    327303                } 
    328304 
    329                 private function js_playlistNext():void { 
     305                protected function js_playlistNext():void { 
    330306                        _player.playlistNext(); 
    331307                } 
    332308 
    333                 private function js_playlistPrev():void { 
     309                protected function js_playlistPrev():void { 
    334310                        _player.playlistPrev(); 
    335311                } 
    336312 
    337                 private function js_mute(mutestate:*=null):void { 
     313                protected function js_mute(mutestate:*=null):void { 
    338314                        if (mutestate is Boolean) { 
    339315                                if (Boolean(mutestate)) { 
     
    347323                } 
    348324 
    349                 private function js_volume(volume:Number):void { 
     325                protected function js_volume(volume:Number):void { 
    350326                        _player.volume(volume); 
    351327                } 
  • trunk/fl5/src/com/longtailvideo/jwplayer/player/JavascriptCompatibilityAPI.as

    r1207 r1214  
    55        import com.jeroenwijering.events.ViewEvent; 
    66        import com.longtailvideo.jwplayer.events.PlayerEvent; 
     7        import com.longtailvideo.jwplayer.utils.JavascriptSerialization; 
    78        import com.longtailvideo.jwplayer.utils.Logger; 
    89         
     
    3738                                ExternalInterface.addCallback("removeViewListener",removeJSViewListener); 
    3839                                ExternalInterface.addCallback("getConfig",getConfig); 
    39                                 ExternalInterface.addCallback("getPlaylist",getPlaylist); 
     40                                ExternalInterface.addCallback("getPlaylist",super.js_getPlaylist); 
    4041                                ExternalInterface.addCallback("getPluginConfig",getJSPluginConfig); 
    4142                                ExternalInterface.addCallback("loadPlugin",loadPlugin); 
     
    116117 
    117118                private function getConfig():Object { 
    118                         return stripDots(_emu.config); 
    119                 } 
    120                  
    121                 private function stripDots(obj:Object):Object { 
    122                         var newObj:Object = (obj is Array) ? new Array() : new Object(); 
    123                         for (var i:String in obj) { 
    124                                 if (i.indexOf(".") < 0) { 
    125                                         if (typeof(obj[i]) == "object") { 
    126                                                 newObj[i] = stripDots(obj[i]); 
    127                                         } else { 
    128                                                 newObj[i] = obj[i]; 
    129                                         } 
    130                                 } 
    131                         } 
    132                         return newObj; 
    133                 } 
    134                  
    135                 private function getPlaylist():Object { 
    136                         var arry:Array = []; 
    137                         for each (var obj:Object in _emu.playlist) { 
    138                                 arry.push(stripDots(obj)); 
    139                         } 
    140                         return arry; 
     119                        return JavascriptSerialization.stripDots(_emu.config); 
    141120                } 
    142121                 
     
    157136                                for each (var callback:String in controllerCallbacks[evt.type]) { 
    158137                                        if (ExternalInterface.available) { 
    159                                                 ExternalInterface.call(callback, stripDots(evt.data)); 
     138                                                ExternalInterface.call(callback, JavascriptSerialization.stripDots(evt.data)); 
    160139                                        } 
    161140                                } 
     
    167146                                for each (var callback:String in modelCallbacks[evt.type]) { 
    168147                                        if (ExternalInterface.available) { 
    169                                                 ExternalInterface.call(callback, stripDots(evt.data)); 
     148                                                ExternalInterface.call(callback, JavascriptSerialization.stripDots(evt.data)); 
    170149                                        } 
    171150                                } 
     
    177156                                for each (var callback:String in viewCallbacks[evt.type]) { 
    178157                                        if (ExternalInterface.available) { 
    179                                                 ExternalInterface.call(callback, stripDots(evt.data)); 
     158                                                ExternalInterface.call(callback, JavascriptSerialization.stripDots(evt.data)); 
    180159                                        } 
    181160                                } 
  • trunk/fl5/src/com/longtailvideo/jwplayer/player/PlayerV4Emulation.as

    r1207 r1214  
    234234 
    235235                public override function addModelListener(type:String, listener:Function):void { 
    236                         modelEventDispatcher.addEventListener(type, listener); 
     236                        modelEventDispatcher.addEventListener(type.toUpperCase(), listener); 
    237237                }  
    238238                public override function removeModelListener(type:String, listener:Function):void { 
    239                         modelEventDispatcher.removeEventListener(type, listener); 
     239                        modelEventDispatcher.removeEventListener(type.toUpperCase(), listener); 
    240240                }  
    241241 
    242242                public override function addViewListener(type:String, listener:Function):void { 
    243                         viewEventDispatcher.addEventListener(type, listener); 
     243                        viewEventDispatcher.addEventListener(type.toUpperCase(), listener); 
    244244                }  
    245245                public override function removeViewListener(type:String, listener:Function):void { 
    246                         viewEventDispatcher.removeEventListener(type, listener); 
     246                        viewEventDispatcher.removeEventListener(type.toUpperCase(), listener); 
    247247                }  
    248248 
    249249                public override function addControllerListener(type:String, listener:Function):void { 
    250                         controllerEventDispatcher.addEventListener(type, listener); 
     250                        controllerEventDispatcher.addEventListener(type.toUpperCase(), listener); 
    251251                }  
    252252                public override function removeControllerListener(type:String, listener:Function):void { 
    253                         controllerEventDispatcher.removeEventListener(type, listener); 
     253                        controllerEventDispatcher.removeEventListener(type.toUpperCase(), listener); 
    254254                } 
    255255                 
  • trunk/fl5/src/com/longtailvideo/jwplayer/player/PlayerVersion.as

    r1207 r1214  
    33         
    44        public class PlayerVersion { 
    5                 protected static var _version:String = "5.3.1207"; 
     5                protected static var _version:String = "5.3.1214"; 
    66                 
    77                public static function get version():String { 
  • trunk/fl5/src/com/longtailvideo/jwplayer/utils/JavascriptSerialization.as

    r1207 r1214  
    4747                        } 
    4848                         
    49                         return obj; 
     49                        return stripDots(obj); 
    5050                } 
     51                 
     52                public static function stripDots(obj:Object):Object { 
     53                        var newObj:Object = (obj is Array) ? new Array() : new Object(); 
     54                        for (var i:String in obj) { 
     55                                if (i.indexOf(".") < 0) { 
     56                                        if (typeof(obj[i]) == "object") { 
     57                                                newObj[i] = stripDots(obj[i]); 
     58                                        } else { 
     59                                                newObj[i] = obj[i]; 
     60                                        } 
     61                                } 
     62                        } 
     63                        return newObj; 
     64                } 
     65                 
     66                 
    5167        } 
    5268} 
Note: See TracChangeset for help on using the changeset viewer.