最近一位朋友问我如何将YouTube 视频(YouTube video)变小以供他发布到他的博客,所以我做了一些研究并给了他一个解决方案!根据上传到YouTube的视频,视频的宽度和高度(width and height)设置为特定的默认值(default value)。例如,在大多数高清视频(HD videos)上,宽度为 560 像素,高度为 315 像素。
如果您希望快速调整视频大小以发布到您的博客、网站或社交订阅源,那么这是一个非常简单的过程。过去(Back),您必须手动编辑YouTube提供的嵌入代码来自定义视频的大小。现在, YouTube允许您从一组预定义的尺寸中进行选择,或者选择您自己的自定义尺寸(custom size)。
您要做的第一件事是在YouTube 上(YouTube)找到您想要缩小的实际视频。然后单击Share链接并单击Embed(如果尚未选择)。
代码将如下所示:
<iframe width=”560″ height=”315″ src=”http://www.youtube.com/embed/aBUjH2KJns4″ frameborder=”0″ allowfullscreen></iframe>
您会注意到代码中的WIDTH 和HEIGHT 值。总的来说,嵌入代码非常容易理解。您有width 和 height(width and height)、作为YouTube 视频(YouTube video)URL的src 标签(src tag)、一个frameborder 值(frameborder value)和一个允许全屏播放视频的选项。除了这些之外,还有其他选项,但这是基本的嵌入代码。
您可以继续将此代码粘贴到您选择的文本编辑器中,例如记事本(Notepad),然后手动更改宽度和高度设置(width and height setting),但您必须自己维护纵横比(aspect ratio)。无需担心,您可以使用自定义尺寸(Custom size)选项,它会为您完成所有计算。
例如,只需输入宽度,然后按Tab 键(Tab key)。高度值将自动计算并填充。您也可以输入高度值,宽度值将在实际嵌入代码(embed code)中进行调整。出于某种奇怪的原因,宽度框(width box)不会更改值,这可能是一个错误。
显然,您可以将YouTube视频缩小,也可以根据需要将其放大。如果视频是以高清(1080、720)拍摄的,您可以增加尺寸并且不会损失任何质量。就是这样!使视频更小确实非常简单。现在让我们看一下选项:
1.视频结束时显示建议的视频(Show suggested videos when the videos finishes)- 这很不言自明。如果您的视频只是在完成后播放并停止,请取消选中此框。
2.使用 HTTPS(Use HTTPS) – 如果您将YouTube 视频(YouTube video)嵌入到使用安全连接 ( SSL/HTTPS ) 的站点,那么您也可以选择在嵌入代码中使用HTTPS 。
3.启用隐私增强模式(Enable Privacy-Enhanced Mode)——默认情况下,YouTube可以捕获访问嵌入YouTube 视频(YouTube video)的页面的每个访问者的信息。通过选中此框,他们只能捕获有关您网站上实际播放视频的访问者的信息。
4.使用旧的嵌入代码(Use old embed code)——糟糕(Yuck),不知道你为什么要这样做。旧的嵌入代码依赖于OBJECT 标签(OBJECT tag)并且需要Flash才能播放。新的嵌入代码使用IFRAME 标签并支持 HTML(IFRAME tag and supports HTML) 5 视频以及 Flash。
这些是可见的选项,但也有一些隐藏的选项可以更多地自定义视频。如果需要,您可以让YouTube 视频(YouTube video)在用户访问该页面时自动开始播放。只需(Just)在嵌入代码的 src 部分的URL末尾添加?autoplay=1
<iframe width=”560″ height=”315″ src=”http://www.youtube.com/embed/aBUjH2KJns4?autoplay=1” frameborder=”0″ allowfullscreen></iframe>
好的!您还可以通过在 src URL 的末尾添加#t=1m30s来选择在特定时间开始播放视频:
<iframe width=”560″ height=”315″ src=”http://www.youtube.com/embed/aBUjH2KJns4?autoplay=1#t=1m30s” frameborder=”0″ allowfullscreen></iframe>
从上面可以看出,可以组合不同的参数。在上面的示例中,我正在自动播放视频(video auto play),并确保它在视频的 1 分 30 秒处开始播放。
您可能还可以将其他秘密参数传递到嵌入代码中,但上述项目对大多数人都适用。借助新的嵌入代码,让YouTube 视频(YouTube video)变得更小是小菜一碟,它现在也可以在大多数现代浏览器中运行,而无需任何Flash。享受!
How to Make YouTube Videos Smaller
Recently a friend аsked me how to make a YouTube video smaller for his posting to his blog, so I did a little bit of research and gave him a solution! Depending on the video that’s been uploaded to YouTube, the width and height of the video is set to а particular default value. For еxamрle, on most HD videos, thе width is 560px and the hеight іs 315px.
If you’re looking to quickly resize the video for posting to your blog, website or social feed, then it’s a pretty simple process. Back in the days, you had to manually edit the embed code given by YouTube to customize the size of the video. Now YouTube lets you pick from a set of predefined sizes or choose your own custom size.
The first thing you’ll want to do is find the actual video on YouTube that you want to make smaller. Then click on the Share link and click on Embed, if it’s not already selected.
The code will look something like this:
<iframe width=”560″ height=”315″ src=”http://www.youtube.com/embed/aBUjH2KJns4″ frameborder=”0″ allowfullscreen></iframe>
You will notice the WIDTH and HEIGHT values in the code. Overall, the embed code is very easy to understand. You have the width and height, the src tag which is the URL to the YouTube video, a frameborder value and an option to allow the video to be played full screen. There are other options in addition to these, but this is the basic embed code.
You could go ahead and paste this code into a text editor of your choice, like Notepad, and manually change the width and height setting, but then you would have to worry about maintaining the aspect ratio yourself. Instead of worrying about that, you can just use the Custom size option and it will do all the calculations for you.
For example, just type in a width and then press the Tab key. The height value will automatically be calculated and filled. You can also type in a value for the height, and the width value will adjust in the actual embed code. For some odd reason, the width box won’t change values, which could be a bug.
Obviously, you can make the YouTube video smaller or you can make it bigger if you like also. If the video was shot in HD (1080, 720), you can increase the size and you won’t lose any quality. So that’s about it! Very simple indeed to make a video smaller. Now let’s look at the options:
1. Show suggested videos when the videos finishes – This is pretty self-explanatory. If you the video to simply play and stop after it’s finished, then uncheck this box.
2. Use HTTPS – If you’re embedding the YouTube video to a site that uses a secure connection (SSL/HTTPS), then you have the option to use HTTPS in the embed code too.
3. Enable Privacy-Enhanced Mode – By default, YouTube can capture information about every visitor that comes to the page where the YouTube video is embedded. By checking this box, they can only capture information about visitors on your site who actually play the video.
4. Use old embed code – Yuck, no idea why you would want to do this. The old embed code relied on the OBJECT tag and required Flash to play. The new embed code uses the IFRAME tag and supports HTML 5 video in addition to flash.
Those are the visible options, but there are also some hidden options to customize the video even more. If you want, you can have the YouTube video start playing automatically when the user visits the page. Just add ?autoplay=1 to the end of the URL in the src part of the embed code:
<iframe width=”560″ height=”315″ src=”http://www.youtube.com/embed/aBUjH2KJns4?autoplay=1” frameborder=”0″ allowfullscreen></iframe>
Nice! You can also choose to start the video at a certain time by adding #t=1m30s to the end of the src URL:
<iframe width=”560″ height=”315″ src=”http://www.youtube.com/embed/aBUjH2KJns4?autoplay=1#t=1m30s” frameborder=”0″ allowfullscreen></iframe>
As you can see from above, the different parameters can be combined. In the example above, I am having the video auto play and I’m making sure it starts at 1 minute and 30 seconds into the video.
There are probably other secret parameters you can pass into the embed code, but the above-mentioned items will work well for most people. Making a YouTube video smaller is a piece of cake thanks to the new embed code, which will also now work in most modern browsers without any need for Flash. Enjoy!