summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--assets/js/models/sample.js3
-rw-r--r--assets/js/views/sample.js11
2 files changed, 12 insertions, 2 deletions
diff --git a/assets/js/models/sample.js b/assets/js/models/sample.js
index c3c395c..c85a008 100644
--- a/assets/js/models/sample.js
+++ b/assets/js/models/sample.js
@@ -45,11 +45,12 @@ ClipPlay.Models.Sample = Backbone.Model.extend({
play: function() {
console.log('playing');
//play then pause
- this.set('playing',true);
window.clearTimeout(this.get('timeout'));
+ this.set('playing',false);
this.get('player').pause();
this.get('player').seekTo(this.get('start'));
this.get('player').play();
+ this.set('playing',true);
var that = this;
var length = Math.abs(this.get('stop') - this.get('start'));
console.log(length);
diff --git a/assets/js/views/sample.js b/assets/js/views/sample.js
index 6d1f95a..0c49469 100644
--- a/assets/js/views/sample.js
+++ b/assets/js/views/sample.js
@@ -119,13 +119,22 @@ ClipPlay.Views.Sample = Marionette.ItemView.extend({
show_clip: function(){
var isPlaying = this.model.get('playing');
- console.log('playing :' + isPlaying);
var $iframe_video = $('#video-sample-' + this.model.cid);
if(isPlaying){
+ var $frames = $('iframe');
+ $frames.each(function(k,v){$(v).css({'z-index':-10})})
$iframe_video.css({'z-index':10});
}
if(!isPlaying){
$iframe_video.css({'z-index':-10});
+
+ //if any others are playing, show them
+ this.collection.each(function(sample){
+ if(sample.get('playing')){
+ var $iframe = $('#video-sample-' + sample.cid);
+ $iframe.css({'z-index':10});
+ }
+ });
}
}
});