Created
October 14, 2014 15:56
-
-
Save renz45/a5ffbcabcaeaaa04ab88 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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