0

在我们的主页上,我们有一个 Wistia 嵌入,它以模式打开并在用户单击文本链接时播放。我想创建一个特殊的 URL,我可以将人们发送到该 URL,它将自动打开模式但不开始播放。

html:

<span class="wistia_embed wistia_async_i74bcbgfkm popover=true popoverAnimateThumbnail=true popoverContent=link wistia_embed_initialized" style="display:inline" id="wistia-i74bcbgfkm-1">
  <div id="wistia_36.thumb_container" class="wistia_click_to_play" style="position: relative; display: inline;">
    <a class="text-link" href="#">See the science. Watch video.</a>
  </div>
</span>

JS:

// Auto Play Wistia Video via Specific Link

$(document).ready(function() {

  if(window.location.href.indexOf('#science') != -1) {
    ## open modal?
  }

});

这可能吗?

4

1 回答 1

1

只是偶然发现了同样的问题,这就是我解决它的方法:

⚠️ 请注意始终使用与您的 Wistia 视频相同的 ID。

<script src="https://fast.wistia.com/embed/medias/m1h6asljqh.jsonp"></script>
<script src="https://fast.wistia.com/assets/external/E-v1.js"></script>
<span class="wistia_embed wistia_async_m1h6asljqh popover=true popoverContent=link" style="display:inline">
  <a href="#" class="">What is Marker.io?</a>
</span>

<script>
    window._wq = window._wq || [];

    _wq.push({ id: "m1h6asljqh", onReady: function(video) {

      var video = Wistia.api("m1h6asljqh");

      if(window.location.href.indexOf('#showvideo') != -1) {
        video.popover.show(); // open the popover
        video.play(); // play the video
      }
    }});
</script>

让我知道它是否有帮助!

干杯

于 2018-02-10T14:33:30.893 回答