qt - How to disable sound on flashplayer in my custom application? -


i use qt qwebview component uses flash-player video playback. how disable sound on flashplayer executed inside of qwebview?

one approach consider execute javascript code disabling sound on player, when execute it? example next code disable sound if run on 1 second after call "load":

page.mainframe().evaluatejavascript("""     var mute_all_tags=function(tag){         var elems = document.getelementsbytagname(tag);         for(var = 0; < 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 moment sound issued , how can stop sound immediately?

it sounds loading external pages (i.e. 3rd-party sites) html5 video or flash video qwebview. also, keeping videos muted right start absolutely no audio seems critical feature seeking.

solution 1

your page.mainframe().evaluatejavascript("...") seems easiest solution, there lag before script executed.

solution 2

an alternative scrape target website, using regex or similar change <video> tags add mute property e.g. <video controls muted>. analogous <embed> tags too. then, load modified html web view sethtml() method, setting base url, , possibly referer header. html render videos muted start.

solution 3

another idea might intercept media urls qt (e.g. .mp4, .mov), , hold them in paused queue, call page.mainframe().evaluatejavascript("...") programmatically mute <video> , <audio> tags, allow queue proceed when evaluatejavascript() call returns. media, if auto-playing, should start muted.


Comments

Popular posts from this blog

cakephp - simple blog with croogo -

How to group boxplot outliers in gnuplot -

bash - Performing variable substitution in a string -