We recently introduced a new type of video embed code. Our new embeds use an <iframe> element to embed video in your site as opposed to an <object> or <embed> tag. This will be the standard for the SproutVideo hosting platform going forward. Read on to learn about the benefits of iframe embed codes!
Why Iframe Embed Codes?
Using an iframe to embed videos offers numerous benefits over using the <object> or <embed> tag for embedding.
We switched to iframe embed codes for a few reasons:
- Simpler embed codes. In an effort to make things as 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 embedded the code.
- Better device support and detection. By using an iframe, we can better detect the type of device or browser your users are using when viewing your videos. This enables us to deliver the best possible playback experience according to their specific setup.
- Support for HTML5 playback and skinning. Using an iframe embed allows you to customize our HTML5 video player to your heart’s content. You can make the player responsive, change the colors, hide or show controls, autoplay the video, and more. 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 are key to simplifying all of these customizations.
- Playback analytics. Using an iframe embed code allows us to collect diverse and accurate data on playback, which we use for robust analytics and video engagement metrics.
- Future-proofing. By containing the actual logic and embed within an iframe that we control, we’ll eventually have the ability to update and modify embeds without having you change your embed code.
- Easy Replacing. You can easily replace a video within your SproutVideo account, and the new video will automatically appear anywhere it is embedded without you needing to swap out embed codes.
If you’d like to test out how easy it is to upload and embed a video with SproutVideo’s platform, open a free trial and test it out! If you have any questions about getting started, please let us know in the comments below, or reach out to our support team.