Embeds
SublimeVideo embeds allow your audience to easily share your videos by embedding them into their own sites or elsewhere on the web.
In order for this to work, you need to create an HTML page for every video you’d like to be able to embed, and you need to host this page on one of your registered domains on MySublimeVideo.
The final snippet of code that your audience will share is an <iframe> element pointing to that HTML page (a.k.a the <iframe> content).
The <iframe> content
<!DOCTYPE html> <html> <head> <title></title> <script type="text/javascript" src="http://cdn.sublimevideo.net/js/YOUR_TOKEN.js"></script> </head> <body> <video style="display:none" class="sublime sv_iframe_embed" poster="poster.jpg" preload="none"> <source src="http://yoursite.com/video.mp4" /> <source src="http://yoursite.com/video.webm" /> </video> </body>
Important information:
- Replace YOUR_TOKEN with your actual site’s token (you can find it in the My Sites page after clicking the “embed code” button).
- Add the sv_iframe_embed
classto your<video>element and omit itswidthandheightattributes. style="display:none"is optional, but we recommend it to prevent UI flickering when the iframe is first loaded.- Host this file on a domain that is registered on MySublimeVideo. For instance, if your registered domain is yourdomain.com, you could save this page at http://yourdomain.com/embeds/video1.html.
The embed code
Here is the sharable snippet of code that your audience can copy and paste into another site.
<iframe src="http://yourdomain.com/embeds/video1.html" width="400" height="168" frameborder="0" allowfullscreen webkitallowfullscreen mozallowfullscreen></iframe>
Important information:
- Replace http://yourdomain.com/embeds/video1.html with the actual address of your HTML page.
- Set the
widthandheightattributes according to your actual video dimensions. - Leave the other attributes as they are (
frameborder,allowfullscreen,webkitallowfullscreenandmozallowfullscreen).