【问题标题】:implementing webview to use vimeo embed link实现 webview 以使用 vimeo 嵌入链接
【发布时间】:2020-06-17 07:24:59
【问题描述】:

我在使用下面的嵌入代码通过 webview 嵌入我的 vimeo 视频时遇到问题。

> <iframe src="https://player.vimeo.com/video/{some-video-id}" width="640"
> height="360" frameborder="0" allow="autoplay; fullscreen"
> allowfullscreen></iframe>

谁能帮助我如何将上述代码与 flutter webview 小部件一起使用?

这是我的代码 sn-p

Container(
        child: 
        WebView(
        initialUrl: new Uri.dataFromString("<iframe src="https://player.vimeo.com/video/{some-video-id}" width="640"
          height="360" frameborder="0" allow="autoplay; fullscreen"
          allowfullscreen></iframe> </p>", 
          mimeType: "text/html", encoding: utf8).toString(),
        javascriptMode: JavascriptMode.unrestricted,
        onWebViewCreated: (WebViewController webViewController) {
        _controller.complete(webViewController);
        },
       ),
      ),
    );

????????这根本不起作用。 我正在努力让它工作很长时间,如果有人可以帮助我,这对我来说意味着世界!

谢谢您的宝贵时间!????????

【问题讨论】:

    标签: android flutter dart webview


    【解决方案1】:

    快速浏览一下,我可以看到您的字符串没有正确描述...初始字符串应该包含在 single-quotes 中,以便您可以使用 编写 HTML 属性双引号这样:

    '<iframe src="https://player.vimeo.com/video/{some-video-id}" width="640" height="360"
     frameborder="0" allow="autoplay; fullscreen" allowfullscreen></iframe> </p>'
    

    【讨论】:

    • 天哪,它成功了!我是多么愚蠢忘记将字符串放在单引号内。?谢谢伙计,你拯救了我的一天。
    猜你喜欢
    • 2018-07-29
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-03-19
    • 1970-01-01
    • 2016-11-20
    • 1970-01-01
    • 2017-05-27
    相关资源
    最近更新 更多