Firefox 3.6.6 + jPlayer 1.2.0 loading swf twice, not firing jPlayerReady

86 views
Skip to first unread message

Barnaby Claydon

unread,
Jul 12, 2010, 3:38:06 PM7/12/10
to jPlayer: the CSS styleable jQuery audio player plugin
Hello Mark,

I read that Firefox 3.6 introduced a local-testing bug that required a
100ms delay before calling init in the swf. I believe this bug may
have returned as of jPlayer 1.2.0 and/or Firefox 3.6.6

If I disable both ogg and native support when initializing jPlayer
locally, the jPlayerReady event never fires and my Firebug net tab
shows 2 instances of the swf being downloaded.

Incidentally, if I enable ogg and native support, the ready event
fires but when I attempt to play an mp3 (I have tried several)
onProgressChange keeps firing but all arguments are 0 (ie.
loadPerfenct, playedPercentAbsolute) - very odd.

My only other thought is to revert to version 1.1.0 and see if I have
better luck.

Any advice would be appreciated.

Thanks!
-Barnaby

Barnaby Claydon

unread,
Jul 12, 2010, 4:56:21 PM7/12/10
to jPlayer: the CSS styleable jQuery audio player plugin
I have resolved this issue.

It appears that the loading of the swf twice and the not firing of
jPlayerReady events -in my case- were distinct issues.

As jPlayer is a jQuery plugin and as I am planning to use multiple
instances on the page, I was initializating jPlayer using a class-
based jQuery selector. However, this causes great problems as the
FlashVars used in the embed code will not have an id value to pass to
the swf.

My suggestion is two-fold:
1. Clearly state in the docs the requirement that all player container
elements have unique ids before being initialized
2. Add an additional try block for this case and call jPlayer._error

Hope this helps other folks,
Thanks for the great plugin Mark. :)
-Barnaby

Mark P

unread,
Jul 13, 2010, 10:24:57 AM7/13/10
to jPlayer: the CSS styleable jQuery audio player plugin
Hello Barnaby,

From your 1st post, I thought it was the Firebug bug:
http://www.happyworm.com/jquery/jplayer/latest/developer-guide.htm#jPlayer-known-issues-firebug

Glad you got it sorted out.

You raise an interesting point though... While I designed jPlayer to
work with multiple selectors during the constructor stage of the
initialization (from jPlayer 1.0.0), I had in fact never tested it.
Partly because it was using the jQuery UI core code for that bit and I
figured it would work... And also because I suppose when you get too
close to something you sometimes get the blinkers on. ie., I should
expand my tests.

I thought of a 3rd solution though... During the _init() where the ID
is got from the jPlayer <div>, we could do a check to see if it has
one. It there is no ID, then we generate one similar to what is done
for the <audio>, <embed> and hidden text <div>. That ID is written to
the <div>... It should solve the problem of using class selectors
without ID names.

Would this 3rd solution help your case?
- I think it would.

I'm wondering what problems it could cause though... If there was no
ID to begin with, the the dev would hardly set one themselves at a
later time would they? ie., after jPlayer initialized the array of
selectors found using the class.

As for the unique IDs... Well I suppose jPlayer could check somehow,
but I cannot think of a simple way for 1 instance to know all the
others... jPlayer knows what instance number it is... I guess I'd need
to store a pointer to all the instances on $.jPlayer.instanceSelector
using an array for them, then check there. I'll ponder over this one a
while. Duplicate IDs are bad in general, so it is not like jPlayer is
a special case.

What do you think of the 3rd solution that I proposed?

Best regards,
Mark P

youngblood

unread,
Jul 13, 2010, 11:50:30 AM7/13/10
to jPlayer: the CSS styleable jQuery audio player plugin
I think I might be experiencing this problem as well. It's loading the
swf twice. It seems to work in FF sometimes, but largely not. I
disabled Firebug as well. Not familiar with the code yet to ask a
specific question since I'm using it with a the Drupal module jplayer,
but if you guys have ideas on why it's not working on our site, I
would really appreciate it. Thanks.

http://www.splcenter.org/voices

On Jul 13, 9:24 am, Mark P <mark.panaghis...@gmail.com> wrote:
> Hello Barnaby,
>
> From your 1st post, I thought it was the Firebug bug:http://www.happyworm.com/jquery/jplayer/latest/developer-guide.htm#jP...

Mark P

unread,
Jul 13, 2010, 12:14:41 PM7/13/10
to jPlayer: the CSS styleable jQuery audio player plugin
Hello youngblood,

I reviewed your site in a few browsers... They all only seemed to work
if clicked the 'next' button.

There must be something wrong with the code that sets up the initial
condition. It is like jPlayer is not set with a file to play at the
start. Then clicking next sets the file and it then works.

Best regards,
Mark P.

youngblood

unread,
Jul 13, 2010, 12:47:45 PM7/13/10
to jPlayer: the CSS styleable jQuery audio player plugin
Hi Mark.The drupal plugin does have a option to auto play, I just have
it disabled. Ideally, it would be good for it to select the first one
by default, and play it when you hit the play button for the first
time. I'm sure this is possible, and baked into your plugin, so I'll
do some digging on that. I'll also pass it along to the thread I
started on drupal.org. Thanks for your quick reply.

http://drupal.org/node/852286
Reply all
Reply to author
Forward
0 new messages