Add pop-out and full screen to the stream's right-click menu
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -124,7 +124,12 @@
|
|||||||
|
|
||||||
// Right-click on the picture
|
// Right-click on the picture
|
||||||
let showStats = $state(false);
|
let showStats = $state(false);
|
||||||
const streamMenu = (e: MouseEvent) => menu.show(e, [{ label: 'Stats for nerds', checked: showStats, action: () => (showStats = !showStats) }]);
|
const streamMenu = (e: MouseEvent) => menu.show(e, [
|
||||||
|
{ label: 'Open in a separate window', action: popOut },
|
||||||
|
{ label: 'Full screen', action: fullscreen },
|
||||||
|
{ separator: true, label: '' },
|
||||||
|
{ label: 'Stats for nerds', checked: showStats, action: () => (showStats = !showStats) }
|
||||||
|
]);
|
||||||
|
|
||||||
let frame = $state<HTMLElement>();
|
let frame = $state<HTMLElement>();
|
||||||
function fullscreen() {
|
function fullscreen() {
|
||||||
|
|||||||
@@ -169,7 +169,9 @@ try {
|
|||||||
|
|
||||||
// The large picture can move to a window of its own
|
// The large picture can move to a window of its own
|
||||||
const opened = bob.app.waitForEvent('window');
|
const opened = bob.app.waitForEvent('window');
|
||||||
await view.getByRole('button', { name: 'Open in a separate window' }).click();
|
// From the right-click menu on the picture
|
||||||
|
await bob.page.locator('.spot video').click({ button: 'right' });
|
||||||
|
await bob.page.getByRole('menuitem', { name: 'Open in a separate window' }).click();
|
||||||
const streamWindow = await opened;
|
const streamWindow = await opened;
|
||||||
await streamWindow.waitForFunction(() => (document.querySelector('video') as HTMLVideoElement | null)?.videoWidth! > 0, null, { timeout: 15000 });
|
await streamWindow.waitForFunction(() => (document.querySelector('video') as HTMLVideoElement | null)?.videoWidth! > 0, null, { timeout: 15000 });
|
||||||
await view.getByText('Shown in a separate window.').waitFor();
|
await view.getByText('Shown in a separate window.').waitFor();
|
||||||
|
|||||||
Reference in New Issue
Block a user