How to stop youtube video sound after closing inappbrowser

How to stop the sound of youtube video after closing the web view opened by inappbrowser (Android Phonegap 2.4.0 plugin).

I used two weeks to fix this problem and was tired ..............

When I click Finish to close the web view (YouTube page), the video still plays in the background.

Even after closing the application, you cannot stop the video sound. To stop the video, I had to turn off the phone.

This is my code.

<script type="text/javascript" charset="utf-8">

 function OpenWin(juso) {
        window.open(juso, '_blank', 'location=yes');
         }

</script>  


<body>
...................
<a href="#" onclick="OpenWin('http://m.youtube.com')"> 
...................
</body>

Are there any errors in my code? Can I help?

+5
source share
1 answer

I use Sencha Touch and use the following trick to stop the sound of Youtube Video. You can consider this a link.

var ref = window.open(url,'_blank',options);
ref.addEventListener('exit',function(){
    Ext.defer(function(){
        ref.removeEventListener('exit',function(){
            console.log('Closed');
        });
        var ref2 = window.open('about:blank','_blank','hidden=yes');
        Ext.defer(function(){
            ref2.close();
        },350);
    },350);
});
+1

All Articles