Why do embed codes use iframes?

We switched to iframe embed codes for a few reasons:

  1. Simpler embed codes. In an effort to make things as simple and easy as possible for you, we decided it would be best to shorten and simplify the embed codes to prevent mistakes when copying, pasting, and embedding the code.

  2. Better device support and detection. By using an iframe, we can better detect what type of device or browser your users are viewing your videos on so that we can deliver the best possible playback experience.

  3. Support for HTML5 playback and skinning. Using an iframe embed will allow for a customized HTML5 player in the future. Having to insert multiple types of code in your pages, including stylesheets and javascript, could interfere with existing styles and javascript and thus break your pages. Iframe embeds simplify this.

  4. Playback analytics. Using an iframe embed code allows us to collect more accurate data on playback which we use for richer analytics tools.

  5. Future proofing. By containing the actual logic and embed within an iframe that we control, we have the ability to update and modify embeds without making you change your embed code.

Was this article helpful?