问题
I am hoping my question is simple. How do I get this video to autoplay?
<p style="text-align: center;"><iframe src="myurl&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