This is a migrated thread and some comments may be shown as answers.

playing flv in radwindow

5 Answers 96 Views
Window
This is a migrated thread and some comments may be shown as answers.
Jeff
Top achievements
Rank 1
Jeff asked on 05 Jan 2009, 05:51 PM
We're launching a radwindow that then plays a flash video (.flv). It works well but when the window is closed the audio from the video continues to play until the page is changed. We're trying to narrow down whether it is a RadWindow, Explorer browser issue (doesn't happen in Firefox) or a flash related issue.

You can view the issue by going to:
https://www.gracieuniversity.com/LC/testcenter_view.aspx?c=63QJ4TGT7X&n=28&t=1
and clicking on any of the links that say "watch demo" and then closing the radwindow while the video is playing. You'll notice that the audio continues to play.

Is there a way to force the "x" out of a RadWindow to kill any elements that are playing in the window?

thanks,
Jeff

5 Answers, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 06 Jan 2009, 11:54 AM
Hi Jeff,

Try attaching OnClientClose event with RadWindow "OnClientClose" and use the following code in OnClientClose function. Hope this will help you to resolve the issue.

JavaScript:
<script type="text/javascript"
function OnClientClose(oWnd) 
    oWnd.oWnd.get_contentFrame().src = "about:blank"
</script> 

Thanks,
Shinu.
0
Georgi Tunev
Telerik team
answered on 06 Jan 2009, 01:32 PM
Hello Jeff,

This could happen if RadWindow's object is not destroyed when the window is closed (e.g. DestroyOnClose is set to false). By default this property is set to false and when a RadWindow is closed, it remains hidden on the page - this is done in order to provide a caching feature so the window can be opened immediately when called again.

Please set DestroyOnClose to true - this should help in your scenario. Note however that when DestroyOnClose is set to true, you will not be able to open that same RadWindow again until the whole page is reloaded - a new RadWindow with default settings will be opened instead. That is why it is better to set the needed properties of the window either in the RadWindowManager or with the client-side API.



Kind regards,
Georgi Tunev
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Jeff
Top achievements
Rank 1
answered on 06 Jan 2009, 05:05 PM
Thanks for the quick replies.

This is a tough one. The DestroyOnClose worked great in stopping the audio when the window was closed but as you mentioned, the next window that was opened reverted back to the default settings which don't work well for the video that's playing. Unfortunately it will be very common for users to open windows multiple times when on the same page.

The other suggestion to use the onClientClose function didn't seem to stop the audio when the window was closed but also threw a javascript error so it's possible I didn't implement it correctly. I added OnClientClose="OnClientClose" to the window parameters and then the javascript as copied directly from the suggestion but I get a "oWin is null or not an object" browser error. Do I need to adjust?

thanks again

0
Georgi Tunev
Telerik team
answered on 07 Jan 2009, 05:59 AM
Hello Jeff,

It is not so tough as it looks :) Have you tried setting the needed properties for the window in the RadWindowManager or via the client-side API? As for Shinu's reply, I see that there is an extra oWnd there - that is why you are getting the error.
Try it like this:
function OnClientClose(oWnd)  
{  
    //one way 
    oWnd.get_contentFrame().src = "about:blank";  
    //basically the same but by using the setUrl method 
    //oWnd.setUrl("about:blank");  
}  


If you still experience problems, please open a support ticket and send me a small sample application where the problem can be reproduced and that shows your exact setup. I will examine it and get back to you with solution right away.

Kind regards,
Georgi Tunev
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Jeff
Top achievements
Rank 1
answered on 07 Jan 2009, 08:59 PM
Thanks Georgi - the adjusted code you supplied worked perfectly.
Tags
Window
Asked by
Jeff
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Georgi Tunev
Telerik team
Jeff
Top achievements
Rank 1
Share this question
or