Forgot?

Is it possible to pass parameters to the Flash player...

Reply Topic
Link to this post 29 Dec 11

Hi!
Is it possible to pass parameters to the Flash player component of the Nina Shadowbox Module in Joomla 1.5.25?

Actually, I should say that I successfully did it, but I'm having trouble...

I proved to myself that I could pass a parameter by first passing an autostart "false" and then an autostart "true" parameter using Nina Shadowbox and each time it respected the command. However, I want to add subtitles to a Flash video using an SRT file. SRT files need to have the exact same name of the video and reside in the same folder on the server. OK, got that. but when I pass the parameter it is ignored.

Here is the code:

<a href="http://www.elevenfox.de/modules/mod_ninja_shadowbox/ninja_shadowbox/js/flvplayer.swf?autostart=true&amp;amp;captions.file=http://www.elevenfox.de/media/polysics-each-life-each-end-budokan.srt&amp;amp;file=http://www.elevenfox.de/media/polysics-each-life-each-end-budokan.flv" rel="lightbox;width=624;height=360" title = "POLYSICS - Each Life Each End - LIVE at Budokan">KAYO &nbsp;カヨ</a>

Now. you'll notice in the code that the SRT call is using

captions.file=http://etc...
- I also have tried this using
srt=http://etc...
- but it doesn't work either.

I tried looking in the advanced parameters of the Ninja Shadowbox module, but nothing like this is in there. That is why you see a direct call to the player in the code above which, as proven by the "autostart" parameter does seem to do something. Maybe my syntax is off - wouldn't be the first time...

If anybody has any ideas, tips, or tricks, I'd be very grateful for your assistance.

Thanks in advance,
-RR

Link to this post 29 Dec 11

Hi ruthyruth,

Unfortunately what you want to achieve is not directly possible with Ninja Shadowbox.
First because the flv player used is an old one and doesn't have the the caption as subtitle feature build in.
On the other hand, I'm afraid srt is not supported with flv's but only with mp4's. But that I'm not sure of.

However, the reason we are called Ninja's is to try to find a different approach to make it work because of the challenge, may it be by doing a lot of research, which I did.

Also, your syntax is not right. Notice that you have double &amp; (ampersands) in there. Only one &amp; is enough. Plus you are using lightbox instead of shadowbox in the rel attribute. I would suggest to use shadowbox although using lightbox doesn't do much harm..but..just for the record.

Since you use the old flv player where srt's are not supported, you must have the current JWPlayer / FLV Player installed into the Ninja Shadowbox directory OR you can load the player from a different location which is optional in the advanced settings of Ninja Shadowbox OR just as you did by calling the player directly but then on a standalone base.

Also, the reason it doesn't work is that you have to call the captions plugin in your syntax.
In general your syntax should look like this (compare the differences with yours):

Replace every & with &amp;

<a href="http://www.elevenfox.de/jwplayer/player.swf?autostart=true&amp;
plugins=captions&
captions.file=http://www.elevenfox.de/media/polysics-each-life-each-end-budokan.srt&
file=http://www.elevenfox.de/media/polysics-each-life-each-end-budokan.flv"
title="POLYSICS - Each Life Each End - LIVE at Budokan"
rel="shadowbox;width=624;height=360">KAYO  カヨ</a>

To make it work you need to do the following:

- unzip the attached JWplayer5 and upload the folder to your server.
- call the player directly like you did in your syntax. Make sure the path is correct.
- unzip the attached crossdomain.zip and upload the crossdomain.xml to the root of your joomla dir.

For more detailed useful information I refer to the following website:

http://www.longtailvideo.com/support/addons/captions-plugin/14974/captions-plugin-reference-guide

Note that this is a basic work around, you have to gain more information by yourself to make it work correctly in case things don't work.
I tested it by myself and it worked for me so far.

I hope this helps.
Let us know how it goes.

Kind regards,
John

You don't have access to view the attachments in this post.
Link to this post 30 Dec 11

Sensei John!

You are a true ninja and master of the universe, and I thank you for taking the time and effort to show us mortals the road to redemption!

Your research, tests and instructions helped to get subtitles from an SRT file to work! Excellent.

Of course now I'm being picky because I don't like the skin of the player, but I've been noodling with that and its getting better. Once I get that looking the way I like, I think I will re-assign all the videos on the site to a similar skinned player for visual harmony.

Meanwhile, however, the "full screen" button on the player does not work. I even tried adding a parameter for it, but no response. Considering everything else, I'm lucky the thing plays at all. But that is what I'm working on right now. Otherwise, it's all good.

Question: Why does the Ninja Shadowbox Joomla module not have the latest version of the JW Player? Is the older version more compatible?

Thanks!
-RR

Link to this post 30 Dec 11

Hi RR-san,

Great to hear you were able to get it work. Good job!

