This thread is over two years old and may be outdated. Please create a new thread if you need help, or email us if you have an active Premium license.

Replies

10
  1. Andrew Misplon Staff 10 years, 3 months ago

    Hi Rishi

    Could you confirm the above URL is correct? I’m getting a ERR_NAME_NOT_RESOLVED.

    Thanks

  2. Andrew Misplon Staff 10 years, 3 months ago

    Looks like it can be done from the embed code. Example:

    <iframe width="260" height="195" src="//www.youtube.com/embed/h3P1OR9gg2Y?rel=0&autoplay=1" frameborder="0" allowfullscreen volume="0"></iframe>

    Ref: https://productforums.google.com/forum/#!topic/youtube/XS5_P_9OXCo

  3. WebDudes Support 10 years, 3 months ago
  4. Andrew Misplon Staff 10 years, 3 months ago

    Thanks :) Please, check out the above URL. I’ve fixed the code above too. It’s now an example.

  5. Andrew Misplon Staff 10 years, 3 months ago
    &autoplay=1
    volume="0"

    Those are the important parts.

  6. WebDudes Support 10 years, 3 months ago

    Hi Andrew, apparently volume=”0″ is not working anymore, but the other code works.

  7. WebDudes Support 10 years, 3 months ago

    Another observation is that if I try to unmute the video manually while playing it goes back to mute. :)

    Weird

  8. Andrew Misplon Staff 10 years, 3 months ago

    Thanks.

    Unfortunately, I don’t see volume on the list of parameters here:
    https://developers.google.com/youtube/player_parameters?hl=en

  9. Akshyaa.com Know The World 9 years, 6 months ago

    I found a url where much of youtube url properties are explained there , i think its useful for you link : Embed youtube video sound mute

  10. Andrew Misplon Staff 9 years, 2 months ago

    Hi everyone :)

    Unfortunately, this task isn’t currently possible using standard YouTube query parameters. However, we can achieve by inserting the following into the Text tab of the WordPress editor OR into a Text widget or SiteOrigin Editor widget (Text tab):

    <!-- 1. The <iframe> (and video player) will replace this <div> tag. -->
    <div id="player"></div>
    <script>
          // 2. This code loads the IFrame Player API code asynchronously.
          var tag = document.createElement('script');
          tag.src = "https://www.youtube.com/iframe_api";
          var firstScriptTag = document.getElementsByTagName('script')[0];
          firstScriptTag.parentNode.insertBefore(tag, firstScriptTag);
          // 3. This function creates an <iframe> (and YouTube player)
          //    after the API code downloads.
          var player;
          function onYouTubeIframeAPIReady() {
            player = new YT.Player('player', {
              height: '315',
              width: '560',
              videoId: 'ilrvQyRF3_g',
              events: {
                'onReady': onPlayerReady,
                'onStateChange': onPlayerStateChange
              }
            });
          }
          // 4. The API will call this function when the video player is ready.
          function onPlayerReady(event) {
               event.target.setVolume(0);
           event.target.playVideo();
          }
          // 5. The API calls this function when the player's state changes.
          //    The function indicates that when playing a video (state=1),
          //    the player should play for six seconds and then stop.
          var done = false;
          function onPlayerStateChange(event) {
            if (event.data == YT.PlayerState.PLAYING && !done) {
        //      setTimeout(stopVideo, 6000);
                      done = true;
            }
               event.target.setVolume(0);
          }
    </script>

    The following values in the above example should be located and replaced with your own unique values:

    height: '315',
    width: '560',

    Replace the height value and the width value. To get standard sizes, go to your YouTube video and click on ShareEmbedShow MoreVideo Size. Only replace 315 and 560 in the code snippet.

    The next line is the video ID:

    videoId: 'ilrvQyRF3_g',

    The video ID can be easily located in the video URL on YouTube. For example: https://www.youtube.com/watch?v=ilrvQyRF3_g. The ID is:

    v=ilrvQyRF3_g

    Only replace the ID, leaving the inverted commas in place.

    Credit: https://productforums.google.com/forum/#!topic/youtube/XS5_P_9OXCo

Replies on this thread are closed.

Please create a new thread if you have a question, or purchase a SiteOrigin Premium license if you need one-on-one email support.

Have a different question or issue?

Start New Thread