YouTube and HtmlViewer

Hello, how can i do with the full screen on youtube? It isn’t allowed in the HTMLViewer. Thanks in advance

change user agent
(works for me in OSX)

HTMLViewer1.UserAgent = "Mozilla/5.0 (iPad; U; CPU OS 4_3_3 like Mac OS X; en-us) AppleWebKit/533.17.9 (KHTML, like Gecko) Version/5.0.2 Mobile/8J2 Safari/6533.18.5" HTMLViewer1.LoadURL ("https://www.youtube.com/watch?v=3WJ1cf3nrLE")

click fullscreen button in the player controller

Thanks for answer, yes but there is other way to do it without changing the UserArgent? Because i have already changed this.

I don’t know if this is relevant to Xojo but this API says that UserAgent is deprecated and that your app could break at any time if you use that property.

https://developer.mozilla.org/en-US/docs/Web/API/NavigatorID/userAgent

[quote=219761:@Oliver Scott-Brown]I don’t know if this is relevant to Xojo but this API says that UserAgent is deprecated and that your app could break at any time if you use that property.

https://developer.mozilla.org/en-US/docs/Web/API/NavigatorID/userAgent[/quote]

It is not relevant for this thread IMO. It is Youtube which uses User-Agent and expects a certain value.

Try the api way:

http://www.youtube.com/embed/M7lc1UVf-VE?enablejsapi=1&origin=http://example.com

change the video code M7lc1UVf-VE to your video
change http://example.com to your website.
and try it.

edit, required is only the embed/ part and a video code.

http://www.youtube.com/embed/M7lc1UVf-VE

[quote=214801:@Axel Schneider]change user agent
(works for me in OSX)[/quote]

Just to clarify, this only works for you if you’re loading an actual YouTube webpage, correct? It doesn’t seem to work for me in Sierra on Xojo 2016r3 when showing an embedded YouTube video in a page.

Try this

HTMLViewer1.LoadURL("http://www.youtube.com/embed/4rx8RGA2QGg?rel=0")

At the end of youtube ID add this ?rel=0&autoplay=1
and this with autoplay on

http://www.youtube.com/embed/4rx8RGA2QGg?rel=0&autoplay=1