Overview
SundaySky makes it easy to embed the video you create on any website or landing page. Once embedded, the video plays in an HTML5 player designed for dynamic video streaming to major desktop and mobile browsers.
The code used to embed the video is generated with the SundaySky Embed Code Builder. This easy-to-use tool enables you to define how the player will look and behave—without any technical knowhow. As you configure the player in the Embed Code Builder, you will see a preview of how the player will look once embedded onto your website.
Currently, SundaySky supports two methods for embedding a video: iframe and JavaScript.
The questions and answers below will help you in deciding which method to use.
| 1. | What are the main features of the iframe and JavaScript embed codes? | ||||||||||||||||||||||||||
|
|||||||||||||||||||||||||||
|
2. |
Can the embed codes be used with all website builder CMS platforms? The embed codes are broadly compatible with all websites. However, some features may not be available across certain website builder platforms. Static videos, without personalization, will generally play without any issues. Personalized videos that require URL parameters in order to customize the video are not compatible with certain CMS platforms. Currently, the known incompatible platforms are Google Sites and Wix. |
||||||||||||||||||||||||||
| 3. |
How should the SundaySky embed codes be used? Both the JavaScript and iframe codes should be embedded directly into the webpage. If the page is custom-developed, paste the embed code directly into the HTML code. If you are using a website builder CMS (such as WordPress or Squarespace), paste the embed code into a custom code block. This will give you the best result. Several CMS platforms use "video" embed blocks; many of these are incompatible with the SundaySky embed codes. |
||||||||||||||||||||||||||
Note:
If your video is personalized, refer to the end-to-end articles according to data connector for instructions on how to share the video after you have generated the embed code.
For in-depth information on sharing a video in general, see Sharing a Video.
Generating the Embed Code
| 1. | Open the relevant video in the Video Page. | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2. | Select the Edit tab and then approve the video. | ||||||||||||||||||||||||||||||||||||||||||||||||
| 3. | In the Share tab, next to Embed Video, click the plus sign. | ||||||||||||||||||||||||||||||||||||||||||||||||
| The Embed Code Builder is launched. It includes four sections, each with settings that you can configure. ▶ The player is displayed in horizontal or vertical view, depending on the aspect ratio of the video. |
|||||||||||||||||||||||||||||||||||||||||||||||||
| 4. | Customize the settings in each section according to your preferences. As you configure the settings, the changes are reflected on the page. ▶ Click the relevant tab below for step-by-step instructions. |
||||||||||||||||||||||||||||||||||||||||||||||||
Note:
|
|||||||||||||||||||||||||||||||||||||||||||||||||
| 5. | After you finish configuring all the sections, click Create at the bottom of the Embed Code Builder. |
||||||||||||||||||||||||||||||||||||||||||||||||
| 6. | Select the embed method that you want to use. ▶ By default, iframe is selected. It is not selected if you enabled the NPS survey, you previously used the JavaScript embed code, or if you created this video by duplicating a video that uses the JavaScript embed code. |
||||||||||||||||||||||||||||||||||||||||||||||||
| 7. | Click Copy code. | ||||||||||||||||||||||||||||||||||||||||||||||||
| 8. | On your webpage, paste the embed code snippet where you want the player to appear. | ||||||||||||||||||||||||||||||||||||||||||||||||
Editing the Embed Code
| 1. | Open the video in the Video Page. |
| 2. | In the Share tab, by Embed Video, click the Share icon. |
| 3. | Click the pencil icon. |
| The Embed Code Builder is launched. | |
| 4. | Edit the settings as required in any of the sections. |
| 5. | Click Apply changes at the bottom of the Embed Code Builder. |
| 6. | Click Apply to incorporate the changes you made. The player that you embedded is automatically updated.
If you changed the Player size, the Apply Changes? window appears. It says that all changes will be immediately visible to viewers and asks you to copy the updated embed code so the iframe height fits the video. Click Apply, then click Copy code and paste the new code over the old code on your page. Click Copy code and then paste the new snippet on your webpage.
|
Player Size: Additional Guidelines
- A new embed starts on Auto, because the builder assumes iframe until you choose the embed type. An embed for the API data connector always uses JavaScript, so it starts on Default size, and its code is the same as before.
▶ If you switch between the iframe and JavaScript embed types, the size you chose does not change.
▶ Embeds that are already on a page keep their size and appearance until you choose a size and save. - A fixed width must be a whole number of pixels greater than 0.
▶ If the field is empty or the value is not valid, the field shows Enter a whole number of pixels greater than 0. and Create is unavailable until you fix it.
▶ The code is never generated with an invalid value. - The player scales down proportionately when the section it is placed in is narrower than the width it would otherwise have.
▶ The height always follows from the width and the aspect ratio of the video. - With Auto, an iframe embed fills the full width of the iframe, and the height follows the aspect ratio of the video.
▶ The embed code reserves the height of the player, so the whole player is visible.
▶ For 9:16 and 4:5 videos, Auto is capped: the player is never taller than the visitor's window and never narrower than Default size (360 px for 9:16, 512 px for 4:5). It keeps the aspect ratio of the video and fits itself again when the window is resized or the device is rotated.
▶ The cap does not apply to 16:9 videos, to Fixed width, or to Auto in a JavaScript embed.
▶ The table shows examples for a page 1906 px wide.
| Video shape | Visitor's window height | Player size shown with Auto |
|---|---|---|
| 16:9 | Any | 1906 x 1072 (not capped) |
| 9:16 | 1000 px | 563 x 1000 |
| 9:16 | 800 px | 450 x 800 |
| 9:16 | 500 px | 360 x 640 (Default size, not made narrower) |
| 4:5 | 1000 px | 800 x 1000 |
| 4:5 | 800 px | 640 x 800 |
- In a JavaScript embed, the size is written into the
widthattribute of the code.
▶ Fixed width 960 giveswidth="960".
▶ Auto giveswidth="auto".
▶ After you change the size, copy the new code and paste it over the old code on your page. - For a video that uses the SundaySky API data connector, the size choice works the same way, because the connector supports the JavaScript embed only.
- When NPS is on and Auto is selected, the builder shows The NPS survey appears below the player and stays at most 720 px wide, so it may look narrower than the player.
▶ The width of the survey depends on the shape of the video: 720 px for 16:9, 360 px for 9:16 and 512 px for 4:5, the same as the Default size.
▶ With NPS off, no message is shown. - The embed method is chosen in the Embed Video dialog.
▶ By default, iframe is selected. It is not selected if you enabled the NPS survey, you previously used the JavaScript embed code, or you created the video by duplicating a video that uses the JavaScript embed code.
▶ The code is isolated from the CSS of your page when you use an iframe.
Generating a Preview Page
After creating the embed code snippet, you may want to show the player page to colleagues or stakeholders before going live. In this way, others can interact with the player and offer feedback. A preview page is active for seven days.
When working with JavaScript embed code:
As the code snippet needs to be pasted manually, you can share the preview page with others before pasting the code in a live site. This can be done with both the initial embed code and with every embed code that is generated after making edits.
When working with iframe embed code:
Once the code snippet is pasted, any edit made to the code in the platform is automatically updated on your landing page. For this reason, practically speaking, the preview page should only be shared after the initial code is generated and before it's on the landing page.
Notes for iframe
| 1. | If fullscreen mode cannot be enabled in the player, add allowfullscreen to the code snippet in the following location: |
Notes for JavaScript
| 1. | The player is responsive and you can define its size via CSS properties if needed. |
| 2. | After you've pasted the code snippet in your HTML editor, you can further customize the code according to your preferences using SundaySky JavaScript Embed Code: Player Attributes. |
|
|
|
| 3. | The video player emits events for various events within the video and player, and while the viewer interacts with the video. Event listeners can be used to trigger any JavaScript code that you define. For a complete list of events, a list of the data reported by each event, and code examples, see Integrating with Player Events. |