Name is required.
Email address is required.
Invalid email address
Answer is required.
Exceeding max length of 5KB

Audio continues to play after closing in IE


Hi there,

I have the jwplayer playing across my browsers, but when you close the pop-up window in IE8, the audio keeps playing. Is there an easy fix?

Thanks a bunch.

25 Community Answers

Ethan Feldman

JW Player Support Agent  
0 rated :

Link?

JW Player

User  
0 rated :

Oops, sorry about that. http://www.hiringsmart.com/temp/videotest/

Ethan Feldman

JW Player Support Agent  
0 rated :

I haven’t used this exact lightbox before, but it looks like it is not stopping the player when closed in IE.

You are going to have to add jwplayer.stop(); to the close button of the lightbox in order to work around this.

JW Player

User  
0 rated :

Thanks a bunch. I'll try and let you know how it works out.

Ethan Feldman

JW Player Support Agent  
0 rated :

Np

JW Player

User  
0 rated :

Hi, I forwarded what you mentioned to me over to our developer and he did what he could, but its still playing the audio after the video player is closed. Would you mind looking?

http://www.hiringsmart.com/temp/videotest/

Thank you so much.

mwm

Ethan Feldman

JW Player Support Agent  
0 rated :

What JS file controls this lightbox? Do you know what he changed?

JW Player

User  
0 rated :

I know that underneath "height: '500'" is new. That close function he added.

This is all in the source of the linked page.

<script type="text/javascript" src="http://media.hiringsmart.ca/player/jwplayer.js"></script>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.18/jquery-ui.min.js"></script>

<a href="#" onclick="$('#VideoDialog').dialog('open')">Open</a>

<div id=VideoDialog title="HiringSmart Video" style="display:none">
<div id="videocontainer01">Loading the player ...</div>
</div>

<script type="text/javascript">

$(document).ready(function() {

$('#VideoDialog').dialog({
autoOpen: false,
width: 700,
height: '500',
close: function(ev, ui){jwplayer.stop("videocontainer01");}
});

});

jwplayer("videocontainer01").setup({
flashplayer: "http://media.hiringsmart.ca/player/player.swf",
file: "http://media.hiringsmart.ca/player/video.mp4",
height: 460,
width: 680
});


</script>

Ethan Feldman

JW Player Support Agent  
0 rated :

Where is the close() function being called though?

JW Player

User  
0 rated :

I'm not sure. I'm not familiar with JS. He said he added the "close: function(ev, ui){jwplayer.stop("videocontainer01");}", but I guess that wouldn't do anything?

I guess I'll need to find access to the Javascript file?

Ethan Feldman

JW Player Support Agent  
0 rated :

Yes…

JW Player

User  
0 rated :

Isn't "close: function(ev, ui){jwplayer.stop("videocontainer01");}" the line in the script that when the player closes, the video should stop? Our developer said that the player script is written in the html (what I posted earlier).

Sorry to bother with this, I'm not very savvy when it comes to JS.

Thanks again.

Ethan Feldman

JW Player Support Agent  
1 rated :

I just want to know what JS file controls the lightbox, that’s all. Maybe ask your dev?

JW Player

User  
0 rated :

Its been fixed. You can see the added close function. Here is the whole code for reference.

<script type="text/javascript">

$(document).ready(function() {

$('#VideoDialog').dialog({
autoOpen: false,
width: 700,
height: '500',
close: function(event, ui)
{$("#videocontainer01").get(0).sendEvent('STOP');}
});

});

jwplayer("videocontainer01").setup({
flashplayer: "http://media.hiringsmart.ca/player/player.swf",
file: "http://media.hiringsmart.ca/player/video.mp4",
height: 460,
width: 680
});


</script>

Ethan Feldman

JW Player Support Agent  
0 rated :

Glad you got it!

JW Player

User  
0 rated :

I had this piece of code in which I was getting the player.swf. Which was having the id as "mediaspace".

------------------
<object width="100%" height="100%" type="application/x-shockwave-flash"
data="http://localhost/magento5/skin/frontend/default/default/videos/mediaplayer/player.swf"
bgcolor="#000000" id="mediaspace" name="mediaspace" tabindex="0"><param name="allowfullscreen"
value="true"><param name="allowscriptaccess" value="always">
<param name="seamlesstabbing" value="true"><param name="wmode" value="opaque"><param name="flashvars"
value="netstreambasepath=http%3A%2F%2Flocalhost%2Fmagento5%2Findex.php%2Ftest-1%2Ftest.html&
id=mediaspace&file=http%3A%2F%2Flocalhost%2Fmagento5%2Fskin%2Ffrontend%2Fdefault%2Fdefault%2Fvideos%2Fvideo.mp4&controlbar.position=over&volume=100&mute=false">
</object>
---------------------

I used this code on click event(For closing video) to get my problem solved

var myVideoPlayer = document.getElementById("mediaspace");//Getting the player
myVideoPlayer.sendEvent("STOP");

Make sure to get the correct element id.This will work for you.
Thanks

Ethan Feldman

JW Player Support Agent  
0 rated :

Thanks for sharing!

JW Player

User  
0 rated :

I do have the same problem as well in our page:
http://www.yourfreedomproject.com/yfp-index-test2/

The problem in our case is that, when you click the "Learn More" button it plays normally, but when you hit the 'x' button, it closes the box but it only PAUSE the video, not STOP. How can I make it so that when I hit the 'x' button, it stops the video. I am having this issue in internet explorer 9 by the way. And seems to work fine in other browsers.

Here is the code that i used in our page:

bc.. <script type="text/javascript">
jwplayer("mediaplayer1").setup({
flashplayer: "http://www.yourfreedomproject.com/global/video-player/jwplayer/player.swf",
file: "http://www.virtual-wonders.com/video/yfp-explainer.mp4",
image: "http://www.yourfreedomproject.com/global/video-player/thumnails/yfp-explainer.jpg",
skin:"http://www.yourfreedomproject.com/global/video-player/skin/glow.zip",
width: 640,
height: 480,
stretching: "exactfit",
controlbar: "bottom",
events:{
onPlay: function() {
jwplayer('mediaplayer2').stop();
}
}
});
</script>


Ethan Feldman

JW Player Support Agent  
0 rated :

Under:

jwplayer(‘mediaplayer2’).stop();

Add:

jwplayer(‘mediaplayer2’).pause();

JW Player

User  
0 rated :

Hi Ethan, thanks for the reply.. I tried your suggestion, but it seems like it didn't work.. You can check the updated code in here.. http://www.yourfreedomproject.com/yfp-index-test2/

Ethan Feldman

JW Player Support Agent  
0 rated :

Hm, what happens if you reverse them, or just use pause()?

JW Player

User  
0 rated :

For anyone running into this issue here's my solution for IE9 (as per @Ethan's comment but without using stop):

bc.. jwplayer('video_id').pause();


Hope this helps :)

Ethan Feldman

JW Player Support Agent  
0 rated :

Cool :) Thanks for sharing.

JW Player

User  
0 rated :

if its an option just reload the page on close?

<script type="text/javascript">
$(document).ready(function() {
$('#cboxClose').click(function() {
location.reload();
});
});
</script>

pete @ http://www.scotche.gg

Ethan Feldman

JW Player Support Agent  
0 rated :

That works too.

This question has received the maximum number of answers.