some times camera preview freezing without touch on andoid webview app(not mobile webbrowser)

huangapple go评论96阅读模式
英文:

some times camera preview freezing without touch on andoid webview app(not mobile webbrowser)

问题

有时,我的Android WebView应用程序中的相机预览会在没有触摸的情况下冻结(不是在移动网页浏览器中)。请查看下面的视频。我认为我需要修改我的Android程序来解决这个问题(可能是由于低电池问题),但我不知道该怎么做。

视频链接:https://www.youtube.com/shorts/gS0W_ku6t7E

英文:

Sometimes the camera preview is freezing without being touched in my Android WebView app (not in a mobile web browser). Please see the below video. I think I have to modify my Android program to solve this issue (possibly due to low battery problems), but I don't know what to do.

Link to video: https://www.youtube.com/shorts/gS0W_ku6t7E

答案1

得分: 1

请参考 https://github.com/react-native-webview/react-native-webview/issues/2698

建议添加一个旋转器/动画以保持视频流的实时性。

我在我的项目上测试过,对我有效。

<%-- 修复 webview 摄像头视频冻结的 bug --%>
<div style="background:linear-gradient(rgba(0,0,0,0.9), rgba(0,0,0,0.9)), url('../../Media/loading-small.gif') no-repeat center;"> </div>
英文:

Please refer https://github.com/react-native-webview/react-native-webview/issues/2698

Suggested to add a spinner/animation helps to keep the video feed live.

I tested it on my project and it works for me.

<%-- Fixed webview bug camera video frozen --%>
<div style="background:linear-gradient(rgba(0,0,0,0.9), rgba(0,0,0,0.9)), url('../../Media/loading-small.gif') no-repeat center;"> </div>

huangapple
  • 本文由 发表于 2023年6月16日 11:10:03
  • 转载请务必保留本文链接:https://go.coder-hub.com/76486729.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定