It does the intended thing on the archives page, so whatever's going wrong is... obscure. And probably related to the difference between seekable and non-seekable or finite and infinite streams. And yet, hitting the triangles does the right thing, so I want to just do that.
Code is in dnaplayer.js. Making a copy and uncommenting the return at the front of LOG() may be helpful.
Update: Apparently this fixes it, though I can't really explain why. Before calling "play", do:
- if (secs == 0) secs = NaN; // You've got to be fucking kidding me.
You fixed it! Or... Macworld problems. Works as intended (no triangle fiddling required) with my IE10, FF17esr, Chrome26.
It works in Firefox 20.0 on Linux. Click the link and music starts playing.
and FF20 on Android
Per the other comments in this thread, I was able to reproduce your problem on my 10.6.8 Mac running Chrome 25.0.1364.172.
I was able to get the player running by using the following
p = $("#jquery_jplayer_1");
p.jPlayer("play",NaN);
Or, if you want to give up completely you can just trigger a click on the play button.
$('.jp-play').trigger('click');
If you're interested in the why, I downloaded the uncompressed source and traced the play call to
play: function(time) {
time = (typeof time === "number") ? time : NaN; // Remove jQuery event from click handler
if(this.status.srcSet) {
this.focus();
if(this.html.active) {
console.log("html_paly");
this._html_play(time);
} else if(this.flash.active) {
console.log("flash_play");
this._flash_play(time);
}
} else {
console.log("_urlNotSetError");
this._urlNotSetError("play");
}
},
which in turn calls _html_play, which is where things go south. The _html_play function has the following
try {
// !media.seekable is for old HTML5 browsers, like Firefox 3.6.
// Checking seekable.length is important for iOS6 to work with setMedia().play(time)
if(!media.seekable || typeof media.seekable === "object" && media.seekable.length > 0) {
media.currentTime = time;
media.play();
} else {
throw 1;
}
} catch(err) {
this.internal.htmlDlyCmdId = setTimeout(function() {
self.play(time);
}, 250);
return; // Cancel execution and wait for the delayed command.
}
The media variable refers to an html
<audio/>
element. In my version of chrome media.seekable.length is 0 for the player on the webcast page. This condition throws the exception "1", which is caught, ultimately callingself.play(time);
in the setTimeout function ... which is the same play function as above, which makes the same things happen again. Endless recursion, do not pass go, do not collection $200.Here's a gist with better formatted source code, since I can't make WordPress format things the way I'd like.
nice sleuthing mr storm.
seems like `media thinks differently. as the code is simply reading .seekable, media.* must instantiate with values that deviate from almost every other implementation. shades of "<!--[if IE 6]>" LOL.-->
Wow, thanks! Apparently the fix is this, before calling "play":
if (secs == 0) secs = NaN; // You've got to be fucking kidding me.
Though from reading the code, I don't understand why, since it seems to only do tests like "time > 0".
I didn't include the entire
_html_play
above. Around line 2396 (in the non-minimized source) there's an if clause that branches forNaN
values.if(!isNaN(time)) {
//the code that tries
//to seek but ends up
//causing the recursive
//calls to play
} else {
media.play();
}
Lots of special in that jPlayer.
ObWat: Wat.
Correct. Obviously JWZ meant, "if (secs == 0) secs = {} + {};" because why not go all the way?
(oops - forgot about the non-parsing) i was saying, "shades of `if ie6`" -shudder-