TheLeastofThese
TheLeastofThese

Reputation: 49

Make embedded jwplayer video autoplay

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

Upvotes: 1

Views: 8896

Answers (2)

Iman Sedighi
Iman Sedighi

Reputation: 8152

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

Upvotes: 1

user3456978
user3456978

Reputation: 248

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>

Upvotes: 0

Related Questions