Problem with HTMLViewer on Windows

My app loads a YouTube video into an HTMLViewer. An option I have is to play the video muted. It works fine on the Mac but on Windows it seems to ignore the mute attribute of the embedded YouTube video. The same url will play properly in the browser on Windows but not in the HTMLViewer. It won’t mute the sound. The file is written locally to the hard drive, but I uploaded it just for testing purposes and the url is here: http://www.synchrimedia.com/vws.html
Is there something specific I need to do to make it work or is this a bug on the Windows side?

Are you using the native renderer or WebKit? Even though the WebKit renderer adds a few megabytes to your compiled application, you get similar results across both platforms, not always 100% exact though…

If you don’t do anything special, you’ll get the IE7 rendering engine which is far inferior to the IE11 engine.

See http://blog.xojo.com/2016/01/04/use-newer-version-of-internet-explorer-with-webbrowser-and-htmlviewer/

thanks. so i’d put that code (from the link) in the app’s Open event?

Yes

that worked on my simplified test app where I’m bringing the url in from the web, but for some reason not working on my locally written file. was using loadURL for the test and tried both loadURL and loadPage for the local file. odd that the file being written locally would make any difference. it is writing the local file properly as the mute works when it’s opened in Firefox.

You probably need to set the “Mark of The Web” (MOTW) http://msdn.microsoft.com/en-us/library/ms537628(v=vs.85).aspx if the file is on the local hard drive

tried the localhost thing but no luck. frustrating to be so close! i’ll keep grinding away at it.

Looks like when the file is hosted on the computer it will ignore the OnReady events after the youtube video function. I put a javascript alert in there and while the browser displays the alert, the htmlviewer on Windows doesn’t see it, nor does it see the command to mute the video. (using both MOTW and the Registry code)

<script> function onYouTubeIframeAPIReady() { var player; player = new YT.Player('muteYouTubeVideoPlayer', { videoId: 'wtbXPdCEhPk', // YouTube Video ID width: 485, // Player width (in px) height: 274, // Player height (in px) playerVars: { autoplay: 1, // Auto-play the video on load controls: 1, // Show pause/play buttons in player showinfo: 0, // Hide the video title modestbranding: 0, // Hide the Youtube Logo loop: 1, // Run the video in a loop fs: 0, // Hide the full screen button cc_load_policy: 1, // Hide closed captions cc_lang_pref: 'en', // makes captions show up in selected language iv_load_policy: 3, // Hide the Video Annotations autohide: 0, // Hide video controls when playing }, events: { onReady: function(e) { alert('hi there'); e.target.mute(); } } }); } </script>

Just call the script in the DocumentCompleted event

can’t seem to figger out how to do that. it seems to throw an error when I try the address the variable ‘player’ that it can’t be found. must be a scope thing. tried putting player outside the onYouTubeIframeAPIReady function but that didn’t work either.

Weird… Your code should just be something like

Sub DocumentComplete(URL as String) Handles DocumentComplete me.ExecuteJavaScript "onYouTubeIframeAPIReady();" End Sub

oh i see. thought maybe just the code that calls the mute. I’ll give it a go.