diff --git a/source/Ox.UI/js/Video/SmallVideoTimelineImage.js b/source/Ox.UI/js/Video/SmallVideoTimelineImage.js
index 32818100..2510ff6c 100644
--- a/source/Ox.UI/js/Video/SmallVideoTimelineImage.js
+++ b/source/Ox.UI/js/Video/SmallVideoTimelineImage.js
@@ -18,6 +18,7 @@ Ox.SmallVideoTimelineImage = function(options, self) {
mode: 'player',
out: 0,
results: [],
+ showInToOut: false,
state: 'default',
subtitles: [],
type: '',
@@ -73,19 +74,27 @@ Ox.SmallVideoTimelineImage = function(options, self) {
width: self.options.width + 'px'
});
- self.images = Ox.isString(self.options.imageURL) ?
- 1 : Math.ceil(self.options.duration / 3600);
- self.imageWidth = Ox.isString(self.options.imageURL) ?
- 1920 : Math.round(self.options.duration);
- self.height = self.options.mode == 'player' ? 16 : 24;
- self.imageHeight = self.options.mode == 'player' ? 16 : 18;
- self.imageTop = self.options.mode == 'player' ? 0 : 3;
- self.timelineTop = self.options.mode == 'player' ? 0 : 4;
+ if (self.options.showInToOut) {
+ self.pixelsPerSecond = (
+ screen.width < 1024 ? 1024 : screen.width
+ ) / self.options.duration;
+ }
+ self.images = Ox.isString(self.options.imageURL) ? 1
+ : Math.ceil(self.options.duration / 3600);
+ self.imageWidth = Ox.isString(self.options.imageURL) ? 1920
+ : self.options.showInToOut ? (
+ self.pixelsPerSecond <= 1
+ ? Math.round(self.options.duration)
+ : Math.round(self.options.duration * 25)
+ )
+ : Math.round(self.options.duration);
+ self.height = self.options.mode == 'editor' ? 24 : 16;
+ self.imageHeight = self.options.mode == 'editor' ? 18 : 16;
+ self.imageTop = self.options.mode == 'editor' ? 3 : 0;
+ self.timelineTop = self.options.mode == 'editor' ? 4 : 0;
self.themeData = Ox.Theme.getThemeData();
- that.css({
- height: self.height + 'px'
- });
+ that.css({height: self.height + 'px'});
if (Ox.isString(self.options.imageURL)) {
self.$timeline = $('
')
@@ -99,6 +108,15 @@ Ox.SmallVideoTimelineImage = function(options, self) {
height: '16px'
})
.appendTo(that);
+ } else if (self.options.showInToOut) {
+ self.$timeline = getClipTimeline()
+ .css({
+ position: 'absolute',
+ top: self.timelineTop + 'px',
+ width: self.options.width + 'px',
+ height: '16px'
+ })
+ .appendTo(that);
} else {
Ox.loop(self.images, function(i) {
$('
')
@@ -152,15 +170,53 @@ Ox.SmallVideoTimelineImage = function(options, self) {
})
.appendTo(that);
+ function getClipTimeline() {
+ var $canvas, context, image,
+ firstTile, lastTile, tileHeight, tileOffset, tileWidth;
+ if (self.pixelsPerSecond <= 1) {
+ firstTile = Math.floor(self.options['in'] / 3600);
+ lastTile = Math.floor(self.options.out / 3600);
+ tileHeight = 16;
+ tileOffset = -Math.round(self.options['in'] % 3600);
+ tileWidth = 3600;
+ } else {
+ firstTile = Math.floor(self.options['in'] / 60);
+ lastTile = Math.floor(self.options.out / 60);
+ tileHeight = 64;
+ tileOffset = -Math.round(self.options['in'] % 60);
+ tileWidth = 1500;
+ }
+ $canvas = $('