SublimeVideo

Documentation

Check out our Getting Started and FAQ pages to start, and if you have any problems take a look at our Troubleshooting page.

Autoplay video upon page load

Playing a video on page load is possible using our JavaScript API. Please note this currently doesn’t work on iOS devices.

The following is a simple example of the code needed to achieve this:

HTML Code

<video id="video1" poster="posterframe.jpg" width="640" height="360" preload="none">
  <source src="video.mp4" />
  <source src="video.webm" />
</video>

Note: When implementing this functionality, you must not add the sublime class to the <video> element. This is because the video will be prepared through the JS API.

JavaScript Code

Put this code in a <script> element just before the </body> tag, or in an external file.

sublimevideo.ready(function() {
  sublimevideo.prepareAndPlay("video1");
});

Demo

You can see this feature in action on this page.