How to insert video to the site from YouTube

Anonim

How to insert video to the site from YouTube

YouTube provides a huge service to all sites, providing the opportunity to accommodate your videos on other resources. Of course, in this way, two hare is killed at once - YouTube video hosting diverges far beyond its limits, while the site has the ability to broadcast video, without scoring and without overloading your servers. This article will discuss how to insert video to the site from YouTube.

Search and configure code for inserting video

Before you climb into the coding debrist and tell how to insert YouTube player to the site itself, it is worth telling where to take this most player, or rather, its HTML code. In addition, you need to know how to configure it, so that the player itself looks organically on your site.

Step 1: Search HTML Code

To insert the roller to your site, you need to know its HTML code, which provides YouTube himself. First, you need to go to the page with the video you want to borrow. Secondly, scroll through the page just below. Thirdly, under the roller you need to click on the "Share" button, after which go to the "HTML code" tab.

Opening HTML-code on YouTube

You can only take this code (copy, "Ctrl + C"), and insert ("Ctrl + V") it into the code of your site, in the desired place.

Step 2: Code Setup

If the size of the video itself does not suit you and you want to change it, then YouTube provides this opportunity. You just need to click on the "still" button to open a special panel with settings.

Opening Advanced HTML Code Settings

Here you will see that you can change the size of the video using the drop-down list. If you want to set the sizes manually, then select the "Other Size" item in the list and enter it yourself. Note that on the task of one parameter (height or width), the second is automatically selected, thereby keeping the roller proportion.

Select the size of the inserted video on YouTube

Here you can also ask a number of other parameters:

  • Show similar videos After completing viewing.

    By installing a tick opposite this parameter, after viewing the roller on your site to the end, the viewer will provide a sample from other rollers similar to the subject, but independent of your preference.

  • Show control panel.

    If a tick is removed, then on your site the player will be without the main elements: the pause buttons, the volume control and the ability to flush the time. By the way, this parameter is recommended to always leave the user-friendly.

  • Show the name video.

    I remove this icon, the user who visited your site and incorporating the video on it, will not see his names.

  • Enable increased privacy mode.

    This parameter will not affect the display of the player, but if you activate it, youTube will save information about users who visited your site if they viewed this video. In general, no danger carries it, so you can clean the tick.

That's all the settings that you can spend on YouTube. You can safely take a modified HTML code and insert it to your site.

Videos of video inserts on the site

Many users, solving create their website, do not always know how to insert videos from YouTube on it. But this function allows not only to diversify the web resource, but also to improve the technical sides: the server load becomes more than less, since it fully goes to the server YouTube, and in the appendage to this there is a bunch of free space, because some of the video Reach huge size calculated in gigabytes.

Method 1: Insert on the HTML site

If your resource is written on HTML, then you need to open it in some text editor to insert the video from YouTube, for example, in NotePad ++. Also for this you can use both an ordinary notebook that is on all versions of Windows. After opening, find the location in all the code where you want to place the video, and insert the previously copied code.

In the image below you can view an example of such an insert.

Insert video from YouTube on HTML site

Method 2: Insert in WordPress

If you want to put the video from YouTube to the site using WordPress, it is still easier than on an HTML resource, since there is no need to use a text editor.

So, to insert a video, open the WordPress editor first, after that switch it to the text mode. Lay the place where you want to place a video, and insert the HTML code there, which you took from YouTube.

By the way, in the video widgets can be inserted in the same way. But in the elements of the site that cannot be edited from the administrator account, insert the roller is an order of magnitude harder. To do this, you need to edit the theme files, which is extremely not recommended to do users who do not understand all this.

Method 3: Insertion on UCOZ sites, LiveJournal, BlogSpot and them like

Everything is simple here, there is no difference from those methods that are previously shown. You only need to pay attention to the fact that the code editors themselves may differ. You just need to find it and open it and open in HTML mode, after which you insert the HTML code of the YouTube player.

Manual setting of HTML player code after inserting it

How to configure the insert player on YouTube's website was considered above, but this is not all settings. You can set some parameters manually by changing the HTML code itself. Also, these manipulations can be carried out both during video inserts and after it.

Changing the size of the player

It may happen that after you have already configured the player and inserted it to your site, opening the page, you find what its size, to put it mildly, does not match the desired result. Fortunately, you can fix everything, making edits to the HTML code of the player.

It is necessary to know only two elements and what they answer. The "Width" element is the width of the inserted player, and "Height" is height. Accordingly, in the code itself you need to replace the values ​​of these elements that are specified in quotes after the sign is equal to to resize the inserted player.

Changing video size in its HTML code

The main thing, be careful and select the necessary proportions so that the player is in the end, it is not strongly stretched or, on the contrary, fighten.

Automatic playback

Taking an HTML code from YouTube, you can redo it, so that when you open your site, the video has been played automatically. To do this, use the "& AutoPlay = 1" command without quotes. By the way, this code element needs to be inserted after the reference itself to the video, as shown in the image below.

Configure automatic video playback in its HTML code

If you change your mind and want to turn off the bus play, then the value "1" after the sign is (=) Replace to "0" or completely remove this item.

Reproduction

You can also configure playback from a certain point. It is very convenient if you need to visit your website to show a fragment in the video, which is discussed in the article. To do all this, in the HTML code at the end of the link to the video, you must add the following item: "# T = XXMYYS" without quotes, where XX is minutes, and yy - seconds. Please note that all values ​​must be recorded in a mystery form, that is, without spaces and in the numerical format. An example you can look in the image below.

Configure video playback from a certain point in its HTML code

To cancel all the changes made, you need to delete this code item or put time at the very beginning - "# T = 0m0s" without quotes.

Enable and disable subtitles

And finally, one more trick, as using the adjustment to the source HTML roller code, you can add the display of Russian-speaking subtitles when playing video on your site.

See also: How to enable subtitles in YouTube

To display subtitles in the video you need to use two elements of the code inserted sequentially. The first element is "& CC_LANG_PREF = RU" without quotes. He is responsible for choosing a subtitle language. As you can see, the example is the value of "RU", which means - the Russian language of subtitles is selected. Second - "& CC_LOAD_POLICY = 1" without quotes. It allows you to enable and disable subtitles. If after the sign is (=) there is a unit, then the subtitles will be turned on if zero, then, respectively, turned off. In the image below you can see everything yourself.

Setting the inclusion of subtitles in the video in its HTML code

See also: How to configure subtitles in YouTube

Conclusion

According to the result, we can say that inserting video from YouTube to the site is a pretty simple lesson with which absolutely every user can cope. And ways to configure the player itself allow you to specify the parameters that you need.

Read more