• Thanks for the great WordPress plugin.

    To “force” the standard version of Shadowbox (3.0.1) to play mp4 video in Flash — I had to edit the shadowbox.js and change the “flv” and “qt” file definitions. And it worked fine.

    I have done the same to your “flv.js” and “qt.js” “Players” files — but mp4 files are still being played by QT. Is there a workaround for this?

    Thanks very much.

Viewing 10 replies - 1 through 10 (of 10 total)
  • Plugin Author Matt Martz

    (@sivel)

    If you simply must modify the plugin in this matter you will need to delete the cached shadowbox-js from wp-content/uploads/shadowbox-js, it is safe to delete all files in this directory, then go to Settings->Shadowbox JS and click save changes.

    The better option is to follow the FAQ at https://www.ads-software.com/extend/plugins/shadowbox-js/faq/

    The items of interest are:

    “How can I use a custom Shadowbox skin without having to worry about it being deleted during the upgrade process?”

    “How can I use my own custom shadowbox.js?”

    The other option is that you do not rely on the plugin to add the rel attribute to the links and you do it yourself, which you should be doing with videos anyway to provide the proper sizing, and specify player=flv, such as:

    <a href="https://example.org/video.mp4" rel="shadowbox;height=768;width=1024;player=flv;">My MP4</a>

    Thread Starter blafarm

    (@blafarm)

    Thank you very much for that comprehensive response. The “player=flv” is perfect for my application. That’s great.

    Quick follow-up question:

    How would one go about launching a JW Player with a playlist? For example, how would you define and pass the following JW Player parameters:

    skin=”https://mydomain.com/myskin.zip&#8221;
    playlistfile=”https://mydomain.com/myplaylist.xml&#8221;
    playlistsize=”390″
    playlist=”right”

    Thanks very much for your assistance.

    Thread Starter blafarm

    (@blafarm)

    Hi Matt,

    I don’t want to appear impatient — especially after you so kindly (and comprehensively) answered my first question …

    But is there a way to pass JW Player parameters as listed above?

    Thanks again — and apologies for my eagerness.

    Plugin Author Matt Martz

    (@sivel)

    Assuming they can be passed as flashVars, you can use the options configuration per link. You can find that information upstream at:

    https://shadowbox-js.com/usage.html
    https://shadowbox-js.com/options.html

    Thread Starter blafarm

    (@blafarm)

    Thanks very much for your post.

    My principle goal has been to incorporate links in WordPress/Gravity Form entries that spawn JW Players with Playlists — within Shadowbox.

    I’ve tried a number of variations of the following syntax — but none work:

    a href=”MY_VIDEO” rel=”shadowbox;width=600;height=400″; options={flashVars:{controlbar:’over’}}>My Video</a

    I have just been told that Michael removed the ability to specify options in the REL attribute as of February 1, 2010 — to avoid the possibility of abuse via javascript’s eval function.

    I’ve also just been informed that version 3.0.1 is the last build that supported that function. I’ve downloaded that version from github — but I have no idea if, or how, to implement it with your excellent plugin. I just don’t have the chops to know what to do.

    At this point, I’d be very willing to pay a consulting fee to get it done (assuming it’s possible). If this sounds like something you might be interested in — please let me know and I could contact you via your github info (if that were appropriate).

    If not, I would understand completely — and I would thank you very much for the excellent support you have provided.

    Either way — thanks again.

    Plugin Author Matt Martz

    (@sivel)

    I just built version 3.0.1 for you, you can download it from: https://cdn.sivel.net/s/h/shadowbox-3.0.1.min.js

    Download this and place in your active themes directory, ex: wp-content/themes/twentyten

    Then open your themes functions.php and add something similar to the following:

    add_filter('shadowbox-js', 'custom_shadowbox');
    function custom_shadowbox($url) {
        return get_bloginfo('stylesheet_directory') . '/shadowbox-3.0.1.min.js';
    }

    BTW, here are the steps that I took to build this, and note that it requires that you have rake installed. Also these are from a linux box:

    wget -O shadowbox-3.0.1.tgz https://github.com/mjijackson/shadowbox/tarball/v3.0.1
    tar xzvf shadowbox-3.0.1.tgz
    cd mjijackson-shadowbox-*
    rake

    You will then find shadowbox.js inside of the build directory. If you want shadowbox.js compressed you will need to edit build.yml and change compress: NO to compress: YES before running rake.

    Now if you visit Settings->Shadowbox JS you should see a “warning” that you are overriding the shadowbox.js file. This will then allow you to load shadowbox 3.0.1

    Please let me know after you have downloaded the 3.0.1 file, so that I can delete it. I wouldn’t want someone to leach my bandwidth loading it directly from my site ??

    Thread Starter blafarm

    (@blafarm)

    Matt; Thanks so much for that custom version. I have downloaded it — so you can delete it now.

    I’ve been testing for the past couple of hours — and I think I have followed your directions correctly.

    1. I copied your js file to the twentyten root directory

    2. I inserted the code you supplied (verbatim) into twentyten’s functions.php (although I’m not sure if the code needed to be customized — or where exactly it should have been inserted).

    3. Basic Shadowbox functionality works. QT is launched by an .mp4 file unless I use “player=flv” (no surprise). But, when I use “player=flv” in the link — Shadowbox launches without a JW Player in it.

    4. Not knowing what to do — I copied my player.swf into the theme’s root directory — but that (predictably) did nothing to solve the problem.

    5. So, I haven’t even been able to test whether or not flashVar work.

    I am unfortunately a novice …
    Which was the reasoning behind my “consulting” suggestion.
    However, I do have a couple of questions which might help me out of the maze I am in:

    a) Can I use the exact code you supplied in your post — verbatim? Or do any parts of that code need to be customized for my specific installation?

    b) Does the code you supplied need to be pasted in any specific location within my theme’s functions.php — or pasted using additional syntax that I might not be aware of?

    c) The snippet on Michael’s website is a bit different from yours. Is there a chance that I am missing something that is necessary for this to work? https://www.ads-software.com/extend/plugins/shadowbox-js/faq/

    d) Do I need to install my player.swf in a specific location — or do I need to “point” to it — in some way?

    If you can think of anything else that I might be doing wrong — please let me know. Sorry that I’m not better informed.

    Thanks very much for your help.

    Thread Starter blafarm

    (@blafarm)

    Quick update:

    Remembering that older versions of Shadowbox wanted the JW Player swf to actually reside in a “libraries” > “mediaplayer” directory — I tried that approach — but no dice.

    Plugin Author Matt Martz

    (@sivel)

    From memory I believe that player.swf needs to reside in the same directory/path as shadowbox.js. But looking at the code a little more, try renaming shadowbox-3.0.1.min.js to shadowbox.js and change the code that you put into functions.php to reflect this rename.

    Thread Starter blafarm

    (@blafarm)

    Hi Matt,

    Thanks for your prompt reply.

    Yes, I followed your directions and it works — JW Player is now loading in Shadowbox. Kudos!!!

    Unfortunately, on the downside, flashVars are not being passed to JW Player.

    Do you see anything wrong with this syntax?

    a href=”MY_Video” rel=”shadowbox;width=600;height=400;player=flv;options={flashVars:{controlbar:’over’}}”>My Video</a

    Thanks very much for your continued assistance.

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘[Plugin: Shadowbox JS] Forcing Flash to play .mp4 files’ is closed to new replies.