- From: guest271314 via GitHub <sysbot+gh@w3.org>
- Date: Sat, 05 Sep 2020 22:14:02 +0000
- To: public-webrtc-logs@w3.org
Workaround to capture "Entire Screen" at Chromium by entering fullscreen using `ImageCapture.grabFrab()` and `ImageBitmapRenderingContext` ``` onclick = e => navigator.mediaDevices.getDisplayMedia({video: true}) .then(async stream => { await document.documentElement.requestFullscreen(); const [track] = stream.getVideoTracks(); const canvas = document.createElement('canvas'); canvas.width = document.documentElement.clientWidth; canvas.height = document.documentElement.clientHeight; const ctx = canvas.getContext('bitmaprenderer'); const canvasStream = canvas.captureStream(); const [canvasTrack] = canvasStream.getVideoTracks(); track.onmute = track.onended = e => console.log(e); canvasTrack.onmute = canvasTrack.onended = e => console.log(e); // wait for prompt to fade out await new Promise(resolve => setTimeout(resolve, 7000)); const imageCapture = new ImageCapture(track); const bitmap = await imageCapture.grabFrame(); const frame = await createImageBitmap(bitmap); ctx.transferFromImageBitmap(frame); canvasTrack.requestFrame(); track.stop(); canvasTrack.stop(); document.exitFullscreen(); document.body.appendChild(canvas); }); ``` -- GitHub Notification of comment by guest271314 Please view or discuss this issue at https://github.com/w3c/mediacapture-screen-share/issues/145#issuecomment-687669775 using your GitHub account -- Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config
Received on Saturday, 5 September 2020 22:14:04 UTC