I use Qt QWebView component which uses flash-player for video playback. How to disable sound on flashplayer executed inside of my QWebView?
One approach that I consider is to execute some javascript code for disabling sound on player, but when to execute it? For example next code disable sound if run it on 1 second after call "load":
page.mainFrame().evaluateJavaScript("""
var mute_all_tags=function(tag){
var elems = document.getElementsByTagName(tag);
for(var i = 0; i < elems.length; i++){
elems[i].muted=true;
//alert(elems[i]);
}
}
mute_all_tags("video");
mute_all_tags("audio");
""")
Earlier calls don't stop sound. Calls on QWebView.loadFinished stops sound but for that moment some sound already issued , how can i stop sound immediately?
<audio>
/<video>
tags. – Brachylogy