Ticket #1521 (closed bug: fixed)

Opened 19 months ago

Last modified 16 months ago

Player API needs to replace all nested dots in plugin configurations

Reported by: zach Owned by: pablo
Priority: Normal Milestone: Player 5.9
Component: embedding Keywords:
Cc: Forum thread: http://www.longtailvideo.com/support/forums/addons/plugin-google-analytics-pro/23147/video-player-no-longer-tracking-plays

Description

Trying to access the playlist via the getPlaylist() API command of a player with the following configuration fails:

jwplayer(id, video, image).setup({
    'allowscriptaccess': 'always',
    'flashplayer': 'http://player.longtailvidoe.com/player.swf',
    'file': video,
    'image': image,
    'backcolor': '111111',
    'frontcolor': 'cccccc',
    'lightcolor': 'e33100',
    'controlbar': 'bottom',
    'width': '640',
    'height': '430',
    'plugins': {
        'sharing-3': {},
        'gapro-2': {
            'trackstarts': 'true',
            'trackpercentage': 'true',
            'tracktime': 'true',
            'accountid': 'UA-XXXXXX-X'
        },
        'googima': {
            'ad.tag': videoad,
            'ad.position': 'pre',
            'allowvolumeslider': 'true'
        }
    }
});

When GAPro calls jwplayer().getPlaylist(), the first playlist item contains the GoogIMA configuration. Because the GoogIMA config contains dots in it's keys, and because Flash does not correctly pass objects with dots in the keys from ActionScript to JavaScript via ExternalInterface, there is a JavaScript error.

Within the player, this can be remedied by having com.longtailvideo.jwplayer.utils.JavascriptSerialization replace *all* dots on line 68:

var newkey:String = key.replace(".", "__dot__");

It might be necessary to use a secondary variable replacement, as this might interfere with the conversion back to a nested structure in JS.

Change History

comment:1 Changed 16 months ago by pablo

  • Status changed from new to closed
  • Resolution set to fixed

Fixed in [2084]

Note: See TracTickets for help on using tickets.