Home Upgrade Search Memberlist Extras Hacker Tools Award Goals Help Wiki Contact

Joomla 

Embeded youtube video mute

I'm looking for a way for the embeded youtube videos to start as already muted, then if someone wishes to enable sound, any idea if this is possible?
[Image: 6jk60JG.gif]

I don't think it can be done. You can auto play videos with a 3rd party player but muting it not sure.
Hey!
I just tried this code and it works to 100% :)
Feel free to pm me if you have any question.

what the script does:
Autoplay = ON
Muted = ON

Code
<script src="http://www.google.com/jsapi"></script>
    <script src="http://ajax.googleapis.com/ajax/libs/swfobject/2.1/swfobject.js"></script>
    <div id="ytapiplayer">You need Flash player 8+ and JavaScript enabled to view this video.</div>
    <script type="text/javascript">
      google.load("swfobject", "2.1");
      function onYouTubePlayerReady(playerId) {
      ytplayer = document.getElementById("myytplayer");
      ytplayer.playVideo();
      ytplayer.mute();
      }
      var params = { allowScriptAccess: "always" };
      var atts = { id: "myytplayer" };
      swfobject.embedSWF("http://www.youtube.com/v/YOUR-CODE-HERE?enablejsapi=1&playerapiid=ytplayer&allowFullScreen=true&version=3",
      "ytapiplayer", "290", "160", "8", null, null, params, atts)
    </script>

Replace YOUR-CODE-HERE
with

http://www.youtube.com/watch?v=0a5WyAjL1MM

good luck!

0ne_Freed0m 🤝
“Death walks among us”
(Feb 28, 2014 03:47 PM)x0n Wrote:  Hey!
I just tried this code and it works to 100% :)
Feel free to pm me if you have any question.

what the script does:
Autoplay = ON
Muted = ON

Code
<script src="http://www.google.com/jsapi"></script>
    <script src="http://ajax.googleapis.com/ajax/libs/swfobject/2.1/swfobject.js"></script>
    <div id="ytapiplayer">You need Flash player 8+ and JavaScript enabled to view this video.</div>
    <script type="text/javascript">
      google.load("swfobject", "2.1");
      function onYouTubePlayerReady(playerId) {
      ytplayer = document.getElementById("myytplayer");
      ytplayer.playVideo();
      ytplayer.mute();
      }
      var params = { allowScriptAccess: "always" };
      var atts = { id: "myytplayer" };
      swfobject.embedSWF("http://www.youtube.com/v/YOUR-CODE-HERE?enablejsapi=1&playerapiid=ytplayer&allowFullScreen=true&version=3",
      "ytapiplayer", "290", "160", "8", null, null, params, atts)
    </script>

Replace YOUR-CODE-HERE
with

http://www.youtube.com/watch?v=0a5WyAjL1MM

good luck!

0ne_Freed0m 🤝

That's amazing, thank you.

How about having autoplay off?
[Image: 6jk60JG.gif]

If you want autoplay off, Simply Delete

ytplayer.playVideo();

From the code :)

Enjoy

Your friend 0ne_Freed0m 🤝
“Death walks among us”


Possibly Related Threads...
Thread / Author Replies Views Last Post
by cody_8611Jul 31, 2016 03:35 PM 0 93 Jul 31, 2016 03:35 PM
Last Post: cody_8611
by Haste.Aug 3, 2012 12:08 PM 0 61 Aug 3, 2012 12:08 PM
Last Post: Haste.
by tylergtylergMar 12, 2012 11:52 AM 10 255 Mar 12, 2012 11:52 AM
Last Post: tylergtylerg