Thanks for posting! Before your post I had never heard of another good FLV player besides the JW FLV player. It's funny that I didn't find it because I had actually been looking for one. The JW FLV player is licensed such that I cannot include it in the Shadowbox distribution. However, the nonverblaster player looks like a great alternative. I'm going to look into this further and see if it would make a good permanent replacement for the JW FLV player.
I'd like some input from others on this issue as well. How tied is everyone to the JW FLV player?
Thank you so much for your quick response. And thank you for developing what I consider to be the most stylish lightbox type code out there. Trust me I have looked at them all. =) And I am super excited you are going to consider including it. I emailed the chap who developed it and he a pretty cool guy as well.
Nonverblaster suits me best for flv, so much so that I currently use it in shadowbox via the iframe method. Please include it, or please could you publish any hints on diy including a different player.
Flowplayer would actually be much simpler to implement than the current JW media player. It looks like Shadowbox currently generates an object tag with a bunch of parameters for the JW media player. Flowplayer would just require an anchor tag with an id and an href to the video. It takes care of generating its own Flash object tags.
I would suggest that a good way to allow shadowbox to work with any Flash video player would be to generate just an anchor tag with an id and href and then leave it up to either the video player itself or the use of something like swfobject to generate the Flash object tags.
Actually, now that I look at the Shadowbox source, it is doing most of what it needs to already. The element that gets replaced is a div instead of an anchor, but it is being replaced by an swf replacement script:
So if an option is added for a boolean of whether or not to run the part above, the div becomes an anchor, and an href is added, it should allow Flowplayer or any other video player to be substituted easily.
Ok, that won't actually work now that I've tried it. It looks like the element needs to exist before the Flowplayer function is called. There is a solution, it's just less convenient. It involves replacing this:
The above changes work if you just want to hack Shadowbox to make it work. The trick is finding the spot in the minified code to make the changes. This is using version 3.0.2. I would suggest searching for 'jw' as it's all pretty close to where that shows up. Look for this shortly after the jw stuff:
Change the "div" to "a". Immediately after that line add:
Where the path-to-flowplayer is the actual path to where the flowplayer swf lives on your server. That is just the standard flowplayer instantiation call, so look at the flowplayer documentation for further info on how to modify that. You will want to also make sure that the flowplayer js file is added to the page.
I had my programmer have a look into this and he came up with a simpler solution.
This is what he wrote about it:
Step 1: Replace the player.swf in the shadowbox directory. Also move flowplayer.controls-x.x.x.swf to the shadowbox directory.
By default Flowplayer looks for the controls swf to overlay onto the video.
Step 2: Initialise Shadowbox
You can pass any of the configuration options that Flowplayer accepts
Step 3: Rejoice! No need to hack shadowbox.js, uses a free and very good Flash video player.
I use Flowplayer in other contexts besides Shadowbox, so shuffling the files around is less than ideal in my case. Changing a couple lines in Shadowbox itself causes significantly fewer headaches as a result.
It looks like nonverblaster would be easiest to implement using three ams solution. Just rename NonverBlaster.swf and replace player.swf. It uses swfobject normally anyway, so it shouldn't have any problems in Shadowbox.