Bug 235597

Summary: Capturing canvas through local peer connection to video element does not show first frame
Product: WebKit Reporter: Kimmo Kinnunen <kkinnunen>
Component: WebRTCAssignee: Nobody <webkit-unassigned>
Status: RESOLVED CONFIGURATION CHANGED    
Severity: Normal CC: philipp.hancke, prabhat.singh, webkit-bug-importer, youennf
Priority: P2 Keywords: InRadar
Version: Other   
Hardware: Unspecified   
OS: Unspecified   
See Also: https://bugs.webkit.org/show_bug.cgi?id=230623
Attachments:
Description Flags
shows the problem none

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.