Showing posts with label youtube. Show all posts
Showing posts with label youtube. Show all posts

How to Embed a YouTube Video with Sound Muted

It is easy to embed YouTube videos in your website. You grab the default IFRAME embed code, paste it anywhere inside your web page and you’re done. YouTube offers basic customization – you can modify the player dimensions or hide the YouTube branding – but if you would like to exercise more control over the  behavior of the embedded player, YouTube Player API is the way to go.
This tutorial explains how you can embed a YouTube video that will automatically play when the web page is loaded but with muted audio.
For instance, a products website may use short screencasts to highlight features and these videos will autoplay when the page is loaded. The volume is however set to 0 and the user can manually click to un-mute the video. Similarly, if you are using YouTube video backgrounds, it makes more sense to embed muted videos that run in a loop.

Embed YouTube Player with Autoplay and Sound Muted

See the demo page to get an idea of what we are trying to do here. The page loads, the video plays but with the audio slide is all the way down.
This is easy. Go the YouTube video page and note down the ID of the video from the URL. For instance, if the YouTube video link is http://youtube.com/watch?v=xyz-123, the video id is xyz-123. Once you have the ID, all you have to do is replace YOUR_VIDEO_ID in the following code with that string.


  1. <div id="muteYouTubeVideoPlayer"></div>
  2.  
  3. <script async src="https://www.youtube.com/iframe_api"></script>
  4. <script>
  5. function onYouTubeIframeAPIReady() {
  6. var player;
  7. player = new YT.Player('muteYouTubeVideoPlayer', {
  8. videoId: 'YOUR_VIDEO_ID', // YouTube Video ID
  9. width: 560, // Player width (in px)
  10. height: 316, // Player height (in px)
  11. playerVars: {
  12. autoplay: 1, // Auto-play the video on load
  13. controls: 1, // Show pause/play buttons in player
  14. showinfo: 0, // Hide the video title
  15. modestbranding: 1, // Hide the Youtube Logo
  16. loop: 1, // Run the video in a loop
  17. fs: 0, // Hide the full screen button
  18. cc_load_policty: 0, // Hide closed captions
  19. iv_load_policy: 3, // Hide the Video Annotations
  20. autohide: 0 // Hide video controls when playing
  21. },
  22. events: {
  23. onReady: function(e) {
  24. e.target.mute();
  25. }
  26. }
  27. });
  28. }
  29.  
  30. // Written by @Allsoftlearn
  31. </script>
Next place the edited code in your web page and the embedded video would automatically play but the sound is muted.
You can further customize the player by modifying the various player variables as commented in the code. For instance, if you set loop as 1, the video will play in a loop. Set fs to 1 to show the fullscreen button inside the video player. Internally, the player is embedded using the YouTube IFRAME API. When the page is loaded, the onReady event runs that mutes the video.

                   The embedded YouTube video will autoplay, but muted.

YouTube - How To Upload Custom Thumbnails

Each time you upload a video, YouTube automatically generates a set of three thumbnails for you to choose from. You can stick with YouTube's proposals or upload a custom thumbnail, preferably a beautiful picture or photo you have prepared beforehand. 

Prerequisites

- The popular image formats (optimized for the web) are supported: JPEG or PNG
- The maximum file size is 2MB

Upload your thumbnail

Sign-in to your YouTube channel and then open the Creator Studio > Video Manager > Videos


Select the desired video and then click on the Edit button > Info and Settings tab: 


Click on the Custom Thumbnail button displayed, browse for the image you want to use and click on Save changes


How to Block a User on YouTube

Someone keeps posting pesky comments on your YouTube channel? This guide explains how to block undesired users on YouTube: 

Click on the user's name to access his channel homepage. Navigate to theAbout tab, click on the Flag menu and then select Block User from the list:


YouTube displays a small warning message: Are you sure you want to block this user?. Click on Submitto proceed: 


That's it; the blocked user won't be able to contact you through private message or comment on your channel.

Download the MP4 Version of the Videos Published on Your YouTube Channel

You want to download a video published on your YouTube channel for offline editing? You want to upload the video on another streaming platform? Here's a simple trick to retrieve the MP4 version of videos published on your YouTube channel without the need for you use any third party software. The procedure is as follows: 

Sign-in to your YouTube account and click on your profile picture located top-right > Creator Studio. Go to the Video Manager section and select the desired video. Click on the small arrow next to the Edit button and then select Download MP4

Select the location to save the file and then click on OK.