2
votes

https://developers.google.com/youtube/player_parameters

I found this as a resource to develop the following:

   <iframe src="https://www.youtube.com/embed/iZy8L-CnSGQ?hd=1&modestbranding=0&showinfo=0&autohide=1&controls=1" frameborder="0" width="500" height="280"></iframe>

As a sample project. However, I realized that it only works in Chrome, and I usually develop in Mozilla.

If I want to limit the conditions of an embedded video, is iFrame truly what I should be looking at? I'm trying to hide the following: the YT logo, and the title bar, and autohide the controls/progress bar for the video when it isn't focused on.

The parameter modestbranding= hides the YT logo. To hide the video name is the parameter showinfo=0. Finally, to auto hide the controls is parameter autohide=1&controls=1,

I don't understand either why, but I heard iFrame is dangerous for developers to use for video embedding. Is this true?

Thank you!

1

1 Answers

0
votes

The primary purpose of IFrame API is to let a user to embed a YouTube video player on your website and control the player using JavaScript.

You said that you realized that it only works in Chrome, well that is not true. The IFrame API will work with a browser that support the HTML5 postMessage feature. Most modern browsers support postMessage, though Internet Explorer 7 does not support it.

Just check this requirements in order for you to work with IFrame API.

For the different parameters in IFrame API, you can check it with this link. This link can explain you the different supported parameters that can work with IFrame API together with their supported players and description.

For more information, check this YouTube Player Demo. This demo demonstrates the YouTube Player API's functions. Embedded players must have a viewport that is at least 200px by 200px. If the player displays controls, it must be large enough to fully display the controls without shrinking the viewport below the minimum size.