how to start youtube video automatically in iframe without autoplay?

Asked

Viewed 2,229 times

-9

how could I do that in this code below

<iframe width="420" height="345" src="https://www.youtube.com/embed/Y3wtmZ4Ds3M?autoplay=1" frameborder="0" allowfullscreen></iframe>

no matter the programming language

  • 1

    Already checked your browser console output?

  • Here worked normal.

  • I want to make Fucina without the autoplay that is in the code :C but I think we can not do this

  • Why exactly? What’s the difference with and without?

  • What is the purpose that the autoplay URL does not serve? If to generate views to the video, no changes will work.

  • with autoplay the video is not monetized

  • 2

    @Edu it is no use to want to cheat Google, it is totally possible to distinguish a click made by a human to play a robotic click.

  • pse google is fuck kkk obg by help

  • 4

    I am voting to close this question as out of scope because it violates the terms of use of youtube

Show 4 more comments

1 answer

3

If the intention is to monetize

Even if it is possible to force play by simulating that it was a human who clicked on play in order to monetize Youtube will know the difference, Google is the creator of reCaptcha and now from reCaptcha "invisible", do you really think that you would be able to circumvent something that an entire company with several professionals created to avoid? I believe that.

This is clearly a security to avoid false clicks and they are correct in doing this, the intention to watch the video has to come from the user.

For other uses

Chance Here this video worked normally, however the alternative would be to use the Youtube API, thus:

<!DOCTYPE html>
<html>
  <body>
    <div id="player"></div>

    <script>
    (function () {
        var player;

        window.onYouTubeIframeAPIReady = function() {
            player = new YT.Player('player', {
                height: '390',
                width: '640',
                videoId: 'M7lc1UVf-VE',
                events: {
                    'onReady': onPlayerReady
                }
            });
        };

        // 4. Executa o play quando o video estiver pronto
        function onPlayerReady(event) {
            event.target.playVideo();
        }

        var tag = document.createElement('script');

        tag.src = "https://www.youtube.com/iframe_api";
        var firstScriptTag = document.getElementsByTagName('script')[0];
        firstScriptTag.parentNode.insertBefore(tag, firstScriptTag);
    })();
    </script>
  </body>
</html>

Browser other questions tagged

You are not signed in. Login or sign up in order to post.