diff --git a/source/Ox.UI/js/Video/Ox.SmallVideoTimeline.js b/source/Ox.UI/js/Video/Ox.SmallVideoTimeline.js index 3467881b..4b9c0c1a 100644 --- a/source/Ox.UI/js/Video/Ox.SmallVideoTimeline.js +++ b/source/Ox.UI/js/Video/Ox.SmallVideoTimeline.js @@ -6,6 +6,7 @@ Ox.SmallVideoTimeline = function(options, self) { var that = Ox.Element({}, self) .defaults({ _offset: 0, // hack for cases where all these position: absolute elements have to go into a float: left + disabled: false, duration: 0, editing: false, find: '', @@ -148,7 +149,7 @@ Ox.SmallVideoTimeline = function(options, self) { } function mousedown(e) { - if ($(e.target).is('.OxInterface')) { + if (!self.options.disabled && $(e.target).is('.OxInterface')) { self.options.position = getPosition(e); setPositionMarker(); if (!self.triggered) { diff --git a/source/Ox.UI/js/Video/Ox.VideoEditor.js b/source/Ox.UI/js/Video/Ox.VideoEditor.js index 40c08a03..0e6b938c 100644 --- a/source/Ox.UI/js/Video/Ox.VideoEditor.js +++ b/source/Ox.UI/js/Video/Ox.VideoEditor.js @@ -179,6 +179,7 @@ Ox.VideoEditor = function(options, self) { ['goto', 'set', 'space', 'position'], duration: self.options.duration, enableMouse: true, + enablePosition: true, externalControls: true, find: self.options.find, height: self.sizes.player[i].height, diff --git a/source/Ox.UI/js/Video/Ox.VideoPanelPlayer.js b/source/Ox.UI/js/Video/Ox.VideoPanelPlayer.js index fa8b0214..ea4dcaea 100644 --- a/source/Ox.UI/js/Video/Ox.VideoPanelPlayer.js +++ b/source/Ox.UI/js/Video/Ox.VideoPanelPlayer.js @@ -67,6 +67,8 @@ Ox.VideoPanelPlayer = function(options, self) { enableFind: true, enableKeyboard: true, enableMouse: true, + enablePosition: true, + enableTimeline: true, find: self.options.find, fullscreen: self.options.fullscreen, height: getPlayerHeight(), diff --git a/source/Ox.UI/js/Video/Ox.VideoPlayer.js b/source/Ox.UI/js/Video/Ox.VideoPlayer.js index 84827d4d..f764e742 100644 --- a/source/Ox.UI/js/Video/Ox.VideoPlayer.js +++ b/source/Ox.UI/js/Video/Ox.VideoPlayer.js @@ -87,6 +87,9 @@ Ox.VideoPlayer = function(options, self) { enableFind: false, enableFullscreen: false, enableKeyboard: false, + enableMouse: false, + enablePosition: false, + enableTimeline: false, externalControls: false, find: '', focus: 'click', @@ -297,7 +300,7 @@ Ox.VideoPlayer = function(options, self) { preload: self.options.preload, src: self.video, }, !self.options.paused && !self.options.playInToOut ? { - autoplay: 'autoplay' + /*autoplay: 'autoplay'*/ } : {}/*, self.options.poster ? { poster: self.options.poster } : {}*/) @@ -501,7 +504,22 @@ Ox.VideoPlayer = function(options, self) { self.options['controls' + titleCase].forEach(function(control) { - if (control == 'find') { + if (control == 'close') { + + self.$closeButton = Ox.Button({ + style: 'symbol', + title: 'close', + tooltip: 'Close', + type: 'image' + }) + .bindEvent({ + click: function() { + that.triggerEvent('close'); + } + }) + .appendTo(self['$controls' + titleCase]); + + } else if (control == 'find') { self.$findButton = Ox.Button({ style: 'symbol', @@ -626,24 +644,26 @@ Ox.VideoPlayer = function(options, self) { .html(formatPosition()) .bind({ click: function() { - if (self.options.type == 'play') { - if (!self.options.paused) { - self.playOnSubmit = true; - togglePaused(); - } else if (self.playOnLoad) { - // if clicked during resolution switch, - // don't play on load - self.playOnLoad = false; - self.playOnSubmit = true; + if (self.options.enablePosition) { + if (self.options.type == 'play') { + if (!self.options.paused) { + self.playOnSubmit = true; + togglePaused(); + } else if (self.playOnLoad) { + // if clicked during resolution switch, + // don't play on load + self.playOnLoad = false; + self.playOnSubmit = true; + } } + self.$position.hide(); + self.$positionInput + .options({ + value: formatPosition() + }) + .show() + .focusInput(false); } - self.$position.hide(); - self.$positionInput - .options({ - value: formatPosition() - }) - .show() - .focusInput(false); } }) .appendTo(self['$controls' + titleCase]); @@ -1320,6 +1340,7 @@ Ox.VideoPlayer = function(options, self) { function getTimeline() { var $timeline = Ox.SmallVideoTimeline({ _offset: getTimelineLeft(), + disabled: !self.options.enableTimeline, duration: self.options.duration, find: self.options.find, 'in': self.options['in'], @@ -1574,14 +1595,12 @@ Ox.VideoPlayer = function(options, self) { setPosition(self.options.position); self.$video.muted(self.options.muted).volume(self.options.volume); - // if not paused, but playInToOut, we haven't set autoplay before, - // since autoplay seems to always play from the beginning - if (!self.options.paused && self.options.playInToOut) { + if (!self.options.paused) { self.options.paused = true; togglePaused('button'); + } else if (self.options.paused && self.playOnLoad) { + togglePaused('button'); } - - self.options.paused && self.playOnLoad && togglePaused('button'); self.$playButton && self.$playButton.options({ disabled: false });