0

在 wistia JS API 的文档中,它只是说_all如果您想点击页面上的所有视频,请在带有属性 ID 和标志的 iFrame 下调用它。

我正在尝试根据文档获取使用视频 API 记录的基本控制台日志。控制台日志不起作用,文档也很难解释原因。

我在这里关注文档:

https://wistia.com/support/developers/player-api

这是我下面的代码:

<iframe title="Demo4 Video" class="wp-embedded-content" sandbox="allow-scripts" security="restricted" src="https://fast.wistia.net/embed/iframe/zz038smet7?dnt=1#?secret=L8pVNj0787" data-secret="L8pVNj0787" frameborder="0" scrolling="no" width="640" height="360"></iframe>
            <script src="//fast.wistia.net/assets/external/E-v1.js"></script>
            <script>
            window._wq = window._wq || [];
                _wq.push({ id: "_all", onReady: function(video) {
                console.log("I got a handle to the video!", video);
            }});
          </script>

它直接在文档中说:

完全相同的语法也适用于 iframe 嵌入:

我的 iFrame 参考匹配,我正在加载库fast.wistia.net/assets/external/E-v1.js并使用_all标志来抓取所有视频。但我没有看到控制台日志输出。

我究竟做错了什么?

4

1 回答 1

1

wistia api 需要 iFrame 上的一个类wistia_embed才能工作:

<iframe title="Demo4 Video" class="wp-embedded-content wistia_embed" sandbox="allow-scripts" security="restricted" src="https://fast.wistia.net/embed/iframe/zz038smet7?dnt=1#?secret=L8pVNj0787" data-secret="L8pVNj0787" frameborder="0" scrolling="no" width="640" height="360"></iframe>
        <script src="//fast.wistia.net/assets/external/E-v1.js"></script>
        <script>
        window._wq = window._wq || [];
            _wq.push({ id: "_all", onReady: function(video) {
            console.log("I got a handle to the video!", video);
        }});
      </script>
于 2019-11-19T21:41:03.730 回答