BCX Browser Demo Local Video

Started by MrBcx, June 05, 2024, 01:29:41 PM

Previous topic - Next topic

MrBcx

I originally put this together in 2022 but apparently I forgot to upload it.

Well ... Better late than never.

This demonstration uses my BCX_BROWSER control to load and run a locally stored video.

It might serve as a springboard for other ideas.

https://www.bcxbasiccoders.com/bcxusers/mrbcx/BCX_Browser_Local_Video_Toots_Thielemans.zip


There is a build.bat or you can build it in BED just as easily.

It is a 58MB download -- most of that is the sample video.

Very little code is needed to pull this off:


'************************************************************************
'  BCX Browser Demo by Kevin Diggins   October 2022  ( Public Domain )
'  Load a local File    --    Uses the "EMBED" tag inside demo.html
'************************************************************************
$INCLUDE "BCX_Browser.bi"
GUI "TootsThielemans"
GLOBAL Form      AS HWND  ' Main window
GLOBAL hBrowser  AS HWND  ' Browser window
GLOBAL LocalFile AS STRING


SUB FORMLOAD
    LocalFile = "file:///" + APPEXEPATH$ + "demo.html"
    Form =     BCX_FORM    ("BCX Browser Demo with Toots Thielemans", 0, 0, 380, 300, WS_CAPTION|WS_SYSMENU|WS_MINIMIZEBOX)
    hBrowser = BCX_BROWSER (LocalFile, Form, 0, 20, 20, 350, 250)
    CENTER_TOP (Form)
    SHOW   (Form)
END SUB


BEGIN EVENTS
END EVENTS


SUB CENTER_TOP (hWnd AS HWND)
    DIM Rect AS RECT, MiddleX, w
    GetWindowRect(hWnd, &Rect)
    w = Rect.right-Rect.left
    MiddleX = (GetSystemMetrics(SM_CXSCREEN)*0.5) - (w*0.5)
    SetWindowPos(hWnd, 0, MiddleX, 0, 0, 0, SWP_NOSIZE)
END SUB