Alok
Alok

Reputation: 10614

How to force rendering of video tag content while chrome/electron window is not active for screen sharing?

My website have <video> tag for showing .mp4 video.

I use screen sharing feature of Google Meet and Zoom for my online meeting where I generally share Chrome's window to the audiance.

Everything works well except content of <video> tag when chrome window is not active or hidden behind other windows. I see blank area where <video> tags content should appear.

Case 1: When chrome winodw is active
All content of my website is visible properly to audiance.

Case 2: When chrome's window is hidden behind other applications window
I see everything execept content of <video> tag

Case 3: When Chrome's window is minimized
Nothing is visible to audiance which is ok

I observed this behaviour in both Chrome and Electron window.

I want to override Case 2, So how can I force Chrome and electron window to render content of <video> tag even when their windows are not active.

Upvotes: 0

Views: 670

Answers (1)

Alok
Alok

Reputation: 10614

In Chrome
open chrome://flags and disable #calculate-native-win-occlusion

In electron.js
Pass backgroundThrottling: false in webPreferences while creating new BrowserWindow like

mainWindow = new BrowserWindow({
    width: 1200,
    height: 800,
    webPreferences: {
      backgroundThrottling: false
    }
  });

Upvotes: 4

Related Questions