Bug 235597 - Capturing canvas through local peer connection to video element does not show first frame
Summary: Capturing canvas through local peer connection to video element does not show...
Status: RESOLVED CONFIGURATION CHANGED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebRTC (show other bugs)
Version: Other
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2022-01-25 10:42 PST by Kimmo Kinnunen
Modified: 2023-05-15 04:40 PDT (History)
4 users (show)

See Also:


Attachments
shows the problem (282.34 KB, image/png)
2022-01-25 10:42 PST, Kimmo Kinnunen
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Kimmo Kinnunen 2022-01-25 10:42:23 PST
Created attachment 449941 [details]
shows the problem

Capturing canvas through local peer connection to video element does not show first frame

1) Load https://youennf.github.io/webrtc-tests/src/content/capture/canvas-pc/
2) See teapot and black rectangle

expected:
2) See teapot and teapot
Comment 1 youenn fablet 2022-01-25 23:56:40 PST
That is worth investigating, Safari and Chrome do not show the first frame but Firefox does.
Looking at Safari, the peer connection does not seem to send the first frame so it seems the issue is on sender side.

It might be a race between the time the track is generating the frame and the time the  peer connection is set up, in which case there might not be anything for us to change.
Comment 2 :fippo 2022-01-31 03:30:55 PST
This particular sample has been long haunted by autoplay issues.
Do you get the appropriate amount of teapots after running
  document.querySelector('video').play()
? Works in Chrome at least (which initially has .paused set to true the element)
Comment 3 Radar WebKit Bug Importer 2022-02-01 10:43:16 PST
<rdar://problem/88336856>
Comment 4 :fippo 2022-03-15 01:05:59 PDT
  https://webrtc.github.io/samples/src/content/capture/canvas-pc/
has been updated with some  heuristics to detect autoplay woes.

Oddly dragging then only seems to show the first frame and then one needs to double-tap the right/lower teapot to make it update once?
Comment 5 youenn fablet 2023-05-15 04:40:21 PDT
I retried today using https://webrtc.github.io/samples/src/content/capture/canvas-pc/ and all three browsers seem to behave the same now (teapot only appears when a redraw is done).
Closing.