Misc

Casting - Stream a Tab or Desktop to a Cast Device

Casting a Tab

CastTab(deviceNameOrId) starts casting the active browser tab to the named Cast sink. The device name must match exactly what appears in Chrome's Cast menu. The workflow continues executing while casting is active. StopCasting() ends the Cast session.

GPAL.Browser

.WithUseAutomationEngine(

AutomationEngine.PuppeteerPort)

.GoTo("https://your-presentation.com")

.CastTab("Living Room TV")

.WaitFor(30_000)

// run workflow steps while casting...

.StopCasting()

.Close();

NOTE

Chrome Cast is not accessible via JavaScript -- that access is blocked deliberately to prevent any page from hijacking the Cast session. Because OttoMagic operates through the browser extension via JavaScript, it cannot reach the Cast API. Puppeteer and Selenium both use CDP, which has the access needed.

Casting the Full Desktop

CastDesktop(deviceNameOrId) routes the entire screen to the target device -- not just the browser tab. This is useful for presenting any on-screen content, not only browser pages. Workflow automation continues running in the background while the desktop is being cast.

GPAL.Browser

.WithUseAutomationEngine(

AutomationEngine.PuppeteerPort)

.GoTo("https://example.com")

.CastDesktop("Conference Room Display")

.WaitFor(30_000)

.StopCasting()

.Close();

💬 Ask GPAL