summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKawandeep Virdee2013-11-10 13:23:50 -0500
committerKawandeep Virdee2013-11-10 13:23:50 -0500
commit0a6657514058935251366c770bfd85a419f60786 (patch)
tree80d8519c5143423fa52b918065b9068bdc1754b5
parent2d6422265f55905cb83b56ce4dfa2090f5dfe62e (diff)
downloadclip-play-0a6657514058935251366c770bfd85a419f60786.tar.bz2
movie comes to the top if it is playing
-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});
+ }
+ });
}
}
});