• i’m using Kimili Flash Embed (could be any other) and Jw Player,
    and realized Swfobject was being double loaded

    is there a way, other than core editing, to halt JW Player from loading Swfobject?

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author JW Player

    (@longtail-video)

    @brasofilo,

    Unfortunately there isn’t a way to do so without editing the source. I can look into adding an option to turn it off in a future version.

    Sorry for the inconvenience.

    Thread Starter brasofilo

    (@brasofilo)

    gee, LongTail Video

    it’s just a little issue
    for this great tool of yours, editing the core or having double swfobject are secondary details…

    thanks for stoping by

    There is a very simple fix for the swfobject duplicity which all solves the query parameter issue and also improves caching and YSlow/PageSpeed score:
    The end result will be a single javascript with no url query parameter and no SSL mismatches.

    in jw-player-plugin-for-wordpress the file jwplayermodule.php
    replace line
    wp_enqueue_script("google-swfobject", "http://ajax.googleapis.com/ajax/libs/swfobject/2.2/swfobject.js");

    with:

    wp_deregister_script( 'swfobject' );
    wp_register_script( 'swfobject', 'http' . (is_ssl() ? 's' : '') . '://ajax.googleapis.com/ajax/libs/swfobject/2.2/swfobject.js',NULL,NULL);
    wp_enqueue_script( 'swfobject' );

    *the second null parameter remove the url query parameter and improves caching and score

    then ,in kimili-flash-embed the file kml_flashembed.php

    this block of code (lines 86 to 90):

    if ( get_option('kml_flashembed_swfobject_source') == '0' ) {
    	wp_register_script( 'swfobject', 'http' . (is_ssl() ? 's' : '') . '://ajax.googleapis.com/ajax/libs/swfobject/2.2/swfobject.js', array(), '2.2' );
    } else {
    	wp_register_script( 'swfobject', plugins_url('/kimili-flash-embed/js/swfobject.js'), array(), '2.2' );
    }

    becomes:

    if ( get_option('kml_flashembed_swfobject_source') == '0' ) {
    	wp_deregister_script( 'swfobject' );
    	wp_register_script( 'swfobject', 'http' . (is_ssl() ? 's' : '') . '://ajax.googleapis.com/ajax/libs/swfobject/2.2/swfobject.js', array(), NULL );
    } else {
    	wp_register_script( 'swfobject', plugins_url('/kimili-flash-embed/js/swfobject.js'), array(), NULL );
    }

    cheers,
    Sandro Bilbeisi

    Plugin Author JW Player

    (@longtail-video)

    Hi Sandro,

    Thanks for your investigation. I’m working on another quick patch and will include your suggestion.

    Thanks.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘[Plugin: JW Player Plugin for WordPress] Swfobject duplicity’ is closed to new replies.