Thanks very much for your very kind en pleasant phrases about being a master and such, but I'm just a simple Ninja who can get to the bottom of things (not always but most of the time).
Besides that, using/building (multi)media within websites is my kind of department.
The true Ninja's and Masters are the dev Ninja's here at Ninja Forge, which I'm not.

Honestly, my struggle was the fact that the SRT file that I used wasn't saved as UTF8.
Luckily I found out soon at the LongTailVideo website.

...the "full screen" button on the player does not work...

Hmm...strange. Does work for me.
Try to add this somewhere in the syntax (in case you didn't try this already):

&amp;allowfullscreen=true

Otherwise try to choose the script library "Dojo" within the settings of Ninja Shadowbox, often this will help to avoid script conflicts.

Of course now I'm being picky because I don't like the skin of the player

Try this to call a different skin (note that you have to download a skin first from the LongTailVideo website. Afterwards you have to upload the zip to your Joomla dir and point to it in the syntax):

&amp;skin.file=http://your_domain/joomla_dir/skin_folder/skin.zip

Question: Why does the Ninja Shadowbox Joomla module not have the latest version of the JW Player?

Complicated to explain, I believe this has to do with certain license policy's (especially for the shadowbox script).
On the other hand, any user is free to choose which FLV Player to use. Because it's optional in the Advanced Settings within Ninja Shadowbox. If a user wants a different/better advanced player then the user simply can point to it by using the option. Makes perfect sense to me, you know :)

Well, that would be it. Let us know how you are doing.

Thank you for this nice challenge ;)

Kind regards,
John

Link to this post 04 Jan 12

Hello Sensei John!
Thank you so much for all of your help!

I'm frustrated to say that I'm still stuck.

Here is the code:

<a href="http://www.elevenfox.de/player.swf?autostart=true&amp;amp;allowfullscreen=true&amp;amp;skin=http://www.elevenfox.de/beelden.zip&amp;amp;plugins=captions&amp;amp;captions.file=http://www.elevenfox.de/media/polysics-each-life-each-end-budokan.srt&amp;amp;file=http://www.elevenfox.de/media/polysics-each-life-each-end-budokan.flv" title="POLYSICS - Each Life Each End - LIVE at Budokan" rel="shadowbox;width=624;height=360"><h1><font color="yellow"><i>KAYO &nbsp;カヨ</i></font></h1></a>

I also do not like the regular JW Player skin, so I changed that, and that part works...well, more or less. The skin changes to the new package, BUT IF you click the full screen button nothing happens, AND as soon as you "MouseOut" of the video window the bottom control surface disappears, which in itself is OK, but instead of being replaced by a blank bar the same color as the rest of the skin, it just goes full on white. This phenomenon does not occur if you click anything else on the control surface. This has been true with three different 2.0 and 1.0 versions of alternative skins I've tried (1.0 skins are little more difficult because they have to be unzipped etc, - but other than the convenience of a single file, the 2.0 ZIP versions behave the same)

An OLD issue: The other thing is the full screen option. I tried changing the script library in the Ninja component to DOJO, but no change in the behavior - or lack thereof. (I also tried trashing all of my cache - but that made no difference. I checked the code on the page reloads and observed that the new library was being referenced).

I also tried the other script libraries, but the only change I observed was by using the ProtoType and YUI sets. In the case of these libraries mousing-out of the video window causes the control surface to be replaced by a black bar instead of a white bar. None of the libraries solved the full screen problem.

If you want to experience the situation directly, look on this page:

http://www.elevenfox.de/index.php?option=com_content&view=article&id=14&Itemid=18&lang=en

Click on the name "KAYO" in yellow above the woman's photo to invoke the problem link. If you are able to go full screen, or/and the control surface behaves normally, then it must be something specific to my system. The Dojo library is currently loaded.

I tested everything on IE(7), FF(3 and 6) and Safari(3)

I'm guessing maybe there is a variable name conflict somewhere. Joomla reports all green lights on the server's PHP5 settings.

As always, and ideas or thoughts you might have are sincerely appreciated.

Thanks!
-RR

Link to this post 05 Jan 12

ruthyruth-san

Like I said...Quit a nice challenge you've got here :)

Although it's not exactly the way Ninja Shadowbox is expected to work.
Good job on the skin, though. Just keep using the zips because that will be the most effective way since you are using the latest JWPlayer.

The problem is the way you combine Ninja Shadowbox with calling directly the FLV player and it's parameters.
Other needed internal scripts, parameters, commands are by-passed this way.

Now, some of the parameters for the FLV player which are called directly within the syntax, will do their job but some are hardcoded in the internal scripts from Ninja Shadowbox. I tried to find a way to modify it for you but that could be conflicting when you use Ninja Shadowbox for other purposes.

But since I love Ninja Shadowbox and it's way you can play around with stuff, I like it to approach things in another way. There are more ways that lead to Rome, you know.

