8000 Partially rebuild RTCVideoView when renderVideo value changes by ycherniavskyi · Pull Request #1406 · flutter-webrtc/flutter-webrtc · GitHub
[go: up one dir, main page]

Skip to content

Partially rebuild RTCVideoView when renderVideo value changes #1406

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

ycherniavskyi
Copy link
Member
@ycherniavskyi ycherniavskyi commented Aug 1, 2023

When the srcObject value changes (and as a consequence, the renderVideo value of videoRenderer changes) in a place not related to the widget without a setState call (for example within a bloc), the associated RTCVideoView widget does not rebuild. As a result, it continues to display a placeholder or Container widget, even if RTCVideoRenderer.renderVideo is true.

In this pull request, I expand the usage of the ValueListenableBuilder widget, which already exists within RTCVideoView widget. This allows the actual renderVideo value to be respected and triggers a partial rebuild of the RTCVideoView widget when the value changes.

By the way in RTCVideoView for web this done by _onRendererListener callback that call setState.

8000

Copy link
Contributor
@wer-mathurin wer-mathurin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Member
@cloudwebrtc cloudwebrtc left a comment

Choose a reason for hiding this comment

The reason will be 8000 displayed to describe this comment to others. Learn more.

lgtm

@cloudwebrtc cloudwebrtc merged commit 99f8182 into main Aug 3, 2023
@cloudwebrtc cloudwebrtc deleted the fix/rebuild-rtc-video-view-on-render-video-changed branch August 3, 2023 06:14
@cloudwebrtc
Copy link
Member
cloudwebrtc commented Aug 8, 2023

This PR seems to cause flutter Windows (win 10) to not work correctly. To reproduce the steps, run getUserMedia or LoopBack Sample in the example, the randomness of the video rendering component cannot be displayed, use vs2022 debugging, flutter_video_renderer.cc::onFrame is called, but CopyPixelBuffer is not called by flutter, It seems that Texture is not rendering correctly in flutter UI.

@ycherniavskyi
Copy link
Member Author

Integrating. I've tried to investigate in this direction, but technically, this PR only introduced reaction to RTCVideoRenderer.renderVideo changes. Could it be possible that its value is being incorrectly reinitialized on Windows?

@cloudwebrtc
Copy link
Member
cloudwebrtc commented Aug 11, 2023

I have no ideas, I tried some modifications, and only by reverting these changes and the Windows app can work, so I need to temporarily revert this PR until the issue with Windows rendering is resolved.

@ycherniavskyi
Copy link
Member Author

I understand. Unfortunately, I don't have access to a Windows system at the moment. As soon as I obtain access, I will investigate the issue and work on implementing the necessary modification.

SERDUN pushed a commit to WebTrit/flutter-webrtc that referenced this pull request Feb 27, 2025
daniel-g-favoreto-opl pushed a commit to daniel-g-favoreto-opl/flutter-webrtc that referenced this pull request Mar 24, 2025
daniel-g-favoreto-opl pushed a commit to daniel-g-favoreto-opl/flutter-webrtc that referenced this pull request Mar 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants
0