diff options
| author | Kawandeep Virdee | 2013-11-10 02:32:24 -0500 |
|---|---|---|
| committer | Kawandeep Virdee | 2013-11-10 02:32:24 -0500 |
| commit | 0a1841512314c204e7e54d1a18a63385faecd6b2 (patch) | |
| tree | 9a9be95c96c5bd591ed0a90308d78d36f3c92f8c /assets/js/models/sample.js | |
| parent | 43ee0521ea6e0417237b44eb46f377902793ab0d (diff) | |
| download | clip-play-0a1841512314c204e7e54d1a18a63385faecd6b2.tar.bz2 | |
default keys, listener on key change
Diffstat (limited to 'assets/js/models/sample.js')
| -rw-r--r-- | assets/js/models/sample.js | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/assets/js/models/sample.js b/assets/js/models/sample.js index 5483f01..5179a7c 100644 --- a/assets/js/models/sample.js +++ b/assets/js/models/sample.js @@ -1,15 +1,20 @@ ClipPlay.Models.Sample = Backbone.Model.extend({ defaults: { 'url': '', - 'start': '', - 'stop': '', + 'start': '3', + 'stop': '4', 'duration': '', 'key': '', 'player': '', 'iframe': '', 'timeout' : '' }, - + initialize: function() { + var a = ClipPlay.Config['key_defaults'].shift(); + if(a){ + this.set('key', a); + } + }, play: function() { console.log('playing'); @@ -19,7 +24,7 @@ ClipPlay.Models.Sample = Backbone.Model.extend({ this.get('player').seekTo(this.get('start')); this.get('player').play(); var that = this; - var length = this.get('stop') - this.get('start'); + var length = Math.abs(this.get('stop') - this.get('start')); console.log(length); this.set('timeout',setTimeout(function(){ that.get('player').pause(); |
