diff options
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 61eb2af..2c87344 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); +        } +    },  	in_minutes_and_seconds: function(seconds) {  		var minutes = Math.floor(seconds / 60); @@ -43,7 +48,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(); | 
