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.js21
1 files changed, 16 insertions, 5 deletions
diff --git a/assets/js/views/sample.js b/assets/js/views/sample.js
index 3122641..6d1f95a 100644
--- a/assets/js/views/sample.js
+++ b/assets/js/views/sample.js
@@ -7,8 +7,8 @@ ClipPlay.Views.Sample = Marionette.ItemView.extend({
initialize: function(options){
this.collection = options.collection;
-
this.listenTo(this.model, 'change:key', this.key_bind);
+ this.listenTo(this.model, 'change:playing', this.show_clip);
this.key_bind();
this.listenTo(this.model, 'change:thumbnail', this.render_thumbnail);
},
@@ -32,9 +32,9 @@ ClipPlay.Views.Sample = Marionette.ItemView.extend({
src: iframe_src,
id: 'video-sample-' + that.model.cid
});
- var wrapper= document.createElement('div');
- $(wrapper).addClass("responsive-object");
+ var wrapper= document.createElement('span');
$(wrapper).append(iframe[0]);
+ $(wrapper).addClass("responsive-object");
$('#video').append(wrapper);
var player = new OP.Player(iframe[0]);
that.model.set('player', player);
@@ -48,7 +48,6 @@ ClipPlay.Views.Sample = Marionette.ItemView.extend({
img_resize+=new_height;
that.model.set('thumbnail', img_resize);
-
window.BOKASHAKA = that.model;
player.getDuration(function(value) {
that.model.set('duration', value);
@@ -116,5 +115,17 @@ ClipPlay.Views.Sample = Marionette.ItemView.extend({
}, 500, function() {
Marionette.View.prototype.close.call(that, arguments);
});
- }
+ },
+
+ show_clip: function(){
+ var isPlaying = this.model.get('playing');
+ console.log('playing :' + isPlaying);
+ var $iframe_video = $('#video-sample-' + this.model.cid);
+ if(isPlaying){
+ $iframe_video.css({'z-index':10});
+ }
+ if(!isPlaying){
+ $iframe_video.css({'z-index':-10});
+ }
+ }
});