Using the JavaScript API
API Object
The SublimeVideo Player comes with an integrated JavaScript API. Once loaded, SublimeVideo Player instantiate a unique API object called sublimevideo. All calls to the API must be done through this object.
Important information:
- SublimeVideo Player and the
sublimevideoAPI object are automatically loaded on page load if there is at least one<video>element in the DOM. If you have no videos initially on the page (and you plan for instance to add them dynamically later with JavaScript) you can use thesublimevideo.loadmethod to force loading the player and thesublimevideoAPI object.
- The
sublimevideoAPI object might not be immediately available when the DOM is loaded. You should avoid making calls to the SublimeVideo JavaScript API in your own DOM loaded/ready method (e.g.DOMContentLoaded, jQuery’s.ready()or Prototype’sdom:loaded), but you should rather use oursublimevideo.readylistener.
API Methods and Listeners
Methods
load pause play prepare prepareAndPlay resize stop unprepare