summaryrefslogtreecommitdiffstats
path: root/assets
diff options
context:
space:
mode:
authorKawandeep Virdee2013-11-09 17:52:35 -0500
committerKawandeep Virdee2013-11-09 17:52:35 -0500
commit45fef997e92bd20b464ea4b2734f09a30e2ab38b (patch)
treeb819c46123152e1f470205a6712ec2b8655a4977 /assets
parentdf761dd6400d55d99540d7d769075955681f3093 (diff)
parent558c6200d5b550a6004c2dc759e1a1c51900eec9 (diff)
downloadclip-play-45fef997e92bd20b464ea4b2734f09a30e2ab38b.tar.bz2
merge
Diffstat (limited to 'assets')
-rw-r--r--assets/js/sample-editor.js45
1 files changed, 45 insertions, 0 deletions
diff --git a/assets/js/sample-editor.js b/assets/js/sample-editor.js
index 10f5a08..7ae2bca 100644
--- a/assets/js/sample-editor.js
+++ b/assets/js/sample-editor.js
@@ -2,6 +2,9 @@ var SampleEditor = SampleEditor || {};
(function($) {
SampleEditor = function() {
+ this.player = null;
+
+
this.initialize = function() {
var $clip_line = $('.js-clip-line');
@@ -11,6 +14,48 @@ var SampleEditor = SampleEditor || {};
scroll: false,
containment: $clip_line.parents('.progress-bar')
});
+
+ $clip_line.on('drag', this.on_clip_drag_stop);
+
+
+ this.player = new OP.Player($('#single-video-lets-see-if-we-can-get-this-to-work').get(0));
+ };
+
+
+ // percentage_progress
+ //
+ // Get a percentage value from a clip-line that represents its
+ // position within the progress bar.
+ //
+ this.percentage_progress = function($el) {
+ var container = $el.parents('.progress-bar');
+ var position_in_pixels = $el.css('left');
+
+ var percentage = (position_in_pixels / container.width()) * 100;
+
+ return percentage;
+ };
+
+
+ // seek_point
+ //
+ // Example:
+ // sample_editor.seek_point({
+ // $el: $('.clip-line'),
+ // video_length: 586
+ // });
+ //
+ this.seek_point = function(options) {
+ var options = options || {};
+
+ var progress = this.percentage_progress(options.$el);
+
+ return (progress * options.video_length) / 100;
+ };
+
+
+ this.on_clip_drag_stop = function(e, ui) {
+
};