Closing CfWindow doesn't stop playing audio file
I am writing below code under cfwindow
<audio src="audio1.wav" controls="controls" autoplay="autoplay">
<embed src="audio1.wav" autostart="true" loop="false">
</embed>
</audio>
If html5 is not supported in browser, I am trying to play audio file with default au开发者_运维百科dio player for browser.
Problem is that when I close my cfwindow by clicking 'X' sign on top right, my cfwindow gets closed but audio file still keeps on playing.
Please suggest how to stop music from playing as soon as I close my cfwindow. Thanks!!
When the default close event is fired, all that happens is the generated div is hidden with css. Try disabling the default close (x) button, and using ColdFusion.window.destroy.
Here is the solution
there are two ways to solve the issue 1.keep DestroyOnClose="true" attribute in cfwindow tag 2.Call ColdFusion.window.destroy('WIndow name',true)
Thanks, Ramakrishna
精彩评论