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

Your preferred username that is used when logging in.

unload() problem in IE7 Created Aug 13, 2009

This thread is solved

Views: 4078     Replies: 5     Last reply Nov 2, 2009  
You must login first before you can use this feature

michel@navitell

Posts: 1

Registered:
Jun 26, 2009

unload() problem in IE7

Posted: Aug 13, 2009

Hi,

I am implementing a commercial version of flowplayer in IE7.
I use the overlay capability of the JQuery tools.
In Chrome and FF this does work just fine. In IE7 however, whenever I close the overlay, the audio of the flv file that plays inside the overlay does not stop playing, although the overlay is closed properly.
Seems like the unload() function doesn't work properly.
As said, in FF or chrome it works perfect.
I can solve the problem by explicitly calling the function stop() in the close function of the overlay , but in FF I get then a javascript error in firebug which prevents me from opening the overlay a second time. This is the error :
y["fp_" + F] is not a function

[Break on this error] (function(){function g(o){console.log("$...function(){flashembed(this,k,j)})}}})();

This is some code from the page :


// install flowplayer into flowplayer container
	var player = $f( 'player' , '/swf/flowplayer.commercial-3.1.0.swf' , {key: '#$a03880f26266972a70b', clip: {autoPlay: true} }); 
	
	// setup button action. it will fire our overlay 
	$("button[rel]").overlay({
		api: true, 
		// when overlay is opened, load our player
		onLoad: function() {
			$f().load();
		},
		
		// when overlay is closed, unload our player
		onClose: function() {
			$f().stop();
			$f().unload();
		}
	});


<!-- element that is overlayed, visuals are done with external CSS -->
<div overlay="/images/overlay/transparent.png" class="overlay" style="background-image: none;"><div class="close"></div>
	<!-- flowplayer container -->
	<div href="http://navitell.cdn02.rambla.be/trailers/1246234095teaser_30_s_Herentals.flv" style="margin:0px auto;width:500px;height:400px;" id="player"></div>
</div>

I hope someaone can help.

grtz,

Michel.

hmzglenn

Posts: 2

Registered:
Aug 17, 2009

same problem

Posted: Aug 17, 2009

Reply to: unload() problem in IE7, from michel@navitell
i am having the same problem.
it works in chrome but not in ie8, when i close the overlay it still plays. it feels like the flowplayer isn't unloading correctly.

i even tried to iterate through all the active players and unload them, but that didn't work either.

hmzglenn

Posts: 2

Registered:
Aug 17, 2009

unload() problem in IE7

Posted: Aug 18, 2009

Reply to: same problem, from hmzglenn
the solution of the problem is the way unload works

the description in the api documentation says:
"This method does nothing if the player is full screen or if there was no html in the container."

so in my code i but a "hello" between my A tags and it worked.

Skippy

Posts: 15

Registered:
Aug 5, 2009

» unload() problem in IE7

Posted: Aug 20, 2009

Reply to: unload() problem in IE7, from michel@navitell
Yep, as hmzglenn says you have to put something between the a tags. Here's an example of the container code I use just above the javascript:

<div class="overlay">
	<!-- setup the overlay player1 container -->
	<a id="player1" href="/">
	<!-- some initial content so that player is not loaded upon page load -->
	Play Video
	</a>
</div>

Notice I just put a forward slash in the href in the a tag within the div. It's just a placeholder so if someone puts hovers their cursor over the player all they see is the domain name and not the full url to the video. The words "Play Video" are only briefly seen when the overlay is loading then are overlayed by the player. In my code I call the clip within the javascript code either by clip: or in a playlist:[.

cowboysdude

Posts: 14

Registered:
Mar 9, 2009

» » unload() problem in IE7

Posted: Aug 23, 2009

Reply to: » unload() problem in IE7, from Skippy
Notice I just put a forward slash in the href in the a tag within the div. It's just a placeholder so if someone puts hovers their cursor over the player all they see is the domain name and not the full url to the video. The words "Play Video" are only briefly seen when the overlay is loading then are overlayed by the player. In my code I call the clip within the javascript code either by clip: or in a playlist:[.

I guess that's what I'm looking for ... creating a playlist within an overlay.. suggestions? Many Thanks!!

adxstudio

Posts: 1

Registered:
Oct 30, 2009

» unload() problem in IE7

Posted: Nov 2, 2009

Reply to: unload() problem in IE7, from michel@navitell
I had the same problem, but just adding dummy text back into the player container div wasn't working for me. I ended up unloading the player on the onClose event of the overlay, and immediately after re-inserting some dummy text into that same div:

//when a video icon is clicked
$(".videoIcons a").click(function() {
	//get the URL of the video that was clicked
	var videoUrl = $(this).attr("href");
	//create a variable for the player, passing the container to install it in, 
	//the location of the player, and a bunch of arguments including layout and url of video
	var player = $f("playerContainer", "/flowplayer/flowplayer-3.1.5.swf", {
	clip: { url: videoUrl, scaling: 'fit' },
		plugins: {
			controls: {
				sliderColor: '#000000',
				volumeSliderGradient: 'none',
				sliderGradient: 'none',
				durationColor: '#ffffff',
				progressGradient: 'medium',
				buttonOverColor: '#33597C',
				tooltipTextColor: '#ffffff',
				tooltipColor: '#5F747C',
				timeColor: '#eb0000',
				bufferGradient: 'none',
				volumeSliderColor: '#000000',
				borderRadius: '0px',
				buttonColor: '#33597C',
				backgroundGradient: 'none',
				backgroundColor: '#111F2C',
				progressColor: '#FF0920',
				bufferColor: '#e6555c',
				timeBgColor: '#274560',
				height: 24,
				opacity: 1.0,
		             background: "url/images/playerControlBar.gif)"
			}
		}
	});
	//open the overlay and install the player in it
	OpenOverlay(player);
	//stop the link from working (to prevent the video from downloading)
	return false;
});

function OpenOverlay(player) {
	$("#overlay").overlay({
		//create the blue background using the expose plugin
		expose: {
			color: '#0C2E49',
			loadSpeed: 500,
			closeSpeed: 800,
			opaicty: 0.85
		},
		//load our player
		onLoad: function() {
			player.load();
		},
		// when overlay is closed, delete the player
		onClose: function() {
			player.unload();
			$("#playerContainer").text(" "); //dummy text to make this thing work in IE (sigh)
		},
		//specify that we want to use overlay programatically (rather than by triggering off a link)
		api: true
		}).load(); //load the overlay immediately after the construction
}
The I'm not using the rel tag of the video icons and instead using the jQuery onClick() function is because this is being used in a content management system, and I don't easily have access to alter the rel attribute.