Im trying to display the video from my webcam by using the HtmlElementView
flutter widget to capture a snapshot and display it on the previous screen with the help of Image.memory()
. It works the first time I access the webcam i.e HtmlElementView
displays the video stream and can view the captured snapshot. However, on the next access the HtmlElementView
widget does not display anything but capturing the snapshot yields the correct image.
I stop all the tracks after each capture (thereby switching off the webcam) and pop the route and reinitialize and register the view factory each time the widget is built.
I'm guessing the HtmlElementView
widget isn't being disposed off correctly by flutter ?
The gist file to the sample code: https://gist.github.com/CalvinGonsalves/1a8c7a674e3c6647f3e76866bb893076
I have been using flutter run -d chrome on AndroidStudio
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…