Muted Youtube videos

This section is for posting questions which are not directly related to WYSIWYG Web Builder.
Examples of off topics: web server configuration, hosting, programming related questions, third party scripts.

Note that these questions will generally not be answered by the administrators of this forum.
Post Reply
User avatar
colin1661music
 
 
Posts: 113
Joined: Sun May 31, 2015 3:49 pm
Location: London
Contact:

Muted Youtube videos

Post by colin1661music »

Autoplay youtube videos muted
User avatar
Pablo
 
Posts: 22489
Joined: Sun Mar 28, 2004 12:00 pm
Location: Europe
Contact:

Re: Muted Youtube videos

Post by Pablo »

As far as I know there no mute for YouTube videos:
https://developers.google.com/youtube/p ... ters?hl=en
User avatar
colin1661music
 
 
Posts: 113
Joined: Sun May 31, 2015 3:49 pm
Location: London
Contact:

Re: Muted Youtube videos

Post by colin1661music »

Hi Pablo,

I'm keep trying to make this code work in WYSIWYG

<div id="muteYouTubeVideoPlayer"></div>

<script async src="https://www.youtube.com/iframe_api"></script>
<script>
function onYouTubeIframeAPIReady() {
var player;
player = new YT.Player('muteYouTubeVideoPlayer', {
videoId: 'YOUR_VIDEO_ID', // YouTube Video ID
width: 560, // Player width (in px)
height: 316, // Player height (in px)
playerVars: {
autoplay: 1, // Auto-play the video on load
controls: 1, // Show pause/play buttons in player
showinfo: 0, // Hide the video title
modestbranding: 1, // Hide the Youtube Logo
loop: 1, // Run the video in a loop
fs: 0, // Hide the full screen button
cc_load_policy: 0, // Hide closed captions
iv_load_policy: 3, // Hide the Video Annotations
autohide: 0 // Hide video controls when playing
},
events: {
onReady: function(e) {
e.target.mute();
}
}
});
}

// Written by @labnol
</script>
User avatar
Pablo
 
Posts: 22489
Joined: Sun Mar 28, 2004 12:00 pm
Location: Europe
Contact:

Re: Muted Youtube videos

Post by Pablo »

I'm sure but I cannot help you with third party code, for me it may also take serveral hours to figure out how this works.
User avatar
BaconFries
 
 
Posts: 5648
Joined: Thu Aug 16, 2007 7:32 pm

Re: Muted Youtube videos

Post by BaconFries »

Try the following:
This part isn't really required as you will or most likely be using the YouTube object in the programme.

Code: Select all

<div id="muteYouTubeVideoPlayer"></div>
This part you can add in Page HTML between <head></head>tags*
1) Change the following muteYouTubeVideoPlayer to the <div> ID </div> of the YouTube object which is wb_YouTube1
2) Change player = new YT.Player('muteYouTubeVideoPlayer' to
player = new YT.Player('YouTube1'
3) Change videoId: 'YOUR_VIDEO_ID', to the ID of your YouTube video.
Between <head></head>

Code: Select all

<script async src="https://www.youtube.com/iframe_api"></script>
<script>
function onYouTubeIframeAPIReady() {
var player;
player = new YT.Player('muteYouTubeVideoPlayer', {
videoId: 'YOUR_VIDEO_ID', // YouTube Video ID
width: 560, // Player width (in px)
height: 316, // Player height (in px)
playerVars: {
autoplay: 1, // Auto-play the video on load
controls: 1, // Show pause/play buttons in player
showinfo: 0, // Hide the video title
modestbranding: 1, // Hide the Youtube Logo
loop: 1, // Run the video in a loop
fs: 0, // Hide the full screen button
cc_load_policy: 0, // Hide closed captions
iv_load_policy: 3, // Hide the Video Annotations
autohide: 0 // Hide video controls when playing
},
events: {
onReady: function(e) {
e.target.mute();
}
}
});
}
// Written by @labnol 
</script>
All other parameters you can play around with yourself.
Post Reply