Embedded Code for YouTube Video : What can you control


embed a youtube video

Most people learn better with visuals, so on your website it is important to add videos, created either by yourself or others to add more value.

But how do you do it and what control do you have over it….

Embedding a video onto your site can help with visitor retainment, and also help explain complicated things with visuals. It reduces the page speed load times, and allows you two channels of promotion.

How to embed a YouTube video Iframe code

Adding visuals to your website to explain what you are talking about can be very useful.

As you are creating your blog  adding placeholders, with a description,  to say this is where you want an image, video or other sensory item will remind you to add the relevant media…

For example ‘Add video here – unboxing an anet a8 3d printer…’

So off to Youtube to find the video….

Using the search box at the top there are a number of videos returned…

Choosing a video with a high number of views – and a lot of likes

Once you have reviewed it and want to embed it on your site click on the share symbol under the video

youtube share button

Then click on embed

youtube embed button

You click on copy the embed code on youtube to place it  onto your clipboard and return to your post.

copy the code

In wordpress block editor it has a video block where you place the url of the video, but i still prefer the control i have with the iframe version – so it will be a HTML block

Or in the classic editor – click on the text tab at the upper right corner.

And paste the code for the video in…

<iframe width=”560″ height=”315″ src=”https://www.youtube.com/embed/xA5Z2VFmRfg” frameborder=”0″ allowfullscreen></iframe>

Click on the visual tab in classic editor.

For the block editor i placed the html block within three columns – into the middle one.

This way i have control over the size of the video.

code added to columns

This will now embed the video into your website.

To check this you can click on preview and it will open a new tab in your browser.

Now you can navigate to the video and click on play…

 

Is there anything extra you can do

When youtube was more independent – before google bought it – there were a few parameters you could easily add when grabbing the code.

But google removed a lot of those…

However there are a few left to play with and we go through those below….

Autoplay

I thought they had removed this one as it broke some rules – but it appears to still be there and operational.

So at the point in the code where the video src is…then add ?autoplay=1 before the closing ” as shown below…

<iframe width=”560″ height=”315″ src=”https://www.youtube.com/embed/xA5Z2VFmRfg?autoplay=1” frameborder=”0″ allowfullscreen></iframe>

And this will autoplay as soon as the page has loaded…

Captions

You may want closed captions to be automatically shown if the sound is expected to be off…

This can be achieved with adding cc_load_policy=1

<iframe width=”560″ height=”315″ src=”https://www.youtube.com/embed/xA5Z2VFmRfg?cc_load_policy=1” frameborder=”0″ allowfullscreen></iframe>

So now on your videos you can start them with ‘Make sure you turn on the sound’

Controls

If you want people to play the video all the way through and have minimum distractions on the video you can turn off the lower controls.

This is achieved with the commands ‘controls=0’

<iframe width=”560″ height=”315″ src=”https://www.youtube.com/embed/xA5Z2VFmRfg?controls=0” frameborder=”0″ allowfullscreen></iframe>

But if they know the keyboard shortcuts then they are still active…

Keyboard controls

You may have been playing with youtube videos long enough to get used to the keyboard controls if not here is a quick rundown

  • Spacebar or [k]: Play / Pause
  • Arrow Left: Jump back 5 seconds in the current video
  • Arrow Right: Jump ahead 5 seconds in the current video
  • Arrow Up: Volume up
  • Arrow Down: Volume Down
  • [f]: Toggle full-screen display
  • [j]: Jump back 10 seconds in the current video
  • [l]: Jump ahead 10 seconds in the current video
  • [m]: Mute or unmute the video
  • [0-9]: Jump to a point in the video. 0 jumps to the beginning of the video, 1 jumps to the point 10% into the video, 2 jumps to the point 20% into the video, and so forth.

But what if you don’t want your viewers to use any of these…

Then there is a command to add to the iframe to control this…disablekb=1

<iframe width=”560″ height=”315″ src=”https://www.youtube.com/embed/xA5Z2VFmRfg?disablekb=1” frameborder=”0″ allowfullscreen></iframe>

If you combine this with the controls above then they have the best viewing …and you have the longest views…

Finish time

Maybe you only want to show a small part of the video- maybe that is the only bit that is relevant…

Then you can stop it when you want to…with the command ‘end’ followed by the number of seconds from the start of the video…

<iframe width=”560″ height=”315″ src=”https://www.youtube.com/embed/xA5Z2VFmRfg?end=25” frameborder=”0″ allowfullscreen></iframe>

This would stop the video after 25 seconds…

Almost remove branding

And that annoying large youtube logo to the bottom right…can you do anything about that …

Well …yes….

If you add ‘modestbranding=1’ then the large one will disappear, giving you even cleaner lines…

<iframe width=”560″ height=”315″ src=”https://www.youtube.com/embed/xA5Z2VFmRfg?modestbranding=1” frameborder=”0″ allowfullscreen></iframe>

Combine this with the controls and disablekb and there will be no stopping your video…

What about the title – almost remove branding….

If you pause the video and hover the mouse over it then you get a youtube logo in the upper right hand corner…..

But it is better than nothing….

Other videos at the end

Before google took over youtube the one thing they did allow you was to remove any related videos from being shown at the end.

Now google doesn’t allow this – some  marketers have abandoned yt in favor of other video hosting services like vimeo or others.

But if you want to show a yt video then what can you do….

Well at the moment the best you can do is to keep the related videos on that channel with the rel=0

<iframe width=”560″ height=”315″ src=”https://www.youtube.com/embed/xA5Z2VFmRfg?rel=0” frameborder=”0″ allowfullscreen></iframe>

Now when the video finishes at least the videos will be relevant to the one just seen…

Start time

And along with the end time you can start the video when you want to with this command…

Start=xx where xx is the number of seconds from the start of the video you want it to begin from.

<iframe width=”560″ height=”315″ src=”https://www.youtube.com/embed/xA5Z2VFmRfg?start=5” frameborder=”0″ allowfullscreen></iframe>

This will begin playing the video 5 seconds from start of the video…

Combining this with the end command will play just part of a video…

<iframe width=”560″ height=”315″ src=”https://www.youtube.com/embed/xA5Z2VFmRfg?start=5&end=15” frameborder=”0″ allowfullscreen></iframe>

This will begin playing at 5 seconds in and stop at 15 seconds…

What about combining commands

You have been shown this in some of the examples above…

Using the & symbol between commands will string them together.

Allowing you to autoplay from 5 seconds to 15 seconds with no controls or keyboard control and modest branding to remove the yt logo – with closed caption on…

<iframe width=”560″ height=”315″ src=”https://www.youtube.com/embed/xA5Z2VFmRfg?autoplay=1&cc_load_policy=1&start=5&end=15&controls=0&disablekb=1&modestbranding=1&rel=0” frameborder=”0″ allowfullscreen></iframe>

It is a long string after the video src, but it will do what you want.

So you now know what you can do with your embedded videos, with all of the current options and how to combine them to use the video on your website as a marketing tool.

How long before other commands go

I feel that it is only a matter of time before google removes even more of these controls….

I will keep monitoring them and update the post when that happens…

In the meantime if you want more training on affiliate marketing and seo then why not check out the wealthyaffiliate platform for free.get your free membership

You get access to the first level of both their courses, along with a free siterubix website to try out what you are taught in the lessons…

You will be amongst loads of other members who are doing the same thing in a safe environment.

As it is free to signup and start why not check it out….

Have fun

Phil 

If You Liked it - Why Not Share It- Click Below

Recent Content