One important thing is that the JWPlayer makes use of FlashVars.
These are simply parameters needed to pass to the FLV player to make it fully functional.
Some of these FlashVars are hardcoded, and some are not, within Ninja Shadowbox.
FlashVars are components of the Adobe Flash Player, which you have to install locally in order to be able to watch Flash based movies (FLV, SWF, etc).

So, this is something that can't be controlled by Ninja Shadowbox nor by the JWPlayer. They only make use of it by passing the needed parameters.

Normally, if you use the JWPlayer as a standalone player you can pass parameters all you like.
But that will only work properly if you make use of the <object> and <embed> HTML tags.
Or in other cases you can use javascript to embed Flash movies in a website page.
But, using it with shadowbox is yet to discover how.

Since I'm a fan of Ninja Shadowbox and multimedia used in websites, I've experimented a lot with it.
I think I'm able to make it work the way you want.

In fact you use the standalone version of the JWPlayer (for use with subtitles) since you call it directly in your syntax.
This way Ninja Shadowbox listens only to the rel attribute command to popup the shadowbox window and passes only customized parameters (set in the Module and Advanced Parameters). But still loads all the scripts needed for Ninja Shadowbox. This might give a conflict between things.
Also, the scripts from Ninja Shadowbox are a bit outdated (due to license policies), so the general coding is based on the scripts used/integrated at that time. I have no other explanation, but I think it's fairly close.

That said, we still don't have a proper workaround.

So I'm going to give you this work around to make it work.

1) Paste this in the article where the FLV link is, use the html editor to do so:

<script src="http://www.elevenfox.de/jwplayer.js" type="text/javascript"></script>

2) Replace your current syntax with this one (allowfullscreen is gone, not needed anymore):

<a href="http://www.elevenfox.de/player.swf?autostart=true&amp;skin=http://www.elevenfox.de/beelden.zip&amp;plugins=captions&amp;captions.file=http://www.elevenfox.de/media/polysics-each-life-each-end-budokan.srt&amp;file=http://www.elevenfox.de/media/polysics-each-life-each-end-budokan.flv" title="POLYSICS - Each Life Each End - LIVE at Budokan" rel="shadowbox;width=624;height=360;">KAYO &nbsp;カヨ 2</a>

3) unzip the attached modified shadowbox-swf.js and upload it to /modules/mod_ninja_shadowbox/ninja_shadowbox/js/player/ (backup original first).

This should do the trick ;)

Note that this a work around based on this topic.
Might not work for other users.

Let me know how it goes.

Have a nice a nice day ;)

-John

You don't have access to view the attachments in this post.
Link to this post 05 Jan 12

Sensei John!
Thank you for the workaround!

So much work! I hope it can be used by more members of the forum - and perhaps be part of any enhancements to future versions of the module...

I wanted to double check something before diving into the pool though...

I've downloaded the shadowbox-swf.js file and I will upload it to the proper sub-folder on the server per your instructions (I've already located the original file and backed it up).

I will replace the anchor tag with the one your modified:

<a href="http://www.elevenfox.de/player.swf?autostart=true&amp;amp;skin=....etc-etc-etc... rel="shadowbox;width=624;height=360;">KAYO &nbsp;カヨ 2</a>

What I'm not sure about is where to put the player script call:

<script src="http://www.elevenfox.de/jwplayer.js" type="text/javascript"></script>

Normally I would put a script call in the <HEAD> section of my page - in the case of Joomla, I'd modify the HTML of the template, again placing it in the <HEAD> section.

However, you say "Paste this in the article where the FLV link is". Sorry, I'm not sure where you mean. In Joomla, I think of the "article" as the code that ends up inside the <DIV> where the thing in question appears on the page, and I think of the "FLV link" as the actual anchor tag pointing towards the movie with the FLV file name extension. So I'm in unsure territory here.

Sorry. It could also be that my brain is not functioning at full capacity - too much work - too much music (excesive head banging) - not enough coffee - mmm, maybe too much coffee...

Thank you in advance for any clarification you could offer me.

Regards,
-RR


Link to this post 05 Jan 12

Hi RR-san,

Thanks for your feedback.
Yea, that's something to consider to suggest these modifications to the dev team.

Actually, I meant that you can put the script call/declaration in the article where the FLV thing is by using Joomla's html editor, if you use TinyMCE as editor for instance.
Just put it above all other html content within the html editor. Doesn't really matter as long as the script is declared in the same article where your FLV thing is.

Sure, if you like you may put it in the <head> section of your template.php or index.php.
Even a better way then put in the article.
I was not sure how familiar you are with this so I suggested the easiest way to declare a script.

I hope things are clear to you.
If not then please feel free to ask.

Some literal years ago for me that I did some headbanging.
But too much music will never be too much for me.
For me it's better to stay on coffee ;)

Let me know how you are doing.

-John

Forums Joomla Extension Support Ninja Shadowbox & Ninja ShadowPanel Is it possible to pass parameters to the Flash player...