Webcam only works when I lock and unlock smartphone #1277
-
Hi everyone hope you are fine! I'm doing a simple demo app in Flutter using the plugin. When I test using Chrome its works just fine, in emulator the camera image never shows, and when I test on my Android smartphone the camera image only appears when I lock (power button) and unlock (power button again) the device. I am using Windows 11, Android Studio 2022.1.1 Patch 1, Flutter 3.7.5, Dart 2.19.1 OpenJDK 19.0.2 and flutter_webrtc 0.9.23. Right now my code is the following: ` import 'package:flutter/material.dart'; void main() { class MyApp extends StatelessWidget { // This widget is the root of your application. class MyHomePage extends StatefulWidget { final String title; @OverRide class _MyHomePageState extends State { void initRenderers() async { _getUserMedia() async {
} @OverRide @OverRide @OverRide
} ` |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
This seems to be related to flutter state management, you can try _localVideoRenderer.srcObject = stream;
setState(() {
}); |
Beta Was this translation helpful? Give feedback.
This seems to be related to flutter state management, you can try
Add setState after
srcObject = stream;