How to stop a video from playing in an WebHTMLViewer when navigating away from the page

I have a WebHTMLViewer that plays a YouTube video. When I navigate out of that page, the video sound continues to play in the background. I tried a .Close to close the control, and I think that worked, but when I came back in to try and watch another video, it did not seem to play any other videos, maybe because it was permanently closed?? If that is the case, how do you open it back up? Or maybe there’s a better approach

I figured out a working solution and am posting this in case anyone else needs help with it. There may be better approaches, but this worked for my situation. The following follows the example project: Platforms > Web > Containers > Dynamic Container Control

  • Add a container control to the project and add the HTMLViewer
  • On the web page, add a property for this container control as in the example
  • Following the example project, add the code to add the control and play the video
  • When navigating away from the page where you want to stop the video from playing, add the code from the example project to close the control and make it nil

I found that when initializing the playing of the video, I first had to close the control and make it nil for the purposes of reinitializing a new one so the next video can play. In my case, I have a listbox, and if I didn’t close and nil it first, then selecting another video in the list did not play it

Hope this helps anyone