<a href='#' id='start_video1' class='custom_start_view'>Click here to start the video</a> <video id='video1' data-autoplay='true' poster='http://media.sublimevideo.net/vpa/ms_800.jpg' width='432' height='243' preload='none' style='display:none;'> <source src='http://media.sublimevideo.net/vpa/ms_360p.mp4' /> <source src='http://media.sublimevideo.net/vpa/ms_720p.mp4' data-quality='hd' /> <source src='http://media.sublimevideo.net/vpa/ms_360p.webm' /> <source src='http://media.sublimevideo.net/vpa/ms_720p.webm' data-quality='hd' /> </video> <!-- Please note the autoplay setting in the <video> element above -->
// custom start view sublime.ready(function() { var startView = $("a.custom_start_view"); startView.click(function(event) { event.preventDefault(); var playerId = startView.attr("id").replace(/^start_/, ""); // Prepare the player. // Video playback will start automatically once the // player is prepared (because of the autoplay setting // on the <video> element). sublime.prepare(playerId, function(player) { startView.hide(); // Optionally hide the custom start view }); }); });