Problem with HTMLViewer on Windows

  1. 3 weeks ago

    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:
    Is there something specific I need to do to make it work or is this a bug on the Windows side?

  2. shao s

    Mar 1 Pre-Release Testers Sudbury, Ontario, Canada

    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..

  3. Michael D

    Mar 1 Pre-Release Testers, Xojo Pro

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


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

  5. Julian S

    Mar 2 Pre-Release Testers, Xojo Pro UK

    @Patrick B thanks. so i'd put that code (from the link) in the app's Open event?


  6. 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.

  7. Michael D

    Mar 2 Pre-Release Testers, Xojo Pro

    You probably need to set the "Mark of The Web" (MOTW) if the file is on the local hard drive

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

  9. 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)

    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');;
  10. 2 weeks ago

    shao s

    Mar 3 Pre-Release Testers Sudbury, Ontario, Canada

    Just call the script in the DocumentCompleted event

  11. 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.

  12. shao s

    Mar 10 Pre-Release Testers Sudbury, Ontario, Canada

    Weird.. Your code should just be something like

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

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

or Sign Up to reply!