Youtube movie player web

:slight_smile:

Need to use the youtube movie player control in web application. I don’t seem to be able to change the URL on a button click event/refresh the control and play.

Any advice appreciated

Thanks

Skip the built-in YouTube control. Instead, use a WebHTMLViewer (itemYouTubeURL below) and set its URL like this…

[code]youTubeId = “[your video’s YouTube id]”

  if youTubeId <> "" then
    url = "https://www.youtube.com/embed/" + youTubeId + "?autoplay=0&fs=1&showinfo=0&version=3&rel=0"
    
    enablejsapi = true
    if mySession.Platform = WebSession.PlatformType.Windows then
      if mySession.Browser = WebSession.BrowserType.Firefox then
        enablejsapi = false
      end if
    end if
    
    if enablejsapi then
      url = url + "&enablejsapi=1"
    end if
    
    url = url + "&vq=hd720"        
  end if
  
  itemYouTube.URL = url
  itemYouTube.Visible = (url <> "")

[/code]

:slight_smile: Perfect - Thanks so much Brad