From 033155cc519fb07726d770be975173bcf8234a8b Mon Sep 17 00:00:00 2001 From: j <0x006A@0x2620.org> Date: Sat, 26 May 2012 11:52:08 +0000 Subject: [PATCH] expose paused as option in VideoEdito and VideoPlayerPanel --- source/Ox.UI/js/Video/Ox.VideoEditor.js | 8 +++++++- source/Ox.UI/js/Video/Ox.VideoPanel.js | 7 +++++-- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/source/Ox.UI/js/Video/Ox.VideoEditor.js b/source/Ox.UI/js/Video/Ox.VideoEditor.js index 7e83456a..8431ae64 100644 --- a/source/Ox.UI/js/Video/Ox.VideoEditor.js +++ b/source/Ox.UI/js/Video/Ox.VideoEditor.js @@ -43,6 +43,7 @@ Ox.VideoEditor = function(options, self) { layers: [], muted: false, out: 0, + paused: true, position: 0, posterFrame: 0, resolution: 0, @@ -253,7 +254,7 @@ Ox.VideoEditor = function(options, self) { 'in': self.options['in'], muted: self.options.muted, out: self.options.out, - paused: true, + paused: self.options.paused, position: type == 'play' ? self.options.position : self.options[type], posterFrame: self.options.posterFrame, resolution: self.options.resolution, @@ -280,6 +281,7 @@ Ox.VideoEditor = function(options, self) { that.triggerEvent('muted', data); }, paused: function(data) { + self.options.paused = data.paused; that.triggerEvent('paused', data); }, playing: function(data) { @@ -1390,6 +1392,10 @@ Ox.VideoEditor = function(options, self) { setSizes(); } else if (key == 'in' || key == 'out') { setPoint(key, value); + } else if (key == 'paused') { + self.$player[0].options({ + paused: value + }); } else if (key == 'position') { setPosition(value); } else if (key == 'selected') { diff --git a/source/Ox.UI/js/Video/Ox.VideoPanel.js b/source/Ox.UI/js/Video/Ox.VideoPanel.js index a05ecff7..4e65cbef 100644 --- a/source/Ox.UI/js/Video/Ox.VideoPanel.js +++ b/source/Ox.UI/js/Video/Ox.VideoPanel.js @@ -37,7 +37,7 @@ Ox.VideoPanel = function(options, self) { loop: false, // fixme: used? muted: false, out: 0, - paused: false, + paused: true, playInToOut: false, position: 0, poster: '', @@ -103,7 +103,7 @@ Ox.VideoPanel = function(options, self) { 'in': self.options['in'], muted: self.options.muted, out: self.options.out, - paused: true, + paused: self.options.paused, position: self.options.position, resolution: self.options.resolution, scaleToFill: self.options.scaleToFill, @@ -132,6 +132,7 @@ Ox.VideoPanel = function(options, self) { that.triggerEvent('muted', data); }, paused: function(data) { + self.options.paused = data.paused; that.triggerEvent('paused', data); }, playing: function(data) { @@ -454,6 +455,8 @@ Ox.VideoPanel = function(options, self) { self.$video.options({height: getPlayerHeight()}); } else if (key == 'in' || key == 'out') { setPoint(key, value); + } else if (key == 'paused') { + self.$video.options({paused: value}); } else if (key == 'position') { self.$video.options({position: value}); self.$timeline.options({position: value});