1

In the beginning,the video is show,but the it is stop. I want to play the video when browser starts.

 <html>
  <head></head>
    <body>
        <!-- NOTE: ?api=1 and player_id at the end of the URL -->
            <iframe id="player" width="" height="" src="http://player.vimeo.com/video/62207569?api=1&player_id=player" frameborder="0" webkitAllowFullScreen mozallowfullscreen allowFullScreen></iframe>

            <script src="http://a.vimeocdn.com/js/froogaloop2.min.js"></script>

            <script>    
                var player = $f(document.getElementById('player'));
                player.addEvent('ready', function() { 
                player.api('play');
                });
            </script>
    </body>
</html>
jom
  • 56
  • 1
  • 8
  • From what i read [here](https://stackoverflow.com/questions/46949778/is-the-froogaloop2-library-api-still-supported), this API seems not supported anymore. [This link](https://github.com/vimeo/player.js#migrate-from-froogaloop) could help you – Kaddath May 09 '18 at 14:50
  • thanks.I will try to it. – jom May 09 '18 at 15:02
  • I found the solved problem.here is code. – jom May 10 '18 at 09:39
  • – jom May 10 '18 at 09:41
  • this is all – jom May 10 '18 at 09:41

1 Answers1

0

The froogaloop2 js is not working now try to use player.vimeo.com/api/player.js.
Just try like this

<iframe id="player" width="" height="" src="http://player.vimeo.com/video/62207569?api=1&player_id=player" frameborder="0" webkitAllowFullScreen mozallowfullscreen allowFullScreen></iframe>

<script src="https://player.vimeo.com/api/player.js"></script>
<script>
    var frame = document.querySelector('iframe');
    var jqueryPlayer = new Vimeo.Player(frame);
    jqueryPlayer.play();
    console.log('played the video!');
</script>

I have run this code, just check the out put enter image description here

You can refer to this https://github.com/vimeo/player.js#create-a-player for more details.

Bibhudatta Sahoo
  • 4,808
  • 2
  • 27
  • 51