FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Webview and Youtube
Posts: 1067
Joined: Wed Nov 09, 2005 02:17 AM
Webview and Youtube
Posted: Mon Jul 07, 2025 06:34 PM
Hi Guys,

I can show an youtube video in a dialog doing this:
          oWebView = TWebView2():New( oDlg )
          oWebView:Navigate("https://youtu.be/3lgXBk-1SoQ")
          oWebView:Run()
How could I set youtube through webview2 to show this video in a Full Screen mode?
Sds,
Vilian F. Arraes
vilian@vfatec.com.br
Belém-Pa-Brazil
Posts: 231
Joined: Fri Jul 20, 2012 01:49 AM
Re: Webview and Youtube
Posted: Tue Jul 08, 2025 12:40 AM
try this one :D
#include "FiveWin.ch"

#define GWL_STYLE         -16
#define HWND_TOP            0
#define SWP_NOOWNERZORDER 512
#define SWP_FRAMECHANGED   32

function Main()

	local oWebView

	oWebView := TWebView2():New()
	oWebView:Navigate( "https://www.youtube.com/watch?v=bX0YFNlYowQ" )

	setWebView2_fullscreen( oWebView )

	oWebView:Run()

return nil

function setWebView2_fullscreen( oWebView )

	local hWnd, aScreen, nStyle

	if hb_isObject( oWebView )

		hWnd := oWebView:GetWindow()
		aScreen := FW_GetMonitor( hWnd )

		if len( aScreen ) >= 4
			nStyle := GetWindowLong( hWnd, GWL_STYLE )
			nStyle := nAnd( nStyle, nNot( WS_OVERLAPPEDWINDOW ) )
			SetWindowLong( hWnd, GWL_STYLE, nStyle )
			SetWindowPos( hWnd, HWND_TOP, aScreen[ 1 ], aScreen[ 2 ], aScreen[ 4 ], aScreen[ 3 ], SWP_NOOWNERZORDER + SWP_FRAMECHANGED )
		endif

	endif

return nil
Regards,

Lailton Fernando Mariano
Posts: 244
Joined: Mon Jun 05, 2006 09:39 PM
Re: Webview and Youtube
Posted: Tue Jul 08, 2025 10:54 AM
Posts: 1067
Joined: Wed Nov 09, 2005 02:17 AM
Re: Webview and Youtube
Posted: Tue Jul 08, 2025 11:18 AM
Thank you guys ;)
I solved this just using an youtube embed link.
oWebView = TWebView2():New( Op )
oWebView:Navigate("https://www.youtube.com/embed/3lgXBk-1SoQ")
oWebView:Run()
Sds,
Vilian F. Arraes
vilian@vfatec.com.br
Belém-Pa-Brazil

Continue the discussion