summaryrefslogtreecommitdiffstats
path: root/assets/js/views/sample.js
diff options
context:
space:
mode:
Diffstat (limited to 'assets/js/views/sample.js')
-rw-r--r--assets/js/views/sample.js31
1 files changed, 15 insertions, 16 deletions
diff --git a/assets/js/views/sample.js b/assets/js/views/sample.js
index ef1d681..7aab111 100644
--- a/assets/js/views/sample.js
+++ b/assets/js/views/sample.js
@@ -3,7 +3,7 @@ ClipPlay.Views.Sample = Marionette.ItemView.extend({
onRender: function() {
this.initialize_player();
- this.initialize_clip_drag_handles();
+ this.initialize_clip_lines();
},
@@ -25,25 +25,24 @@ ClipPlay.Views.Sample = Marionette.ItemView.extend({
var player = new OP.Player(iframe[0]);
that.model.set('player', player);
that.model.set('iframe', iframe);
- });
- },
-
-
- initialize_clip_drag_handles: function() {
- var $clip_line = this.$('.js-clip-line');
- $clip_line.draggable({
- axis: 'x',
- handle: '.js-drag-handle',
- scroll: false,
- containment: $clip_line.parents('.progress-bar')
+ // Trying to get the duration but this returns 0 for some reason
+ // on the YouTube video I'm testing with
+ player.getDuration(function(value) {
+ that.model.set('duration', value);
+ });
});
-
- $clip_line.on('dragstop', this.on_clip_drag_stop);
},
+ initialize_clip_lines: function() {
+ this.start_clip_line = new ClipPlay.Views.ClipLine({
+ el: this.$('.js-start-position'),
+ model: this.model
+ });
- on_clip_drag_stop: function(e, ui) {
- console.log('booyakacha');
+ this.end_clip_line = new ClipPlay.Views.ClipLine({
+ el: this.$('.js-end-position'),
+ model: this.model
+ });
}
});