Looking to Build/Redesign a Website or Blog ?

To speak to Rakshit, call +91 968 704 2303

$.jwbox.player.sendEvent is not a function JWPlayer Error Solved

Hello Friends,

I was working with one video sharing portal where user can upload the videos, upload YouTube Video, share YouTube videos. Once user upload videos, I need to open it in lightbox effect. I used jwbox jwplayer to achieve it. Everything works but problem was, after closing jwbox lightbox, audio of video continue plays. This means video does not stop buffering. This happens only in Firefox. Audio continue plays in Firefox in jwbox and Audio continue plays in Firefox JWPlayer. It shows below error.

$.jwbox.player.sendEvent is not a function

I searched a lot for this and finally come up with solution. If you are facing same issue, Audio continue plays after lightbox close in Firefox and IE8. Here is the solution.

REMEMBER: If you are using swfobject.registerobject than it will not work. Try using swfobject.embedSWF.

var player = null;
function playerReady(thePlayer) {
	player = window.document[thePlayer.id];
}
 
function createPlayer() {
	var flashvars = {
		file:"yoursitepath/flvplayer.flv", 
		autostart:"true"
	}
 
	var params = {
		allowfullscreen:"true", 
		allowscriptaccess:"always"
	}
 
	var attributes = {
		id:"playerid",  
		name:"playerid"
	}
 
	swfobject.embedSWF("player.swf", "elementid", "320", "196", "9.0.115", false, flashvars, params, attributes);
}

Try using above code and put call below code onclick event of close button of lightbox.

player.sendEvent('STOP');

If you have a problem with Audio continue plays in FF JWPlayer, Video does not stop on close of lightbox JWPlayer, Stop Video on Close of lightbox JWPlayer, Stop Video in JWBox lightbox, Audio Continue plays in FF jwbox lightbox than this solution will work for sure.

If you face any problem with this, comment me here. I will be happy to help you.

Share:

No Comments Yet.

Leave a Reply

Your email address will not be published.