In this article I will explain how I add YouTube video to a WordPress post or page.
YouTube changed the way videos can be embedded into web pages. The old way used Flash player, which is still available, but the new way is with the YouTube video link inside an HTML5 iFrame.
The old player worked well enough on PCs, Android, and Mac until Apple rejected Adobe Flash and went with HTML5 standards for iPad, iPhone, and iTouch to play video. Now those Apple devices can not view Flash videos (or animations). YouTube offers a non-Flash player for those type of devices. HTML5 allows embedded players to show video but it is an emerging standard and not everyone handled it the same way. Some problems became apparent.
The new YouTube code comes with many parameters that modify the way the video is presented on the page and how it plays when activated. Some of the parameters are the same as the old method. But the way to implement them has changed enough that it is not obvious what is needed to achieve the desired outcome.
Adding video to WordPress has been a fickle process over the various versions. Even now with v3.1.3 I have found that when using the post editor in Visual mode adding video using the toolbar icon can be unpredictable. Sometimes the embed code sticks and sometimes it disappears. Using only the HTML editor seems to be more likely to save the code, and I recommend that you don’t switch between Visual and HTML panes or the embed code will likely not work or be lost.
As an example I will pick a combination of embed parameters that I wanted and worked for me. Your preferences may be different. If you want to see all the parameters available you can find them here.
Get the YouTube video link.
From the YouTube web page of the video that you want to embed:
Continue reading “Embedding YouTube Player In WordPress HTML5 iframe” »