0

我在我的flutter应用程序中使用“webview_flutter:^1.0.7”插件来打开webview,但是当网站在屏幕上的任意位置单击并以全屏打开后启动视频时出现问题。如何在不禁用 javascript 的情况下禁用它?我想播放视频但不是全屏

我不能使用“AutoMediaPlaybackPolicy”,因为有一个动作

4

1 回答 1

1

一种方法是更新 html 文件:

    String hmtlCode = (await http.get(initialUrl)).body;
    # edit this code (either append to string, or find and replace)

https://itqna.net/questions/80033/how-disable-full-screen-html5-video-any-browser(html示例如何禁用全屏)

然后将此 html 提供给 webview

String hmtlCode = ....;
String url = Uri.dataFromString(hmtlCode, mimeType: 'text/html', encoding: Encoding.getByName('utf-8')).toString();
WebView(
   initialUrl: url,
   ...
于 2021-02-16T19:26:52.857 回答