Welcome toVigges Developer Community-Open, Learning,Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
513 views
in Technique[技术] by (71.8m points)

flutter - HtmlElementView Widget does not display video after navigating back to the page/dialog

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


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
等待大神答复

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to Vigges Developer Community for programmer and developer-Open, Learning and Share
...