Make embedded jwplayer video autoplay

帅比萌擦擦* 提交于 2019-12-11 23:32:13

问题


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>

Thank you!

EDIT: it is a jwplayer video


回答1:


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>

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




回答2:


If you are using youtube there is an autoplay parameter

<iframe width="640" height="360" src="[YouTube Video URL]?rel=0&autoplay=1" frameborder="0" allowfullscreen></iframe>


来源:https://stackoverflow.com/questions/35617009/make-embedded-jwplayer-video-autoplay

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!