Skip to content

Instantly share code, notes, and snippets.

@renz45
Created October 14, 2014 15:56
Show Gist options
  • Save renz45/a5ffbcabcaeaaa04ab88 to your computer and use it in GitHub Desktop.
Save renz45/a5ffbcabcaeaaa04ab88 to your computer and use it in GitHub Desktop.
CS.csVideoPLayer = {
speeds: [1, 1.5, 2, 2.5, 3],
init: function() {
var videos = $('.cs-video_player');
var el;
for(var i=0, l=videos.length; i < l; i++) {
el = videos[i];
CS.csVideoPLayer.initSublime(el);
CS.csVideoPLayer.initWrapper(el);
}
},
initWrapper: function(element) {
var wrapper = $('<div class="cs-video-player"></div>');
$(element).removeClass('cs-video-player')
.addClass('cs-video-player--video')
.wrap(wrapper);
CS.csVideoPLayer.initSpeedControls(wrapper[0]);
},
initSpeedControls: function(element) {
var speedControls = $('<options></options>')
},
initSublime: function(element) {
sublime.ready(function(){
var player = sublime.player(element);
if ( player ) {
player.on({
start: function(player) {
CS.Segment.track( CS.Event.Video.PLAYED );
},
end: function(player) {
CS.Segment.track( CS.Event.Video.WATCHED );
}
});
}
});
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment