You will recieve your password to this address. Address is not made public.

Your preferred username that is used when logging in.

Typo in Player.load breaks player version fallback Created Apr 29, 2009

This thread is solved

Views: 1136     Replies: 5     Last reply May 20, 2009  
You must login first before you can use this feature

Manuel Razzari
http://ultimorender.com.ar/funkascript

Posts: 6

Registered:
Apr 24, 2009

Typo in Player.load breaks player version fallback

Posted: Apr 29, 2009

3.1.0.js, Line 533, notice the typo in wrappper.
So if the player version is not supported the script just breaks.

// do not use splash as alternate content for flashembed
if (html && !flashembed.isSupported([9, 0])) {
	wrappper.innerHTML = "";	
}
Anyway, I'm probably missing something, but I'm not sure why that code is there at all, since that should handled later by flashembed. It actually prevents the "fail #2.1" from working... and even if it worked... the #2.1 logic is empty! Maybe add an onError event there? or a CSS class like "unsupported-player" to the wrapper? In that way, users can customize (or localize!) the fallback message.

Also - maybe I just need a stronger coffee, but I've had a very hard time finding your SVN repo. Perhaps on the homepage you could use "Download the source code or browse the SVN repository." And/or on the Bugs forum you could add a "read me first" with those links...

Manuel Razzari
http://ultimorender.com.ar/funkascript

Posts: 6

Registered:
Apr 24, 2009

Alternate fallback

Posted: Apr 30, 2009

Reply to: Typo in Player.load breaks player version fallback, from ManuelRazzari
Hmm ok. I believe I now understand the rationale for line 535's wrapper.innerHTML = ""; and take back my "Anyway" paragraph above. Since the standard use case for the root's innerHTML is a splash image in Flowplayer but alternate content (no-Flash) in flashembed, you are forcing flashembed into its most primitive behavior.

A quick workaround for this, for anyone who wishes to create an alternate fallback, for example to translate the "Flash version 9 or greater is required" message to another language, would be the following:


// Your regular FlowPlayer instance
$f("player", "flowplayer.swf", "my-video.flv"); 

// If the user doesn't have the FP required version
// and expressInstall is not an option...
if (!flashembed.isSupported($f().getFlashParams().version) && 	
     !flashembed.isSupported([6,65])){ 				
	// Add whatever custom fallback you wish to provide. 
	// In this case I use jQuery to add a class to the BODY.
	$('body').addClass('badFlash'); 
	// Prevent the player from loading
	$f().onBeforeLoad(function(){ 
		return false; 
	})
}

Manuel Razzari
http://ultimorender.com.ar/funkascript

Posts: 6

Registered:
Apr 24, 2009

More minor findings

Posted: Apr 30, 2009

Reply to: Typo in Player.load breaks player version fallback, from ManuelRazzari
#1: Line 1398, if I understand correctly (midnight here ;) the flashembed's API getConf() method should return opts rather than conf (the later is undefined).

getConf: function() {
	return opts;	
},
#2: Line 534

if (html && !flashembed.isSupported([9, 0])) {
shoud be

if (html && !flashembed.isSupported(params.version)) {

Tero
Author of jQuery Tools and this website + JavaScript developer of Flowplayer.

Posts: 1656

Registered:
Nov 16, 2007

Thank you!

Posted: May 11, 2009

Reply to: More minor findings, from ManuelRazzari
thank you for your findings! these fixes will be included on 3.1.1 that should be out within a week.

any change you would be interested on making a document about "handling old Flahs versions" with differend kind of setups? We have something here:

http://flowplayer.org/documentation/configuration/player.html

But it can be broadened. Of course we can pay you for the work.

thanks again.

Manuel Razzari
http://ultimorender.com.ar/funkascript

Posts: 6

Registered:
Apr 24, 2009

Minor issue with fp 6.0.21

Posted: May 11, 2009

Reply to: Thank you!, from tipiirai
Hello Tero, glad I could help.

I might write up my custom configuration if I have some time. No need for payment, I'm happy to be able to contribute something back to this project :)

By the way, I've just found something else... while testing isSupported() on WinXP IE6 fp 6.0.21, I got "Line 1590 - '0' is null or not an object".

I fixed this by adding version to the return statement on line 1566:

} catch(ee) {
	if (version[0] == 6) { return version; }
}
... I haven't tested this thoroughly, though it looks like it should work...

Tero
Author of jQuery Tools and this website + JavaScript developer of Flowplayer.

Posts: 1656

Registered:
Nov 16, 2007

» Minor issue with fp 6.0.21

Posted: May 20, 2009

Reply to: Minor issue with fp 6.0.21, from ManuelRazzari
ahh. didn't manage to fix this for the 3.1.1. release. however all the other fixes are now there.