使嵌入式jwplayer视频自动播放 [英] Make embedded jwplayer video autoplay

查看:608
本文介绍了使嵌入式jwplayer视频自动播放的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我希望我的问题很简单.如何使该视频自动播放?

I am hoping my question is simple. How do I get this video to autoplay?

<p style="text-align: center;"><iframe src="myurl&amp;quality=flv" width="560" height="315" frameborder="0" allowfullscreen=""></iframe></p>

谢谢!

这是一个jwplayer视频

it is a jwplayer video

推荐答案

您应该在jwplayer中激活自动启动功能.而不是使用iframe,请使用带有id的div,然后在一个简短的脚本中使用js配置功能. 示例:

You should activate autostart feature in jwplayer. Instead of using iframe use a div with id and then configure the features with js in a short script. Example:

<div id="myVideo"></div>

<script>
var playerInstance = jwplayer("myVideo");
    playerInstance.setup({
      file: "/videoURL/video.mp4",
      width: 560,
      height: 315,
      autostart: true
    });
</script>

如果您需要在自动启动时将视频静音,则只需添加静音:true 要获取更多信息,您可以在此处查看: https://support.jwplayer.com/customer/portal/articles/1428525-autostarting-on-page-load

if you need to mute the video at autostart then just add mute: true To get more info you can check here: https://support.jwplayer.com/customer/portal/articles/1428525-autostarting-on-page-load

这篇关于使嵌入式jwplayer视频自动播放的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