@twab/visualization 0.9.8 → 0.9.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/asset-54be6431 +248 -0
- package/dist/visualization.js +2639 -0
- package/package.json +4 -4
- package/dist/assets/asset-125afa63 +0 -1
- package/dist/visualization.umd.js +0 -2464
|
@@ -1,2464 +0,0 @@
|
|
|
1
|
-
(function (global, factory) {
|
|
2
|
-
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('v-tooltip'), require('@fortawesome/vue-fontawesome'), require('@fortawesome/fontawesome-svg-core'), require('@fortawesome/free-solid-svg-icons'), require('v-mask'), require('vue-loading-twa'), require('axios')) :
|
|
3
|
-
typeof define === 'function' && define.amd ? define(['v-tooltip', '@fortawesome/vue-fontawesome', '@fortawesome/fontawesome-svg-core', '@fortawesome/free-solid-svg-icons', 'v-mask', 'vue-loading-twa', 'axios'], factory) :
|
|
4
|
-
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.visualization = factory(global.VTooltip, global.vueFontawesome, global.fontawesomeSvgCore, global.freeSolidSvgIcons, global.VueMask, global.VueLoading, global.axios));
|
|
5
|
-
})(this, (function (VTooltip, vueFontawesome, fontawesomeSvgCore, freeSolidSvgIcons, VueMask, VueLoading, axios) { 'use strict';
|
|
6
|
-
|
|
7
|
-
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
8
|
-
|
|
9
|
-
var VTooltip__default = /*#__PURE__*/_interopDefaultLegacy(VTooltip);
|
|
10
|
-
var VueMask__default = /*#__PURE__*/_interopDefaultLegacy(VueMask);
|
|
11
|
-
var VueLoading__default = /*#__PURE__*/_interopDefaultLegacy(VueLoading);
|
|
12
|
-
var axios__default = /*#__PURE__*/_interopDefaultLegacy(axios);
|
|
13
|
-
|
|
14
|
-
function colorVariation (baseColor) {
|
|
15
|
-
const baseHSL = hexToHSL(baseColor);
|
|
16
|
-
baseHSL.l += 30;
|
|
17
|
-
return hslToHex(baseHSL);
|
|
18
|
-
}
|
|
19
|
-
function hexToHSL(hex) {
|
|
20
|
-
hex = hex.replace(/^#/, '');
|
|
21
|
-
const r = parseInt(hex.slice(0, 2), 16) / 255;
|
|
22
|
-
const g = parseInt(hex.slice(2, 4), 16) / 255;
|
|
23
|
-
const b = parseInt(hex.slice(4, 6), 16) / 255;
|
|
24
|
-
const max = Math.max(r, g, b);
|
|
25
|
-
const min = Math.min(r, g, b);
|
|
26
|
-
let h,
|
|
27
|
-
s,
|
|
28
|
-
l = (max + min) / 2;
|
|
29
|
-
if (max === min) {
|
|
30
|
-
h = s = 0; // achromatic
|
|
31
|
-
} else {
|
|
32
|
-
const d = max - min;
|
|
33
|
-
s = l > 0.5 ? d / (2 - max - min) : d / (max + min);
|
|
34
|
-
switch (max) {
|
|
35
|
-
case r:
|
|
36
|
-
h = (g - b) / d + (g < b ? 6 : 0);
|
|
37
|
-
break;
|
|
38
|
-
case g:
|
|
39
|
-
h = (b - r) / d + 2;
|
|
40
|
-
break;
|
|
41
|
-
case b:
|
|
42
|
-
h = (r - g) / d + 4;
|
|
43
|
-
break;
|
|
44
|
-
}
|
|
45
|
-
h /= 6;
|
|
46
|
-
}
|
|
47
|
-
h = Math.round(h * 360);
|
|
48
|
-
s = Math.round(s * 100);
|
|
49
|
-
l = Math.round(l * 100);
|
|
50
|
-
return {
|
|
51
|
-
h,
|
|
52
|
-
s,
|
|
53
|
-
l
|
|
54
|
-
};
|
|
55
|
-
}
|
|
56
|
-
function hslToHex(hsl) {
|
|
57
|
-
const h = hsl.h / 360;
|
|
58
|
-
const s = hsl.s / 100;
|
|
59
|
-
const l = hsl.l / 100;
|
|
60
|
-
if (s === 0) {
|
|
61
|
-
// Achromatic (gray) color
|
|
62
|
-
const gray = Math.round(l * 255);
|
|
63
|
-
return `#${gray.toString(16).repeat(3)}`;
|
|
64
|
-
}
|
|
65
|
-
const q = l < 0.5 ? l * (1 + s) : l + s - l * s;
|
|
66
|
-
const p = 2 * l - q;
|
|
67
|
-
const r = Math.round(hueToRGB(p, q, h + 1 / 3) * 255);
|
|
68
|
-
const g = Math.round(hueToRGB(p, q, h) * 255);
|
|
69
|
-
const b = Math.round(hueToRGB(p, q, h - 1 / 3) * 255);
|
|
70
|
-
return `#${r.toString(16).padStart(2, '0')}${g.toString(16).padStart(2, '0')}${b.toString(16).padStart(2, '0')}`;
|
|
71
|
-
}
|
|
72
|
-
function hueToRGB(p, q, t) {
|
|
73
|
-
if (t < 0) t += 1;
|
|
74
|
-
if (t > 1) t -= 1;
|
|
75
|
-
if (t < 1 / 6) return p + (q - p) * 6 * t;
|
|
76
|
-
if (t < 1 / 2) return q;
|
|
77
|
-
if (t < 2 / 3) return p + (q - p) * (2 / 3 - t) * 6;
|
|
78
|
-
return p;
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
function registerIcons () {
|
|
82
|
-
fontawesomeSvgCore.library.add(freeSolidSvgIcons.faBackward);
|
|
83
|
-
fontawesomeSvgCore.library.add(freeSolidSvgIcons.faStepBackward);
|
|
84
|
-
fontawesomeSvgCore.library.add(freeSolidSvgIcons.faClock);
|
|
85
|
-
fontawesomeSvgCore.library.add(freeSolidSvgIcons.faStepForward);
|
|
86
|
-
fontawesomeSvgCore.library.add(freeSolidSvgIcons.faForward);
|
|
87
|
-
fontawesomeSvgCore.library.add(freeSolidSvgIcons.faPlay);
|
|
88
|
-
fontawesomeSvgCore.library.add(freeSolidSvgIcons.faStop);
|
|
89
|
-
fontawesomeSvgCore.library.add(freeSolidSvgIcons.faBorderAll);
|
|
90
|
-
fontawesomeSvgCore.library.add(freeSolidSvgIcons.faSlidersH);
|
|
91
|
-
fontawesomeSvgCore.library.add(freeSolidSvgIcons.faCut);
|
|
92
|
-
fontawesomeSvgCore.library.add(freeSolidSvgIcons.faHourglassStart);
|
|
93
|
-
fontawesomeSvgCore.library.add(freeSolidSvgIcons.faHourglassEnd);
|
|
94
|
-
fontawesomeSvgCore.library.add(freeSolidSvgIcons.faVideo);
|
|
95
|
-
fontawesomeSvgCore.library.add(freeSolidSvgIcons.faInfoCircle);
|
|
96
|
-
fontawesomeSvgCore.library.add(freeSolidSvgIcons.faTachometerAlt);
|
|
97
|
-
fontawesomeSvgCore.library.add(freeSolidSvgIcons.faServer);
|
|
98
|
-
fontawesomeSvgCore.library.add(freeSolidSvgIcons.faEye);
|
|
99
|
-
fontawesomeSvgCore.library.add(freeSolidSvgIcons.faEyeSlash);
|
|
100
|
-
fontawesomeSvgCore.library.add(freeSolidSvgIcons.faBan);
|
|
101
|
-
fontawesomeSvgCore.library.add(freeSolidSvgIcons.faSync);
|
|
102
|
-
fontawesomeSvgCore.library.add(freeSolidSvgIcons.faArrowTurnDown);
|
|
103
|
-
fontawesomeSvgCore.library.add(freeSolidSvgIcons.faArrowCircleDown);
|
|
104
|
-
fontawesomeSvgCore.library.add(freeSolidSvgIcons.faPause);
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
var index = {
|
|
108
|
-
async install(Vue, settings = {}) {
|
|
109
|
-
if (!settings.client || !settings.base_url || !settings.theme?.primary) {
|
|
110
|
-
console.error('Visualization: Missing required settings');
|
|
111
|
-
return;
|
|
112
|
-
}
|
|
113
|
-
if (this.installed) {
|
|
114
|
-
return;
|
|
115
|
-
}
|
|
116
|
-
this.installed = true;
|
|
117
|
-
Vue.use(VTooltip__default["default"]);
|
|
118
|
-
Vue.use(VueMask__default["default"]);
|
|
119
|
-
registerIcons();
|
|
120
|
-
Vue.component('font-awesome-icon', vueFontawesome.FontAwesomeIcon);
|
|
121
|
-
sessionStorage.setItem('server', 'principal');
|
|
122
|
-
sessionStorage.setItem('client', settings.client);
|
|
123
|
-
sessionStorage.setItem('base_url', settings.base_url);
|
|
124
|
-
const headTag = document.getElementsByTagName('head')[0];
|
|
125
|
-
const styleTag = document.createElement('style');
|
|
126
|
-
const theme = {
|
|
127
|
-
primary: settings.theme.primary,
|
|
128
|
-
secondary: colorVariation(settings.theme.primary),
|
|
129
|
-
start: settings.theme.start || '#4caf50',
|
|
130
|
-
end: settings.theme.end || '#ff5252'
|
|
131
|
-
};
|
|
132
|
-
let themeCss = [];
|
|
133
|
-
for (const color in theme) {
|
|
134
|
-
themeCss.push(`--visualization-${color}: ${theme[color]};`);
|
|
135
|
-
}
|
|
136
|
-
themeCss = [':root {', ...themeCss, '}'].join(' ');
|
|
137
|
-
styleTag.innerHTML = themeCss;
|
|
138
|
-
headTag.appendChild(styleTag);
|
|
139
|
-
Vue.component('Visualization', (await Promise.resolve().then(function () { return Visualization$1; })).default);
|
|
140
|
-
}
|
|
141
|
-
};
|
|
142
|
-
|
|
143
|
-
const Status = Object.freeze({
|
|
144
|
-
stopped: 0,
|
|
145
|
-
playing: 1,
|
|
146
|
-
paused: 2,
|
|
147
|
-
});
|
|
148
|
-
|
|
149
|
-
var Frame = {
|
|
150
|
-
render: function(){var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{class:{
|
|
151
|
-
'frame-container': true,
|
|
152
|
-
'initial-time': _vm.initialTime,
|
|
153
|
-
'end-time': _vm.endTime,
|
|
154
|
-
'between-time': _vm.betweenTime,
|
|
155
|
-
active: _vm.active,
|
|
156
|
-
},style:({
|
|
157
|
-
maxHeight: (_vm.maxHeight + "px"),
|
|
158
|
-
width: '100%',
|
|
159
|
-
position: 'relative',
|
|
160
|
-
})},[(_vm.active && _vm.activeTab && _vm.parentComponent.settingsClosed)?_c('GlobalEvents',{on:{"keydown":[function($event){if(!$event.type.indexOf('key')&&$event.keyCode!==32){ return null; }$event.preventDefault();return _vm.playOrPause.apply(null, arguments)},function($event){if(!$event.type.indexOf('key')&&$event.keyCode!==27){ return null; }$event.preventDefault();return _vm.stop.apply(null, arguments)},function($event){if(!$event.type.indexOf('key')&&$event.keyCode!==79){ return null; }return _vm.toogleDetailFrame.apply(null, arguments)},function($event){if(!$event.type.indexOf('key')&&$event.keyCode!==13){ return null; }$event.preventDefault();return _vm.jumpFrameToStart.apply(null, arguments)}]}}):_vm._e(),_vm._v(" "),(_vm.showFrame)?_c('GlobalEvents',{on:{"keydown":[function($event){if(!$event.type.indexOf('key')&&$event.keyCode!==27){ return null; }$event.preventDefault();return _vm.toogleDetailFrame.apply(null, arguments)},function($event){if(!$event.type.indexOf('key')&&$event.keyCode!==13){ return null; }$event.preventDefault();return _vm.toogleDetailFrame.apply(null, arguments)}]}}):_vm._e(),_vm._v(" "),_c('vue-loading',{staticStyle:{"z-index":"0"},attrs:{"active":((!_vm.frame.image || !_vm.frame.time) && _vm.frame.title !== -1) ||
|
|
161
|
-
_vm.loading ||
|
|
162
|
-
_vm.videoIsLoading,"spinner":"ring","color":"#1565c0","background-color":"#ededed","text":_vm.videoIsLoading ? _vm.$('infoBar.createVideo') : ''}}),_vm._v(" "),_c('div',{staticStyle:{"background-color":"black"}},[(!_vm.loading)?_c('div',{class:{
|
|
163
|
-
'frame-content': _vm.frame.title === -1 || _vm.videoStatus !== _vm.Status.stopped,
|
|
164
|
-
},style:({
|
|
165
|
-
maxHeight: (_vm.height + "px"),
|
|
166
|
-
maxWidth: (_vm.width + "px"),
|
|
167
|
-
color: 'white',
|
|
168
|
-
}),on:{"dblclick":_vm.playOrPause}},[(_vm.frame.image && _vm.videoStatus === _vm.Status.stopped)?_c('div',{class:{ 'dummy-frame': _vm.frame.title === -1 },staticStyle:{"width":"100%","height":"100%"},domProps:{"innerHTML":_vm._s(_vm.frame.image)}}):_vm._e(),_vm._v(" "),(_vm.videoStatus !== _vm.Status.stopped && !_vm.videoIsLoading)?_c('video',{ref:"videoPlayer",staticStyle:{"width":"100%","aspect-ratio":"11/9"},attrs:{"maxHeight":(_vm.height + "px"),"maxWidth":(_vm.width + "px"),"src":_vm.videoUrlString,"preload":"none","autoplay":""},on:{"timeupdate":_vm.updateTimeLabel,"ended":_vm.videoEnded,"click":_vm.playOrPause}}):_vm._e(),_vm._v(" "),_c('div',{staticClass:"overlay"})]):_vm._e()]),_vm._v(" "),_c('dialog',{ref:"imageDetailsDialog",class:{ 'dummy-frame': _vm.frame.title === -1 },staticStyle:{"width":"100vh","border":"none","background":"none"},domProps:{"innerHTML":_vm._s(_vm.frame.image)}})],1)},
|
|
169
|
-
staticRenderFns: [],
|
|
170
|
-
components: {
|
|
171
|
-
VueLoading: VueLoading__default["default"],
|
|
172
|
-
},
|
|
173
|
-
name: 'frame-component',
|
|
174
|
-
props: {
|
|
175
|
-
frame: {
|
|
176
|
-
type: [Object, Number],
|
|
177
|
-
required: true,
|
|
178
|
-
},
|
|
179
|
-
index: {
|
|
180
|
-
type: Number,
|
|
181
|
-
required: true,
|
|
182
|
-
},
|
|
183
|
-
loading: {
|
|
184
|
-
type: Boolean,
|
|
185
|
-
default: false,
|
|
186
|
-
},
|
|
187
|
-
gridSettings: {
|
|
188
|
-
type: Object,
|
|
189
|
-
required: true,
|
|
190
|
-
},
|
|
191
|
-
initialTime: {
|
|
192
|
-
type: Boolean,
|
|
193
|
-
default: false,
|
|
194
|
-
},
|
|
195
|
-
endTime: {
|
|
196
|
-
type: Boolean,
|
|
197
|
-
default: false,
|
|
198
|
-
},
|
|
199
|
-
betweenTime: {
|
|
200
|
-
type: Boolean,
|
|
201
|
-
default: false,
|
|
202
|
-
},
|
|
203
|
-
active: {
|
|
204
|
-
type: Boolean,
|
|
205
|
-
default: false,
|
|
206
|
-
},
|
|
207
|
-
activeTab: {
|
|
208
|
-
type: Boolean,
|
|
209
|
-
default: false,
|
|
210
|
-
},
|
|
211
|
-
videoUrl: {
|
|
212
|
-
type: [String, Promise],
|
|
213
|
-
required: true,
|
|
214
|
-
},
|
|
215
|
-
playbackRate: {
|
|
216
|
-
type: Number,
|
|
217
|
-
default: 1,
|
|
218
|
-
},
|
|
219
|
-
},
|
|
220
|
-
data() {
|
|
221
|
-
return {
|
|
222
|
-
Status,
|
|
223
|
-
aspectRatio: 11 / 9,
|
|
224
|
-
width: 0,
|
|
225
|
-
height: 0,
|
|
226
|
-
maxWidth: 0,
|
|
227
|
-
fullMaxWidth: 0,
|
|
228
|
-
maxHeight: 0,
|
|
229
|
-
showFrame: false,
|
|
230
|
-
videoStatus: Status.stopped,
|
|
231
|
-
videoStartTime: null,
|
|
232
|
-
videoCurrentTime: null,
|
|
233
|
-
videoUrlString: '',
|
|
234
|
-
parentComponent: null,
|
|
235
|
-
videoIsLoading: false,
|
|
236
|
-
currentBlock: null,
|
|
237
|
-
lastTimeEnterPressed: null,
|
|
238
|
-
}
|
|
239
|
-
},
|
|
240
|
-
created() {
|
|
241
|
-
this.parentComponent = this.$parent;
|
|
242
|
-
},
|
|
243
|
-
watch: {
|
|
244
|
-
playbackRate(val) {
|
|
245
|
-
if (
|
|
246
|
-
this.videoStatus === Status.playing ||
|
|
247
|
-
this.videoStatus === Status.paused
|
|
248
|
-
) {
|
|
249
|
-
this.$refs.videoPlayer.playbackRate = val;
|
|
250
|
-
}
|
|
251
|
-
},
|
|
252
|
-
},
|
|
253
|
-
methods: {
|
|
254
|
-
jumpFrameToStart() {
|
|
255
|
-
if (this.active) {
|
|
256
|
-
const currentTime = new Date().getTime();
|
|
257
|
-
|
|
258
|
-
if (currentTime - this.lastTimeEnterPressed <= 500) {
|
|
259
|
-
this.parentComponent.changeHour(
|
|
260
|
-
this.parentComponent.convertToAudienceTime(this.frame.time)
|
|
261
|
-
);
|
|
262
|
-
}
|
|
263
|
-
|
|
264
|
-
this.lastTimeEnterPressed = currentTime;
|
|
265
|
-
}
|
|
266
|
-
},
|
|
267
|
-
changeSettings(value) {
|
|
268
|
-
this.videoCurrentTime = value;
|
|
269
|
-
},
|
|
270
|
-
toogleDetailFrame() {
|
|
271
|
-
if (this.showFrame) {
|
|
272
|
-
this.$refs.imageDetailsDialog.close();
|
|
273
|
-
} else {
|
|
274
|
-
this.$refs.imageDetailsDialog.showModal();
|
|
275
|
-
}
|
|
276
|
-
this.showFrame = !this.showFrame;
|
|
277
|
-
},
|
|
278
|
-
getMaxWidth() {
|
|
279
|
-
const commandBarSize = document.getElementById('command-bar');
|
|
280
|
-
|
|
281
|
-
return commandBarSize?.clientWidth
|
|
282
|
-
},
|
|
283
|
-
resize(height) {
|
|
284
|
-
const commandBarSize = document.getElementById('command-bar');
|
|
285
|
-
const infoBarSize = document.getElementById('info-bar');
|
|
286
|
-
this.fullMaxWidth = commandBarSize?.clientWidth;
|
|
287
|
-
this.maxWidth =
|
|
288
|
-
(commandBarSize?.clientWidth - this.gridSettings.framesPerRow * 10) /
|
|
289
|
-
this.gridSettings.framesPerRow;
|
|
290
|
-
|
|
291
|
-
const heightAvailable =
|
|
292
|
-
height -
|
|
293
|
-
commandBarSize?.offsetHeight -
|
|
294
|
-
infoBarSize?.offsetHeight -
|
|
295
|
-
47 * this.gridSettings.numberOfRows;
|
|
296
|
-
|
|
297
|
-
this.maxHeight =
|
|
298
|
-
this.gridSettings.numberOfRows === 2
|
|
299
|
-
? (heightAvailable - 12) / 2
|
|
300
|
-
: heightAvailable;
|
|
301
|
-
this.maxHeight = this.maxHeight >= 75 ? this.maxHeight : 75;
|
|
302
|
-
|
|
303
|
-
if (this.maxWidth / this.aspectRatio > this.maxHeight) {
|
|
304
|
-
this.height = this.maxHeight;
|
|
305
|
-
this.width = this.maxHeight * this.aspectRatio;
|
|
306
|
-
} else {
|
|
307
|
-
this.width = this.maxWidth;
|
|
308
|
-
this.height = this.maxWidth / this.aspectRatio;
|
|
309
|
-
}
|
|
310
|
-
|
|
311
|
-
this.maxHeight = this.height;
|
|
312
|
-
},
|
|
313
|
-
async playOrPause() {
|
|
314
|
-
switch (this.videoStatus) {
|
|
315
|
-
case Status.stopped:
|
|
316
|
-
this.videoIsLoading = true;
|
|
317
|
-
try {
|
|
318
|
-
this.videoUrlString = await this.videoUrl;
|
|
319
|
-
const blockInfo =
|
|
320
|
-
await this.parentComponent.fInterface?.getVideoStartTime(
|
|
321
|
-
this.frame
|
|
322
|
-
);
|
|
323
|
-
|
|
324
|
-
this.videoStartTime = blockInfo.start;
|
|
325
|
-
this.videoUrlString =
|
|
326
|
-
this.parentComponent.fInterface.getVideoRequestByUrl(
|
|
327
|
-
blockInfo.url,
|
|
328
|
-
this.frame.number
|
|
329
|
-
);
|
|
330
|
-
} catch (error) {
|
|
331
|
-
console.log(error);
|
|
332
|
-
}
|
|
333
|
-
this.videoIsLoading = false;
|
|
334
|
-
this.videoStatus = Status.playing;
|
|
335
|
-
this.$nextTick(() => {
|
|
336
|
-
this.$refs.videoPlayer.onloadedmetadata = (e) => {
|
|
337
|
-
this.$refs.videoPlayer.playbackRate = this.playbackRate;
|
|
338
|
-
// * atualizar slider
|
|
339
|
-
this.$emit('updateSlider', this.videoStartTime, this.frame.time);
|
|
340
|
-
//*
|
|
341
|
-
this.$emit('startPlaying', this.frame, e.target.duration);
|
|
342
|
-
this.$emit('playPauseStatus', true);
|
|
343
|
-
};
|
|
344
|
-
});
|
|
345
|
-
break
|
|
346
|
-
case Status.paused:
|
|
347
|
-
this.$refs.videoPlayer.play();
|
|
348
|
-
this.$refs.videoPlayer.playbackRate = this.playbackRate;
|
|
349
|
-
this.videoStatus = Status.playing;
|
|
350
|
-
this.$emit('playPauseStatus', true);
|
|
351
|
-
break
|
|
352
|
-
case Status.playing:
|
|
353
|
-
this.$refs.videoPlayer.pause();
|
|
354
|
-
|
|
355
|
-
this.videoStatus = Status.paused;
|
|
356
|
-
this.$emit('playPauseStatus', false);
|
|
357
|
-
break
|
|
358
|
-
}
|
|
359
|
-
},
|
|
360
|
-
stop(jump = true) {
|
|
361
|
-
if (
|
|
362
|
-
this.videoStatus === Status.playing ||
|
|
363
|
-
this.videoStatus === Status.paused
|
|
364
|
-
) {
|
|
365
|
-
if (jump) {
|
|
366
|
-
this.parentComponent.changeHour(
|
|
367
|
-
this.parentComponent.convertToAudienceTime(
|
|
368
|
-
parseInt(this.videoCurrentTime)
|
|
369
|
-
)
|
|
370
|
-
);
|
|
371
|
-
}
|
|
372
|
-
this.videoStatus = Status.stopped;
|
|
373
|
-
this.videoUrlString = null;
|
|
374
|
-
this.videoCurrentTime = null;
|
|
375
|
-
this.videoStartTime = null;
|
|
376
|
-
}
|
|
377
|
-
this.$emit('stopPlaying');
|
|
378
|
-
},
|
|
379
|
-
//eslint-disable-next-line
|
|
380
|
-
videoJumpTo(time) {
|
|
381
|
-
this.videoCurrentTime = this.videoStartTime + time;
|
|
382
|
-
this.$refs.videoPlayer.currentTime = time;
|
|
383
|
-
},
|
|
384
|
-
async videoJumpToTimeStamp(time) {
|
|
385
|
-
let frame = {
|
|
386
|
-
time: time,
|
|
387
|
-
};
|
|
388
|
-
if (!time) return
|
|
389
|
-
if (
|
|
390
|
-
!(
|
|
391
|
-
this.currentBlock &&
|
|
392
|
-
time >= this.currentBlock.start &&
|
|
393
|
-
time <= this.currentBlock.end
|
|
394
|
-
)
|
|
395
|
-
) {
|
|
396
|
-
this.currentBlock = await this.parentComponent.fInterface?.getBlockInfo(
|
|
397
|
-
frame
|
|
398
|
-
);
|
|
399
|
-
this.videoStartTime = this.currentBlock.start;
|
|
400
|
-
this.videoUrlString =
|
|
401
|
-
this.parentComponent.fInterface.getVideoUrlForTime(
|
|
402
|
-
this.videoStartTime
|
|
403
|
-
);
|
|
404
|
-
}
|
|
405
|
-
this.videoCurrentTime = time - this.videoStartTime;
|
|
406
|
-
this.$refs.videoPlayer.currentTime = this.videoCurrentTime;
|
|
407
|
-
},
|
|
408
|
-
updateTimeLabel(e) {
|
|
409
|
-
this.videoCurrentTime = this.videoStartTime + e.target.currentTime;
|
|
410
|
-
this.parentComponent.updateVideoTime(this.index, this.videoCurrentTime);
|
|
411
|
-
this.parentComponent.updateVideoStatus(e.target.currentTime);
|
|
412
|
-
},
|
|
413
|
-
async videoEnded() {
|
|
414
|
-
this.videoStartTime =
|
|
415
|
-
await this.parentComponent.fInterface?.getNextVideoStartTime(
|
|
416
|
-
this.frame.time
|
|
417
|
-
);
|
|
418
|
-
this.videoUrlString = this.parentComponent.fInterface.getVideoUrlForTime(
|
|
419
|
-
this.videoStartTime
|
|
420
|
-
);
|
|
421
|
-
// * Ao acabar o vídeo tenho de mandar atualizar slider
|
|
422
|
-
// * aqui o video current time tambem vai ser o videoStartTime
|
|
423
|
-
this.$emit('updateSlider', this.videoStartTime, this.videoStartTime);
|
|
424
|
-
},
|
|
425
|
-
},
|
|
426
|
-
};
|
|
427
|
-
|
|
428
|
-
const Api = axios__default["default"].create({
|
|
429
|
-
//baseURL: process.env.VUE_APP_FRAMES_SERVER,
|
|
430
|
-
baseURL: sessionStorage.getItem('base_url')
|
|
431
|
-
});
|
|
432
|
-
Api.interceptors.request.use(config => {
|
|
433
|
-
config.params = config.params || {};
|
|
434
|
-
config.params.Client = sessionStorage.getItem('client') || 'UNKNOWN';
|
|
435
|
-
if (sessionStorage.getItem('server') === 'alternative') {
|
|
436
|
-
config.params.BlockPathConfig = 'AlernativeTvConfig';
|
|
437
|
-
}
|
|
438
|
-
return config;
|
|
439
|
-
});
|
|
440
|
-
var FramesService = {
|
|
441
|
-
getBlockRequest({
|
|
442
|
-
direction,
|
|
443
|
-
channel,
|
|
444
|
-
split,
|
|
445
|
-
time,
|
|
446
|
-
quality,
|
|
447
|
-
factor,
|
|
448
|
-
useCache = true,
|
|
449
|
-
signal
|
|
450
|
-
} = {}) {
|
|
451
|
-
return Api.get(`Get${direction}FramesBlockInFiles`, {
|
|
452
|
-
params: {
|
|
453
|
-
Channel: channel,
|
|
454
|
-
Split: split,
|
|
455
|
-
UseCache: useCache,
|
|
456
|
-
Time: time,
|
|
457
|
-
Step: 0,
|
|
458
|
-
JpegQuality: quality,
|
|
459
|
-
JpegSizeFactor: factor
|
|
460
|
-
},
|
|
461
|
-
signal
|
|
462
|
-
});
|
|
463
|
-
},
|
|
464
|
-
getSmallBlockRequest({
|
|
465
|
-
channel,
|
|
466
|
-
split,
|
|
467
|
-
time,
|
|
468
|
-
quality,
|
|
469
|
-
factor,
|
|
470
|
-
size,
|
|
471
|
-
useCache = true,
|
|
472
|
-
signal
|
|
473
|
-
} = {}) {
|
|
474
|
-
return Api.get('GetSmallFramesBlockInFiles', {
|
|
475
|
-
params: {
|
|
476
|
-
Channel: channel,
|
|
477
|
-
Split: split,
|
|
478
|
-
UseCache: useCache,
|
|
479
|
-
Time: time,
|
|
480
|
-
Step: 0,
|
|
481
|
-
JpegQuality: quality,
|
|
482
|
-
JpegSizeFactor: factor,
|
|
483
|
-
Size: size
|
|
484
|
-
},
|
|
485
|
-
signal
|
|
486
|
-
});
|
|
487
|
-
},
|
|
488
|
-
getFileInfoRequest({
|
|
489
|
-
direction,
|
|
490
|
-
channel,
|
|
491
|
-
split,
|
|
492
|
-
time,
|
|
493
|
-
step,
|
|
494
|
-
signal
|
|
495
|
-
} = {}) {
|
|
496
|
-
return Api.get(`Get${direction}BlockFileInformation`, {
|
|
497
|
-
params: {
|
|
498
|
-
Channel: channel,
|
|
499
|
-
Split: split,
|
|
500
|
-
Time: time,
|
|
501
|
-
Step: step
|
|
502
|
-
},
|
|
503
|
-
signal
|
|
504
|
-
});
|
|
505
|
-
},
|
|
506
|
-
getNextAvailableBlock({
|
|
507
|
-
channel,
|
|
508
|
-
time,
|
|
509
|
-
signal
|
|
510
|
-
} = {}) {
|
|
511
|
-
// process.env.VUE_APP_NEXT_AVAILABLE_BLOCK
|
|
512
|
-
|
|
513
|
-
return Api.get(`GetPreviousAvailableBlockFileInformation`, {
|
|
514
|
-
params: {
|
|
515
|
-
Channel: channel,
|
|
516
|
-
Split: 1,
|
|
517
|
-
Time: time,
|
|
518
|
-
Step: 0
|
|
519
|
-
},
|
|
520
|
-
signal
|
|
521
|
-
});
|
|
522
|
-
}
|
|
523
|
-
|
|
524
|
-
// getVideoRequestQuery(direction, channel, split, time, step) {
|
|
525
|
-
// return (
|
|
526
|
-
// this.serverUrl +
|
|
527
|
-
// 'Get' + direction + 'Video' +
|
|
528
|
-
// '?Client=' +
|
|
529
|
-
// client +
|
|
530
|
-
// '&Channel=' +
|
|
531
|
-
// channel +
|
|
532
|
-
// '&Split=' +
|
|
533
|
-
// split +
|
|
534
|
-
// '&Time=' +
|
|
535
|
-
// time +
|
|
536
|
-
// '&Step=' +
|
|
537
|
-
// step +
|
|
538
|
-
// this.serverUrlExtraParams
|
|
539
|
-
// )
|
|
540
|
-
// }
|
|
541
|
-
|
|
542
|
-
// getVideoRequestByTime(channel, time) {
|
|
543
|
-
// return (
|
|
544
|
-
// this.serverUrl +
|
|
545
|
-
// 'GetVideo?channel=' +
|
|
546
|
-
// channel +
|
|
547
|
-
// '&time=' +
|
|
548
|
-
// time +
|
|
549
|
-
// this.serverUrlExtraParams
|
|
550
|
-
// )
|
|
551
|
-
// }
|
|
552
|
-
};
|
|
553
|
-
|
|
554
|
-
var ENUM = {
|
|
555
|
-
MinBlockSizes: Object.freeze({
|
|
556
|
-
1: 3600,
|
|
557
|
-
2: 3600,
|
|
558
|
-
3: 3600,
|
|
559
|
-
4: 3600,
|
|
560
|
-
5: 3600
|
|
561
|
-
}),
|
|
562
|
-
MinBlockSizesBack: Object.freeze({
|
|
563
|
-
1: 1800,
|
|
564
|
-
2: 1800,
|
|
565
|
-
3: 1800,
|
|
566
|
-
4: 1800,
|
|
567
|
-
5: 1800
|
|
568
|
-
}),
|
|
569
|
-
Direction: Object.freeze({
|
|
570
|
-
Next: 'Next',
|
|
571
|
-
Previous: 'Previous',
|
|
572
|
-
Self: ''
|
|
573
|
-
}),
|
|
574
|
-
JpegQuality: Object.freeze({
|
|
575
|
-
LowestQuality: '1',
|
|
576
|
-
LowQuality: '25',
|
|
577
|
-
MediumQuality: '50',
|
|
578
|
-
HighQuality: '75',
|
|
579
|
-
HighestQuality: '100'
|
|
580
|
-
}),
|
|
581
|
-
ResponseStatus: Object.freeze({
|
|
582
|
-
Ok: 1,
|
|
583
|
-
UnknownError: -1,
|
|
584
|
-
VideoBlockNotFound: -2,
|
|
585
|
-
InvalidRequest: -3,
|
|
586
|
-
ClientNotAllowed: -4,
|
|
587
|
-
AuthenticationProblem: -5
|
|
588
|
-
}),
|
|
589
|
-
StepsQuality: Object.freeze({
|
|
590
|
-
1: '50',
|
|
591
|
-
// 50 -> MediumQuality of JpegQuality
|
|
592
|
-
2: '50',
|
|
593
|
-
// 50 -> MediumQuality of JpegQuality
|
|
594
|
-
3: '50',
|
|
595
|
-
// 50 -> MediumQuality of JpegQuality
|
|
596
|
-
4: '50',
|
|
597
|
-
// 50 -> MediumQuality of JpegQuality
|
|
598
|
-
5: '50' // 50 -> MediumQuality of JpegQuality
|
|
599
|
-
}),
|
|
600
|
-
|
|
601
|
-
SizeQuality: Object.freeze({
|
|
602
|
-
1: '100'
|
|
603
|
-
}),
|
|
604
|
-
// 100 -> HighestQuality of JpegQuality
|
|
605
|
-
|
|
606
|
-
StepsFactor: Object.freeze({
|
|
607
|
-
1: 1,
|
|
608
|
-
2: 1,
|
|
609
|
-
3: 1,
|
|
610
|
-
4: 1,
|
|
611
|
-
5: 1
|
|
612
|
-
}),
|
|
613
|
-
SmallBlockSize: Object.freeze({
|
|
614
|
-
1: 1,
|
|
615
|
-
2: 1,
|
|
616
|
-
3: 1,
|
|
617
|
-
4: 1,
|
|
618
|
-
5: 1
|
|
619
|
-
})
|
|
620
|
-
};
|
|
621
|
-
|
|
622
|
-
function FramesManager(channel, size, currentTime, startAudienceTime, useCache = true) {
|
|
623
|
-
this.channel = channel;
|
|
624
|
-
this.size = size;
|
|
625
|
-
this.currentTime = currentTime;
|
|
626
|
-
this.useCache = useCache;
|
|
627
|
-
this.startAudienceTime = startAudienceTime;
|
|
628
|
-
this.firstFrameTime = currentTime;
|
|
629
|
-
this.buffer = [];
|
|
630
|
-
this.requests = {};
|
|
631
|
-
this.currentStep = 1;
|
|
632
|
-
this.currentPosition = 0;
|
|
633
|
-
this.smallBlockSizeFactor = 2;
|
|
634
|
-
this.startCheckingQualityStep = 1;
|
|
635
|
-
this.startCheckingQualitySize = 1;
|
|
636
|
-
this.numberOfSmallBlocksCheck = 3;
|
|
637
|
-
}
|
|
638
|
-
FramesManager.prototype.goTo = async function (time) {
|
|
639
|
-
this.cancelAllPendingRequests();
|
|
640
|
-
this.currentTime = time || this.currentTime;
|
|
641
|
-
const frameIndex = this.findFrameIndexByTime(this.currentTime);
|
|
642
|
-
if (frameIndex >= 0) {
|
|
643
|
-
this.currentPosition = frameIndex;
|
|
644
|
-
} else {
|
|
645
|
-
this.buffer = [];
|
|
646
|
-
await this.getSmallBlock(this.currentTime, this.channel, 1);
|
|
647
|
-
}
|
|
648
|
-
};
|
|
649
|
-
FramesManager.prototype.getSmallBlock = async function (time, channel, split, add = false) {
|
|
650
|
-
const requestId = `smallBlock_${time}`;
|
|
651
|
-
try {
|
|
652
|
-
if (!this.requests[requestId]) {
|
|
653
|
-
this.requests[requestId] = new AbortController();
|
|
654
|
-
let response = (await FramesService.getSmallBlockRequest({
|
|
655
|
-
channel,
|
|
656
|
-
split,
|
|
657
|
-
time,
|
|
658
|
-
size: this.size * 15,
|
|
659
|
-
quality: ENUM.StepsQuality[this.currentStep],
|
|
660
|
-
factor: ENUM.StepsFactor[this.currentStep],
|
|
661
|
-
signal: this.requests[requestId].signal
|
|
662
|
-
})).data;
|
|
663
|
-
if (!this.requests[requestId]) {
|
|
664
|
-
throw 'Response not needed anymore';
|
|
665
|
-
}
|
|
666
|
-
if (response.status !== ENUM.ResponseStatus.Ok) {
|
|
667
|
-
await this.getBlock(time, channel, split, ENUM.Direction.Previous, true);
|
|
668
|
-
await this.getBlock(time, channel, split, ENUM.Direction.Next, true);
|
|
669
|
-
throw response?.message || 'Unknown error';
|
|
670
|
-
}
|
|
671
|
-
response = response.data;
|
|
672
|
-
const images = response.frames;
|
|
673
|
-
this.requests[`block_${ENUM.Direction.Next}_${response.end}`] = true;
|
|
674
|
-
this.getBlock(time, this.channel, 1, ENUM.Direction.Self, true, true);
|
|
675
|
-
if (!add) {
|
|
676
|
-
const firstFrameTime = images[0].time;
|
|
677
|
-
const lastFrameTime = images[images.length - 1].time;
|
|
678
|
-
if (lastFrameTime === response.end) {
|
|
679
|
-
await this.getSmallBlock(lastFrameTime + 1, this.channel, 1, true);
|
|
680
|
-
} else if (this.timestampToTimeString(firstFrameTime) !== this.startAudienceTime && firstFrameTime === response.start) {
|
|
681
|
-
await this.getSmallBlock(firstFrameTime - this.currentStep * this.size, this.channel, 1, true);
|
|
682
|
-
}
|
|
683
|
-
}
|
|
684
|
-
this.orderFramesBlock(images);
|
|
685
|
-
this.currentPosition = this.findFrameIndexByTime(this.currentTime);
|
|
686
|
-
delete this.requests[`block_${ENUM.Direction.Next}_${response.end}`];
|
|
687
|
-
delete this.requests[requestId];
|
|
688
|
-
return true;
|
|
689
|
-
}
|
|
690
|
-
console.error(`Frames Manager (GetSmallBlock): Request blocked by another equal request occurring`);
|
|
691
|
-
return false;
|
|
692
|
-
} catch (err) {
|
|
693
|
-
console.error(`Frames Manager (GetSmallBlock): ${err}`);
|
|
694
|
-
delete this.requests[requestId];
|
|
695
|
-
return false;
|
|
696
|
-
}
|
|
697
|
-
};
|
|
698
|
-
FramesManager.prototype.getBlock = async function (time, channel, split, direction, checkMinBlock, substituition = false) {
|
|
699
|
-
const requestId = `block_${direction}_${time}`;
|
|
700
|
-
try {
|
|
701
|
-
if (!this.requests[requestId]) {
|
|
702
|
-
this.requests[requestId] = new AbortController();
|
|
703
|
-
let response = (await FramesService.getBlockRequest({
|
|
704
|
-
direction,
|
|
705
|
-
channel,
|
|
706
|
-
split,
|
|
707
|
-
time,
|
|
708
|
-
quality: ENUM.StepsQuality[this.currentStep],
|
|
709
|
-
factor: ENUM.StepsFactor[this.currentStep],
|
|
710
|
-
signal: this.requests[requestId].signal
|
|
711
|
-
})).data;
|
|
712
|
-
if (!this.requests[requestId]) {
|
|
713
|
-
throw 'Response not needed anymore';
|
|
714
|
-
}
|
|
715
|
-
if (response.status !== ENUM.ResponseStatus.Ok) {
|
|
716
|
-
throw response?.message || 'Unknown error';
|
|
717
|
-
}
|
|
718
|
-
this.orderFramesBlock(response.data.frames);
|
|
719
|
-
this.currentPosition = this.findFrameIndexByTime(this.currentTime);
|
|
720
|
-
if (checkMinBlock) {
|
|
721
|
-
await this.checkMinBlockSize(!substituition);
|
|
722
|
-
}
|
|
723
|
-
delete this.requests[requestId];
|
|
724
|
-
return true;
|
|
725
|
-
}
|
|
726
|
-
console.error(`Frames Manager (GetBlock ${direction}): Request blocked by another equal request occurring`);
|
|
727
|
-
return false;
|
|
728
|
-
} catch (err) {
|
|
729
|
-
console.error(`Frames Manager (GetBlock ${direction}): ${err}`);
|
|
730
|
-
delete this.requests[requestId];
|
|
731
|
-
return false;
|
|
732
|
-
}
|
|
733
|
-
};
|
|
734
|
-
FramesManager.prototype.checkMinBlockSize = async function (checkMinBlock) {
|
|
735
|
-
if (this.checkFramesBackward()) {
|
|
736
|
-
await this.getBlock(this.buffer.length === 0 ? this.currentTime : this.buffer[0].time, this.channel, 1, ENUM.Direction[this.buffer.length === 0 ? 'Self' : 'Previous'], checkMinBlock, (this.buffer[0]?.number || 0) !== 0);
|
|
737
|
-
}
|
|
738
|
-
if (this.checkFramesForward()) {
|
|
739
|
-
await this.getBlock(this.buffer.length === 0 ? this.currentTime : this.buffer[this.buffer.length - 1].time, this.channel, 1, ENUM.Direction[this.buffer.length === 0 ? 'Self' : 'Next'], checkMinBlock);
|
|
740
|
-
}
|
|
741
|
-
};
|
|
742
|
-
FramesManager.prototype.checkFramesForward = function () {
|
|
743
|
-
return this.buffer.length - this.currentPosition < ENUM.MinBlockSizes[this.currentStep] * (this.size / 6);
|
|
744
|
-
};
|
|
745
|
-
FramesManager.prototype.checkFramesBackward = function () {
|
|
746
|
-
return this.currentPosition < ENUM.MinBlockSizesBack[this.currentStep];
|
|
747
|
-
};
|
|
748
|
-
FramesManager.prototype.orderFramesBlock = function (images) {
|
|
749
|
-
if (this.buffer.length > 0) {
|
|
750
|
-
const bufferFistTime = this.buffer[0].time;
|
|
751
|
-
const bufferLastTime = this.buffer[this.buffer.length - 1].time;
|
|
752
|
-
const beforeImages = images.filter(image => image.time < bufferFistTime);
|
|
753
|
-
const afterImages = images.filter(image => image.time > bufferLastTime);
|
|
754
|
-
this.buffer = [...beforeImages, ...this.buffer, ...afterImages];
|
|
755
|
-
} else {
|
|
756
|
-
this.buffer = images;
|
|
757
|
-
}
|
|
758
|
-
};
|
|
759
|
-
FramesManager.prototype.findFrameIndexByTime = function (time) {
|
|
760
|
-
return this.buffer.findIndex(frame => frame.time === time);
|
|
761
|
-
};
|
|
762
|
-
FramesManager.prototype.cancelAllPendingRequests = function () {
|
|
763
|
-
for (const request in this.requests) {
|
|
764
|
-
const value = this.requests[request];
|
|
765
|
-
if (typeof value === 'object' && 'signal' in value) {
|
|
766
|
-
value.abort();
|
|
767
|
-
}
|
|
768
|
-
delete this.requests[request];
|
|
769
|
-
}
|
|
770
|
-
};
|
|
771
|
-
FramesManager.prototype.timestampToTimeString = function (timestamp) {
|
|
772
|
-
return new Date(timestamp * 1000).toISOString().substring(11, 19).replace(/:/g, '');
|
|
773
|
-
};
|
|
774
|
-
FramesManager.prototype.getPrevImages = function () {
|
|
775
|
-
if (this.timestampToTimeString(this.currentTime) === this.startAudienceTime) {
|
|
776
|
-
return null;
|
|
777
|
-
}
|
|
778
|
-
return this.getBufferSlice(this.currentPosition - this.size * this.currentStep, this.currentPosition);
|
|
779
|
-
};
|
|
780
|
-
FramesManager.prototype.getCurrentImages = function () {
|
|
781
|
-
return this.getBufferSlice(this.currentPosition, this.currentPosition + this.size * this.currentStep);
|
|
782
|
-
};
|
|
783
|
-
FramesManager.prototype.getNextImages = function () {
|
|
784
|
-
return this.getBufferSlice(this.currentPosition + this.size * this.currentStep, this.currentPosition + this.size * 2 * this.currentStep);
|
|
785
|
-
};
|
|
786
|
-
FramesManager.prototype.getBufferSlice = function (start, end) {
|
|
787
|
-
let slice = this.buffer.slice(start, end);
|
|
788
|
-
if (this.currentStep !== 1) {
|
|
789
|
-
slice = slice.filter((f, i) => i % this.currentStep === 0);
|
|
790
|
-
}
|
|
791
|
-
if (slice.length < this.size) {
|
|
792
|
-
return null;
|
|
793
|
-
}
|
|
794
|
-
return slice;
|
|
795
|
-
};
|
|
796
|
-
FramesManager.prototype.next = function () {
|
|
797
|
-
const newPosition = this.currentPosition + this.currentStep * this.size;
|
|
798
|
-
this.currentPosition = newPosition < this.buffer.length ? newPosition : this.currentPosition;
|
|
799
|
-
this.currentTime = this.buffer[this.currentPosition]?.time || this.currentTime;
|
|
800
|
-
this.checkMinBlockSize(true);
|
|
801
|
-
};
|
|
802
|
-
FramesManager.prototype.previous = function () {
|
|
803
|
-
const newPosition = this.currentPosition - this.size * this.currentStep;
|
|
804
|
-
this.currentPosition = newPosition > 0 ? newPosition : 0;
|
|
805
|
-
this.currentTime = this.buffer[this.currentPosition]?.time || this.currentTime;
|
|
806
|
-
this.checkMinBlockSize(true);
|
|
807
|
-
};
|
|
808
|
-
FramesManager.prototype.getFileInfo = async function (time, step) {
|
|
809
|
-
if (time) {
|
|
810
|
-
let response = (await FramesService.getFileInfoRequest({
|
|
811
|
-
direction: ENUM.Direction.Self,
|
|
812
|
-
channel: this.channel,
|
|
813
|
-
split: this.currentStep,
|
|
814
|
-
time: time,
|
|
815
|
-
step: step
|
|
816
|
-
})).data;
|
|
817
|
-
if (response.status == ENUM.ResponseStatus.Ok) {
|
|
818
|
-
return response.data;
|
|
819
|
-
} else {
|
|
820
|
-
return null;
|
|
821
|
-
}
|
|
822
|
-
} else {
|
|
823
|
-
return null;
|
|
824
|
-
}
|
|
825
|
-
};
|
|
826
|
-
FramesManager.prototype.getNextFileInfo = async function (time, step) {
|
|
827
|
-
let response = (await FramesService.getFileInfoRequest({
|
|
828
|
-
direction: ENUM.Direction.Next,
|
|
829
|
-
channel: this.channel,
|
|
830
|
-
split: this.currentStep,
|
|
831
|
-
time: time,
|
|
832
|
-
step: step
|
|
833
|
-
})).data;
|
|
834
|
-
if (response.status == ENUM.ResponseStatus.Ok) {
|
|
835
|
-
return response.data;
|
|
836
|
-
} else {
|
|
837
|
-
return null;
|
|
838
|
-
}
|
|
839
|
-
};
|
|
840
|
-
|
|
841
|
-
const server = sessionStorage.getItem('server');
|
|
842
|
-
function getServerUrlWithParams() {
|
|
843
|
-
return {
|
|
844
|
-
url: sessionStorage.getItem('base_url'),
|
|
845
|
-
params: server === 'alternative' ? '&BlockPathConfig=AlernativeTvConfig' : ''
|
|
846
|
-
};
|
|
847
|
-
}
|
|
848
|
-
function FramesInterface(channel, numberOfRows, framesPerRow, currentTime, startAudienceTime, useCache = true) {
|
|
849
|
-
this.channel = channel;
|
|
850
|
-
this.numberOfRows = numberOfRows;
|
|
851
|
-
this.framesPerRow = framesPerRow;
|
|
852
|
-
this.currentTime = currentTime;
|
|
853
|
-
this.firstFrameTime = currentTime;
|
|
854
|
-
this.startAudienceTime = startAudienceTime;
|
|
855
|
-
this.useCache = useCache;
|
|
856
|
-
}
|
|
857
|
-
FramesInterface.prototype.init = async function () {
|
|
858
|
-
this.framesManager = await new FramesManager(this.channel, this.numberOfRows * this.framesPerRow, this.currentTime, this.startAudienceTime, this.useCache);
|
|
859
|
-
await this.framesManager.goTo();
|
|
860
|
-
await this.loadFrames();
|
|
861
|
-
};
|
|
862
|
-
FramesInterface.prototype.initLight = async function () {
|
|
863
|
-
this.framesManager = await new FramesManager(this.channel, this.numberOfRows * this.framesPerRow, this.currentTime, this.startAudienceTime, this.useCache);
|
|
864
|
-
};
|
|
865
|
-
FramesInterface.prototype.changeTime = async function (time) {
|
|
866
|
-
await this.framesManager.goTo(time);
|
|
867
|
-
await this.loadFrames();
|
|
868
|
-
};
|
|
869
|
-
FramesInterface.prototype.loadFrames = async function () {
|
|
870
|
-
let prev = (await this.framesManager.getPrevImages()) || [];
|
|
871
|
-
let next = (await this.framesManager.getNextImages()) || [];
|
|
872
|
-
let current = (await this.framesManager.getCurrentImages()) || [];
|
|
873
|
-
prev = await this.constructImagesComponent(prev);
|
|
874
|
-
current = await this.constructImagesComponent(current);
|
|
875
|
-
next = await this.constructImagesComponent(next);
|
|
876
|
-
this.frames = {
|
|
877
|
-
prev,
|
|
878
|
-
current,
|
|
879
|
-
next
|
|
880
|
-
};
|
|
881
|
-
};
|
|
882
|
-
FramesInterface.prototype.loadNextFrames = async function () {
|
|
883
|
-
this.framesManager.next();
|
|
884
|
-
let next = (await this.framesManager.getNextImages()) || [];
|
|
885
|
-
next = await this.constructImagesComponent(next);
|
|
886
|
-
this.frames.prev = this.frames.current;
|
|
887
|
-
this.frames.current = this.frames.next;
|
|
888
|
-
this.frames.next = next;
|
|
889
|
-
};
|
|
890
|
-
FramesInterface.prototype.loadPrevFrames = async function () {
|
|
891
|
-
this.framesManager.previous();
|
|
892
|
-
console.log(this.framesManager.currentTime, this.firstFrameTime);
|
|
893
|
-
if (this.framesManager.currentTime < this.firstFrameTime) {
|
|
894
|
-
await this.framesManager.goTo(this.firstFrameTime);
|
|
895
|
-
await this.loadFrames();
|
|
896
|
-
return;
|
|
897
|
-
}
|
|
898
|
-
let prev = (await this.framesManager.getPrevImages()) || [];
|
|
899
|
-
prev = await this.constructImagesComponent(prev);
|
|
900
|
-
this.frames.next = this.frames.current;
|
|
901
|
-
this.frames.current = this.frames.prev;
|
|
902
|
-
this.frames.prev = prev;
|
|
903
|
-
};
|
|
904
|
-
FramesInterface.prototype.constructImagesComponent = async function (array) {
|
|
905
|
-
const Semaphor = [];
|
|
906
|
-
for (let frame of array) {
|
|
907
|
-
const image = document.createElement('img');
|
|
908
|
-
image.src = frame.title === -1 ? null : `${sessionStorage.getItem('base_url')}frames/${frame.title}${server == 'alternative' ? '?server=alt' : ''}`;
|
|
909
|
-
image.style.maxWidth = frame.title === -1 ? '80%' : '100%';
|
|
910
|
-
image.style.contain = 'true';
|
|
911
|
-
Semaphor.push(new Promise(resolve => {
|
|
912
|
-
image.addEventListener('load', () => {
|
|
913
|
-
resolve();
|
|
914
|
-
});
|
|
915
|
-
}));
|
|
916
|
-
frame['image'] = image.outerHTML;
|
|
917
|
-
}
|
|
918
|
-
await Promise.all(Semaphor);
|
|
919
|
-
return array;
|
|
920
|
-
};
|
|
921
|
-
FramesInterface.prototype.getFrames = function (position) {
|
|
922
|
-
const positions = ['prev', 'current', 'next'];
|
|
923
|
-
const images = this.frames[positions[position]];
|
|
924
|
-
if (images && images.length > 0) {
|
|
925
|
-
return images;
|
|
926
|
-
}
|
|
927
|
-
return Array.from(Array(this.numberOfRows * this.framesPerRow).keys());
|
|
928
|
-
};
|
|
929
|
-
FramesInterface.prototype.getCurrentTime = function () {
|
|
930
|
-
return this.framesManager.currentTime;
|
|
931
|
-
};
|
|
932
|
-
FramesInterface.prototype.getVideoUrl = function (frame) {
|
|
933
|
-
let {
|
|
934
|
-
url,
|
|
935
|
-
params
|
|
936
|
-
} = getServerUrlWithParams();
|
|
937
|
-
return url + 'GetVideo?Client=' + sessionStorage.getItem('client') + '&Channel=' + this.channel + '&Time=' + frame.time + params + '#t=' + frame.number;
|
|
938
|
-
};
|
|
939
|
-
FramesInterface.prototype.getVideoUrlForTime = function (time) {
|
|
940
|
-
let {
|
|
941
|
-
url,
|
|
942
|
-
params
|
|
943
|
-
} = getServerUrlWithParams();
|
|
944
|
-
return url + 'GetVideo?Client=' + sessionStorage.getItem('client') + '&Channel=' + this.channel + '&Time=' + time + params;
|
|
945
|
-
};
|
|
946
|
-
FramesInterface.prototype.getVideoStartTime = async function (frame) {
|
|
947
|
-
try {
|
|
948
|
-
const block = await this.framesManager.getFileInfo(frame.time, 0);
|
|
949
|
-
return block;
|
|
950
|
-
} catch (err) {
|
|
951
|
-
console.log(err);
|
|
952
|
-
}
|
|
953
|
-
};
|
|
954
|
-
FramesInterface.prototype.getBlockInfo = async function (frame) {
|
|
955
|
-
try {
|
|
956
|
-
const block = await this.framesManager.getFileInfo(frame.time, 0);
|
|
957
|
-
return block;
|
|
958
|
-
} catch (err) {
|
|
959
|
-
console.log(err);
|
|
960
|
-
}
|
|
961
|
-
};
|
|
962
|
-
FramesInterface.prototype.getNextVideoStartTime = async function (time) {
|
|
963
|
-
try {
|
|
964
|
-
const block = await this.framesManager.getNextFileInfo(time, 0);
|
|
965
|
-
return block.start;
|
|
966
|
-
} catch (err) {
|
|
967
|
-
console.log(err);
|
|
968
|
-
}
|
|
969
|
-
};
|
|
970
|
-
FramesInterface.prototype.setCurrentStep = function (step) {
|
|
971
|
-
this.framesManager.currentStep = step;
|
|
972
|
-
};
|
|
973
|
-
FramesInterface.prototype.changeSize = async function (numberOfRows, framesPerRow) {
|
|
974
|
-
this.numberOfRows = numberOfRows;
|
|
975
|
-
this.framesPerRow = framesPerRow;
|
|
976
|
-
this.framesManager.size = this.numberOfRows * this.framesPerRow;
|
|
977
|
-
await this.loadFrames();
|
|
978
|
-
};
|
|
979
|
-
FramesInterface.prototype.getVideoRequestByUrl = function (url_path, t) {
|
|
980
|
-
const {
|
|
981
|
-
url,
|
|
982
|
-
params
|
|
983
|
-
} = getServerUrlWithParams();
|
|
984
|
-
return url + 'StreamFromVideo?url=' + url_path + params + '#t=' + t;
|
|
985
|
-
};
|
|
986
|
-
|
|
987
|
-
var Commands = {
|
|
988
|
-
render: function(){var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:"visualization-col pa-0",staticStyle:{"border-top-right-radius":"6px"},attrs:{"id":"command-bar"}},[(_vm.commandBarShow)?_c('div',{staticClass:"visualization-row visualization-justify-center"},_vm._l((_vm.commandBarBtns),function(btn,index){return _c('div',{key:'command-btn-' + index},[(!btn)?_c('hr',{staticClass:"visualization-divider vertical",staticStyle:{"margin":"0 4px"}}):_vm._e(),_vm._v(" "),(btn && (btn.condition ? btn.condition() : true))?_c('button',{directives:[{name:"tooltip",rawName:"v-tooltip",value:(
|
|
989
|
-
btn.text && typeof btn.text === 'function' ? btn.text() : btn.text
|
|
990
|
-
),expression:"\n btn.text && typeof btn.text === 'function' ? btn.text() : btn.text\n "}],staticClass:"command-bar-btn",style:({
|
|
991
|
-
color:
|
|
992
|
-
btn.color && typeof btn.color === 'function'
|
|
993
|
-
? btn.color()
|
|
994
|
-
: 'black',
|
|
995
|
-
}),on:{"click":btn.fnc}},[_c('font-awesome-icon',{attrs:{"id":btn.id,"icon":'fa-solid ' +
|
|
996
|
-
(btn.icon && typeof btn.icon === 'function'
|
|
997
|
-
? btn.icon()
|
|
998
|
-
: btn.icon)}})],1):_vm._e()])}),0):_vm._e(),_vm._v(" "),_c('hr',{staticClass:"visualization-divider"})])},
|
|
999
|
-
staticRenderFns: [],
|
|
1000
|
-
props: {
|
|
1001
|
-
videoPlaying: {
|
|
1002
|
-
type: Boolean,
|
|
1003
|
-
default: false,
|
|
1004
|
-
},
|
|
1005
|
-
videoPaused: {
|
|
1006
|
-
type: Boolean,
|
|
1007
|
-
default: false,
|
|
1008
|
-
},
|
|
1009
|
-
insertTime: {
|
|
1010
|
-
type: Boolean,
|
|
1011
|
-
default: false,
|
|
1012
|
-
},
|
|
1013
|
-
hourIniSelected: {
|
|
1014
|
-
type: Boolean,
|
|
1015
|
-
default: false,
|
|
1016
|
-
},
|
|
1017
|
-
hourEndSelected: {
|
|
1018
|
-
type: Boolean,
|
|
1019
|
-
default: false,
|
|
1020
|
-
},
|
|
1021
|
-
},
|
|
1022
|
-
data() {
|
|
1023
|
-
return {
|
|
1024
|
-
commandBarShow: true,
|
|
1025
|
-
commandBarBtns: [
|
|
1026
|
-
{
|
|
1027
|
-
fnc: () => this.$emit('prev-loop-activate'),
|
|
1028
|
-
icon: 'fa-backward',
|
|
1029
|
-
text: 'Fast Backward',
|
|
1030
|
-
id: 'Fast Backward',
|
|
1031
|
-
},
|
|
1032
|
-
{
|
|
1033
|
-
fnc: () => this.$emit('prev'),
|
|
1034
|
-
icon: 'fa-step-backward',
|
|
1035
|
-
text: 'Step Backward',
|
|
1036
|
-
id: 'Step Backward',
|
|
1037
|
-
},
|
|
1038
|
-
{
|
|
1039
|
-
fnc: () => this.$emit('go-to'),
|
|
1040
|
-
icon: 'fa-clock',
|
|
1041
|
-
text: this.$i18n.t('infoBar.setHour'),
|
|
1042
|
-
id: 'Definir Hora',
|
|
1043
|
-
},
|
|
1044
|
-
{
|
|
1045
|
-
fnc: () => this.$emit('next'),
|
|
1046
|
-
icon: 'fa-step-forward',
|
|
1047
|
-
text: 'Step Forward',
|
|
1048
|
-
id: 'Step Forward',
|
|
1049
|
-
},
|
|
1050
|
-
{
|
|
1051
|
-
fnc: () => this.$emit('next-loop-activate'),
|
|
1052
|
-
icon: 'fa-forward',
|
|
1053
|
-
text: 'Fast Forward',
|
|
1054
|
-
id: 'Fast Forward',
|
|
1055
|
-
},
|
|
1056
|
-
{
|
|
1057
|
-
fnc: () => this.$emit('play-or-pause'),
|
|
1058
|
-
icon: () => {
|
|
1059
|
-
return this.videoPlaying && !this.videoPaused
|
|
1060
|
-
? 'fa-pause'
|
|
1061
|
-
: 'fa-play'
|
|
1062
|
-
},
|
|
1063
|
-
text: () => {
|
|
1064
|
-
return this.videoPlaying && !this.videoPaused ? 'Pause' : 'Play'
|
|
1065
|
-
},
|
|
1066
|
-
id: 'playOrPause',
|
|
1067
|
-
},
|
|
1068
|
-
{
|
|
1069
|
-
fnc: () => this.$emit('stop-playing'),
|
|
1070
|
-
icon: 'fa-stop',
|
|
1071
|
-
text: 'Stop',
|
|
1072
|
-
id: 'Stop',
|
|
1073
|
-
},
|
|
1074
|
-
null,
|
|
1075
|
-
{
|
|
1076
|
-
fnc: () => this.$emit('open-frame-selection'),
|
|
1077
|
-
icon: 'fa-border-all',
|
|
1078
|
-
text: this.$i18n.t('infoBar.gridForm'),
|
|
1079
|
-
id: 'Formato da grelha',
|
|
1080
|
-
},
|
|
1081
|
-
{
|
|
1082
|
-
fnc: () => this.$emit('open-frames-per-second'),
|
|
1083
|
-
icon: 'fa-sliders-h',
|
|
1084
|
-
text: this.$i18n.t('infoBar.secondImage'),
|
|
1085
|
-
id: 'Segundos por Imagem',
|
|
1086
|
-
},
|
|
1087
|
-
// {
|
|
1088
|
-
// fnc: () => this.$emit('open-blocks'),
|
|
1089
|
-
// icon: 'fa-cut',
|
|
1090
|
-
// text: 'Escolher intervalo de blocos',
|
|
1091
|
-
// id: 'Escolher intervalo de blocos',
|
|
1092
|
-
// },
|
|
1093
|
-
{
|
|
1094
|
-
fnc: () => this.$emit('open-playback-rate'),
|
|
1095
|
-
icon: 'fa-tachometer-alt',
|
|
1096
|
-
text: this.$i18n.t('infoBar.chooseVelocity'),
|
|
1097
|
-
id: 'Escolher velocidade de reprodução',
|
|
1098
|
-
},
|
|
1099
|
-
// {
|
|
1100
|
-
// fnc: () => this.$emit('insert-time-force'),
|
|
1101
|
-
// icon: 'fa-arrow-turn-down',
|
|
1102
|
-
// text: 'Recuperar Notícia',
|
|
1103
|
-
// id: 'Recuperar Notícia',
|
|
1104
|
-
// condition: () => {
|
|
1105
|
-
// return this.insertTime
|
|
1106
|
-
// },
|
|
1107
|
-
// },
|
|
1108
|
-
null,
|
|
1109
|
-
{
|
|
1110
|
-
fnc: () => this.$emit('set-hour-ini'),
|
|
1111
|
-
icon: 'fa-hourglass-start',
|
|
1112
|
-
text: this.$i18n.t('form.inicialHour'),
|
|
1113
|
-
id: 'Hora Inicial',
|
|
1114
|
-
color: () => {
|
|
1115
|
-
return this.hourIniSelected ? 'var(--visualization-start)' : 'black'
|
|
1116
|
-
},
|
|
1117
|
-
},
|
|
1118
|
-
{
|
|
1119
|
-
fnc: () => this.$emit('insert-time'),
|
|
1120
|
-
icon: 'fa-arrow-circle-down',
|
|
1121
|
-
text: this.$i18n.t('infoBar.insert'),
|
|
1122
|
-
id: 'insert',
|
|
1123
|
-
condition: () => {
|
|
1124
|
-
return this.insertTime
|
|
1125
|
-
},
|
|
1126
|
-
},
|
|
1127
|
-
{
|
|
1128
|
-
fnc: () => this.$emit('set-hour-end'),
|
|
1129
|
-
icon: 'fa-hourglass-end',
|
|
1130
|
-
text: this.$i18n.t('form.endHour'),
|
|
1131
|
-
id: 'Hora Final',
|
|
1132
|
-
color: () => {
|
|
1133
|
-
return this.hourEndSelected ? 'var(--visualization-end)' : 'black'
|
|
1134
|
-
},
|
|
1135
|
-
},
|
|
1136
|
-
// {
|
|
1137
|
-
// fnc: () => this.$emit('check-available-block'),
|
|
1138
|
-
// icon: 'fa-video',
|
|
1139
|
-
// text: 'Próximo bloco disponível',
|
|
1140
|
-
// id: 'Próximo bloco disponível',
|
|
1141
|
-
// },
|
|
1142
|
-
],
|
|
1143
|
-
}
|
|
1144
|
-
},
|
|
1145
|
-
};
|
|
1146
|
-
|
|
1147
|
-
var Infos = {
|
|
1148
|
-
render: function(){var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:"visualization-row visualization-justify-center visualization-align-center",style:(!_vm.commandsShow
|
|
1149
|
-
? 'border-top-right-radius: 6px; padding: 4px'
|
|
1150
|
-
: 'padding: 4px'),attrs:{"id":"info-bar"}},[_c('span',[_vm._v(" "+_vm._s(_vm.playbackRate)+"x ")]),_vm._v(" "),_c('hr',{staticClass:"visualization-divider vertical",staticStyle:{"margin":"0 8px"}}),_vm._v(" "),_c('span',[_vm._v("\n "+_vm._s(_vm.$t('infoBar.selected', {
|
|
1151
|
-
seconds: _vm.hourEnd && _vm.hourIni ? _vm.hourEnd - _vm.hourIni + 1 : 0,
|
|
1152
|
-
hour_ini: _vm.convertToAudienceTime(_vm.hourIni),
|
|
1153
|
-
hour_end: _vm.convertToAudienceTime(_vm.hourEnd),
|
|
1154
|
-
}))+"\n ")]),_vm._v(" "),_c('hr',{staticClass:"visualization-divider vertical",staticStyle:{"margin":"0 8px"}}),_vm._v(" "),_c('span',[_vm._v("\n "+_vm._s(_vm.$t('infoBar.interval', {
|
|
1155
|
-
seconds: _vm.secondsPerFrame,
|
|
1156
|
-
}))+"\n ")]),_vm._v(" "),_c('hr',{staticClass:"visualization-divider vertical",staticStyle:{"margin":"0 8px"}}),_vm._v(" "),_c('span',[_vm._v("\n "+_vm._s(_vm.$t('infoBar.block', {
|
|
1157
|
-
time1: _vm.convertToAudienceTime(_vm.blockStartTime),
|
|
1158
|
-
time2: _vm.convertToAudienceTime(_vm.blockTotalTime),
|
|
1159
|
-
}))+"\n ")]),_vm._v(" "),_c('hr',{staticClass:"visualization-divider vertical",staticStyle:{"margin":"0 8px"}}),_vm._v("\n "+_vm._s(_vm.framesPerRow * _vm.numberOfRows)+"\n "),_c('hr',{staticClass:"visualization-divider vertical",staticStyle:{"margin":"0 8px"}}),_vm._v("\n "+_vm._s(_vm.framesPerRow + '*' + _vm.numberOfRows)+"\n "),(_vm.alternativeServer || !_vm.cache)?_c('span',{staticClass:"visualization-divider vertical",staticStyle:{"margin":"0 8px"}}):_vm._e(),_vm._v(" "),(_vm.alternativeServer)?_c('span',[_c('v-icon',{attrs:{"color":"error","small":"","left":""}},[_vm._v("fa-exclamation-triangle")]),_vm._v(" "),_c('strong',[_vm._v(_vm._s(_vm.$t('infoBar.alternativeServer')))])],1):_vm._e(),_vm._v(" "),(_vm.alternativeServer && !_vm.cache)?_c('span',{staticClass:"visualization-divider vertical",staticStyle:{"margin":"0 8px"}}):_vm._e(),_vm._v(" "),(!_vm.cache)?_c('span',[_c('v-icon',{attrs:{"color":"warning","small":"","left":""}},[_vm._v("fa-exclamation-circle")]),_vm._v(" "),_c('strong',[_vm._v(_vm._s(_vm.$t('infoBar.notUsingCache')))])],1):_vm._e(),_vm._v(" "),_c('div',{staticClass:"settings-container"},[_c('font-awesome-icon',{directives:[{name:"tooltip",rawName:"v-tooltip",value:(
|
|
1160
|
-
_vm.alternativeServer
|
|
1161
|
-
? _vm.$t('infoBar.changeServer')
|
|
1162
|
-
: _vm.$t('infoBar.changeServer')
|
|
1163
|
-
),expression:"\n alternativeServer\n ? $t('infoBar.changeServer')\n : $t('infoBar.changeServer')\n "}],attrs:{"icon":"fa-solid fa-server"},on:{"click":function($event){return _vm.$emit('change-server')}}}),_vm._v(" "),_c('font-awesome-icon',{directives:[{name:"tooltip",rawName:"v-tooltip",value:(
|
|
1164
|
-
_vm.commandsShow
|
|
1165
|
-
? _vm.$t('moduletelentry.hideButtons')
|
|
1166
|
-
: _vm.$t('moduletelentry.showButtons')
|
|
1167
|
-
),expression:"\n commandsShow\n ? $t('moduletelentry.hideButtons')\n : $t('moduletelentry.showButtons')\n "}],attrs:{"icon":_vm.commandsShow ? 'fa-solid fa-eye' : 'fa-solid fa-eye-slash'},on:{"click":function($event){return _vm.$emit('toogle-commands-visibility')}}}),_vm._v(" "),_c('font-awesome-icon',{directives:[{name:"tooltip",rawName:"v-tooltip",value:(
|
|
1168
|
-
_vm.cache ? _vm.$t('infoBar.disableCache') : _vm.$t('infoBar.activateCache')
|
|
1169
|
-
),expression:"\n cache ? $t('infoBar.disableCache') : $t('infoBar.activateCache')\n "}],attrs:{"icon":_vm.cache ? 'fa-solid fa-ban' : 'fa-solid fa-sync'},on:{"click":function($event){return _vm.$emit('toogle-cache')}}})],1)])},
|
|
1170
|
-
staticRenderFns: [],
|
|
1171
|
-
props: {
|
|
1172
|
-
playbackRate: {
|
|
1173
|
-
type: Number,
|
|
1174
|
-
required: true,
|
|
1175
|
-
},
|
|
1176
|
-
secondsPerFrame: {
|
|
1177
|
-
type: Number,
|
|
1178
|
-
required: true,
|
|
1179
|
-
},
|
|
1180
|
-
commandsShow: {
|
|
1181
|
-
type: Boolean,
|
|
1182
|
-
required: true,
|
|
1183
|
-
},
|
|
1184
|
-
cache: {
|
|
1185
|
-
type: Boolean,
|
|
1186
|
-
required: true,
|
|
1187
|
-
},
|
|
1188
|
-
blockStartTime: {
|
|
1189
|
-
type: Number,
|
|
1190
|
-
required: true,
|
|
1191
|
-
},
|
|
1192
|
-
videoTotalDuration: {
|
|
1193
|
-
type: Number,
|
|
1194
|
-
required: true,
|
|
1195
|
-
},
|
|
1196
|
-
alternativeServer: {
|
|
1197
|
-
type: Boolean,
|
|
1198
|
-
required: true,
|
|
1199
|
-
},
|
|
1200
|
-
framesPerRow: {
|
|
1201
|
-
type: Number,
|
|
1202
|
-
required: true,
|
|
1203
|
-
},
|
|
1204
|
-
numberOfRows: {
|
|
1205
|
-
type: Number,
|
|
1206
|
-
required: true,
|
|
1207
|
-
},
|
|
1208
|
-
hourIni: {
|
|
1209
|
-
type: [Number, Boolean],
|
|
1210
|
-
},
|
|
1211
|
-
hourEnd: {
|
|
1212
|
-
type: [Number, Boolean],
|
|
1213
|
-
},
|
|
1214
|
-
},
|
|
1215
|
-
data() {
|
|
1216
|
-
return {}
|
|
1217
|
-
},
|
|
1218
|
-
computed: {
|
|
1219
|
-
blockTotalTime() {
|
|
1220
|
-
return this.videoTotalDuration + this.blockStartTime
|
|
1221
|
-
},
|
|
1222
|
-
},
|
|
1223
|
-
methods: {
|
|
1224
|
-
convertToAudienceTime(time, separator = ':') {
|
|
1225
|
-
const d = this.getDateParts();
|
|
1226
|
-
const limit = Date.UTC(d.year, d.month, d.day, 23, 59, 59) / 1000;
|
|
1227
|
-
|
|
1228
|
-
let hour = this.dateInUtc(time * 1000)
|
|
1229
|
-
.toTimeString()
|
|
1230
|
-
.split(' ')[0]
|
|
1231
|
-
.split(':')
|
|
1232
|
-
.map(Number);
|
|
1233
|
-
|
|
1234
|
-
if (time > limit && time <= limit + this.startAudienceSeconds) {
|
|
1235
|
-
hour[0] = 24 + hour[0];
|
|
1236
|
-
}
|
|
1237
|
-
return hour
|
|
1238
|
-
.map((part) => (part > 9 ? part.toString() : '0' + part))
|
|
1239
|
-
.join(separator)
|
|
1240
|
-
},
|
|
1241
|
-
getDateParts(date = this.date) {
|
|
1242
|
-
const d = new Date(date);
|
|
1243
|
-
return {
|
|
1244
|
-
year: d.getFullYear(),
|
|
1245
|
-
month: d.getMonth(),
|
|
1246
|
-
day: d.getDate(),
|
|
1247
|
-
}
|
|
1248
|
-
},
|
|
1249
|
-
dateInUtc(miliSeconds) {
|
|
1250
|
-
var date = new Date(miliSeconds);
|
|
1251
|
-
var utc = new Date(
|
|
1252
|
-
date.getUTCFullYear(),
|
|
1253
|
-
date.getUTCMonth(),
|
|
1254
|
-
date.getUTCDate(),
|
|
1255
|
-
date.getUTCHours(),
|
|
1256
|
-
date.getUTCMinutes(),
|
|
1257
|
-
date.getUTCSeconds()
|
|
1258
|
-
);
|
|
1259
|
-
return utc
|
|
1260
|
-
},
|
|
1261
|
-
},
|
|
1262
|
-
};
|
|
1263
|
-
|
|
1264
|
-
var VideoProgress = {
|
|
1265
|
-
render: function(){var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',[_c('div',{staticClass:"visualization-row",attrs:{"id":"progress"},on:{"mousedown":_vm.progressMouseDown}},[_c('span',{staticClass:"progressLabel"},[_vm._v("\n "+_vm._s(_vm.convertToAudienceTime(_vm.videoTime))+"\n ")]),_vm._v(" "),_c('span',{staticClass:"progressBar"})]),_vm._v(" "),_c('hr',{staticClass:"visualization-divider"})])},
|
|
1266
|
-
staticRenderFns: [],
|
|
1267
|
-
props: {
|
|
1268
|
-
videoTime: {
|
|
1269
|
-
type: Number,
|
|
1270
|
-
required: true,
|
|
1271
|
-
},
|
|
1272
|
-
},
|
|
1273
|
-
methods: {
|
|
1274
|
-
progressMouseDown(e) {
|
|
1275
|
-
this.progressVideoDrag = true;
|
|
1276
|
-
const array = this.$refs.frames.filter(
|
|
1277
|
-
(fc) => fc.videoStatus === fc.Status.playing
|
|
1278
|
-
);
|
|
1279
|
-
if (array.length === 1) {
|
|
1280
|
-
const frame = array[0];
|
|
1281
|
-
frame.playOrPause();
|
|
1282
|
-
}
|
|
1283
|
-
this.updateProgress(e);
|
|
1284
|
-
|
|
1285
|
-
window.addEventListener('mouseup', this.progressMouseUp);
|
|
1286
|
-
window.addEventListener('mousemove', this.progressMouseMove);
|
|
1287
|
-
},
|
|
1288
|
-
progressMouseUp(e) {
|
|
1289
|
-
if (this.progressVideoDrag) {
|
|
1290
|
-
const array = this.$refs.frames.filter(
|
|
1291
|
-
(fc) => fc.videoStatus === fc.Status.paused
|
|
1292
|
-
);
|
|
1293
|
-
if (array.length === 1) {
|
|
1294
|
-
const frame = array[0];
|
|
1295
|
-
frame.playOrPause();
|
|
1296
|
-
}
|
|
1297
|
-
|
|
1298
|
-
this.updateProgress(e);
|
|
1299
|
-
}
|
|
1300
|
-
|
|
1301
|
-
window.removeEventListener('mouseup', this.progressMouseUp);
|
|
1302
|
-
window.removeEventListener('mousemove', this.progressMouseMove);
|
|
1303
|
-
this.progressVideoDrag = false;
|
|
1304
|
-
},
|
|
1305
|
-
progressMouseMove(e) {
|
|
1306
|
-
if (this.progressVideoDrag) {
|
|
1307
|
-
this.updateProgress(e);
|
|
1308
|
-
}
|
|
1309
|
-
},
|
|
1310
|
-
updateProgress(e, time) {
|
|
1311
|
-
let percentage;
|
|
1312
|
-
const element = document.getElementById('progress');
|
|
1313
|
-
const elementBar = element.getElementsByClassName('progressBar')[0];
|
|
1314
|
-
|
|
1315
|
-
let frames = this.$refs.frames.filter(
|
|
1316
|
-
(fc) =>
|
|
1317
|
-
fc.videoStatus === fc.Status.playing ||
|
|
1318
|
-
fc.videoStatus === fc.Status.paused
|
|
1319
|
-
);
|
|
1320
|
-
let frame = frames.length === 1 ? frames[0] : null;
|
|
1321
|
-
|
|
1322
|
-
if (time && frame) {
|
|
1323
|
-
let timeInSeconds = frame.videoCurrentTime - this.sliderStartTime;
|
|
1324
|
-
|
|
1325
|
-
percentage = (timeInSeconds / this.videoSliderTotalDuration) * 100;
|
|
1326
|
-
} else if (e) {
|
|
1327
|
-
const rect = element.getBoundingClientRect();
|
|
1328
|
-
const max = Math.round(rect.width);
|
|
1329
|
-
const pos = e.pageX - Math.round(rect.left);
|
|
1330
|
-
percentage = (pos / max) * 100 <= 100 ? (pos / max) * 100 : 100;
|
|
1331
|
-
|
|
1332
|
-
if (frame) {
|
|
1333
|
-
let targetInSeconds =
|
|
1334
|
-
this.videoSliderTotalDuration * (percentage / 100);
|
|
1335
|
-
let timeStampToJump = parseInt(this.sliderStartTime + targetInSeconds);
|
|
1336
|
-
frame.videoJumpToTimeStamp(timeStampToJump);
|
|
1337
|
-
}
|
|
1338
|
-
} else {
|
|
1339
|
-
percentage = 0;
|
|
1340
|
-
}
|
|
1341
|
-
|
|
1342
|
-
elementBar.style.width = `${percentage}%`;
|
|
1343
|
-
},
|
|
1344
|
-
getDateParts(date = this.date) {
|
|
1345
|
-
const d = new Date(date);
|
|
1346
|
-
return {
|
|
1347
|
-
year: d.getFullYear(),
|
|
1348
|
-
month: d.getMonth(),
|
|
1349
|
-
day: d.getDate(),
|
|
1350
|
-
}
|
|
1351
|
-
},
|
|
1352
|
-
dateInUtc(miliSeconds) {
|
|
1353
|
-
var date = new Date(miliSeconds);
|
|
1354
|
-
var utc = new Date(
|
|
1355
|
-
date.getUTCFullYear(),
|
|
1356
|
-
date.getUTCMonth(),
|
|
1357
|
-
date.getUTCDate(),
|
|
1358
|
-
date.getUTCHours(),
|
|
1359
|
-
date.getUTCMinutes(),
|
|
1360
|
-
date.getUTCSeconds()
|
|
1361
|
-
);
|
|
1362
|
-
return utc
|
|
1363
|
-
},
|
|
1364
|
-
convertToAudienceTime(time, separator = ':') {
|
|
1365
|
-
const d = this.getDateParts();
|
|
1366
|
-
const limit = Date.UTC(d.year, d.month, d.day, 23, 59, 59) / 1000;
|
|
1367
|
-
|
|
1368
|
-
let hour = this.dateInUtc(time * 1000)
|
|
1369
|
-
.toTimeString()
|
|
1370
|
-
.split(' ')[0]
|
|
1371
|
-
.split(':')
|
|
1372
|
-
.map(Number);
|
|
1373
|
-
|
|
1374
|
-
if (time > limit && time <= limit + this.startAudienceSeconds) {
|
|
1375
|
-
hour[0] = 24 + hour[0];
|
|
1376
|
-
}
|
|
1377
|
-
return hour
|
|
1378
|
-
.map((part) => (part > 9 ? part.toString() : '0' + part))
|
|
1379
|
-
.join(separator)
|
|
1380
|
-
},
|
|
1381
|
-
},
|
|
1382
|
-
};
|
|
1383
|
-
|
|
1384
|
-
var one_one = "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 558.2 183.6\" xmlns:v=\"https://vecta.io/nano\"><path d=\"M558.2 0v90.1h-88.3c-1.9 0-1.9 0-1.9-1.9V1.8c0-1.8 0-1.8 1.8-1.8h88.4zm-468 183.5H0V95.1c0-1.7 0-1.7 1.7-1.7h86.7c1.8 0 1.8 0 1.8 1.8v88.3zm93.6 0H93.6V95.3c0-1.9 0-1.9 1.9-1.9H182c1.8 0 1.8 0 1.8 1.8v88.3zm280.9 0h-90.2V95.1c0-1.7 0-1.7 1.6-1.7H463c1.6 0 1.6 0 1.6 1.7v62.2l.1 26.2zm93.5-90v89c0 .9-.2 1.1-1.1 1.1H468V95.2c0-1.7 0-1.7 1.7-1.7h88.5zm-280.9 90h-90V94.9c0-.9.1-1.5 1.2-1.5H276c.9 0 1.2.3 1.2 1.2l.1 88.9zm93.6 0h-90V95.1c0-1.7 0-1.7 1.7-1.7h86.5c1.8 0 1.8 0 1.8 1.8v88.3z\" fill=\"#cbcbcb\"/><path d=\"M0 45.1V1.5C0 .3.3 0 1.4 0h87.3c1.2 0 1.5.3 1.4 1.5v87.1c0 1.2-.3 1.5-1.5 1.5H1.4c-1.3 0-1.5-.4-1.5-1.6L0 45.1z\" fill=\"#1565c0\"/><path d=\"M93.6 44.9V1.5c0-1.6 0-1.6 1.6-1.6h87.1c1.5 0 1.5 0 1.5 1.6v86.8c0 1.6 0 1.6-1.6 1.6H95.4c-1.8 0-1.8 0-1.8-1.8V44.9zm280.9.2V1.6c0-1.6 0-1.6 1.6-1.6h87.1c1.5 0 1.5 0 1.5 1.6v86.7c0 1.8 0 1.8-1.8 1.8h-86.7c-1.7 0-1.7 0-1.7-1.7V45.1zm-142.1 45H189c-1.6 0-1.6 0-1.6-1.5v-87c0-1.6 0-1.6 1.6-1.6h86.8c1.6 0 1.6 0 1.6 1.5v87c0 1.6 0 1.6-1.6 1.6h-43.4zm48.5-45.2V1.5c0-1.6 0-1.6 1.6-1.6h86.8c1.6 0 1.6 0 1.6 1.5v87c0 1.6 0 1.6-1.6 1.6h-86.8c-1.6 0-1.6 0-1.6-1.6V44.9z\" fill=\"#cbcbcb\"/></svg>";
|
|
1385
|
-
|
|
1386
|
-
var two_one = "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 558.2 183.6\" xmlns:v=\"https://vecta.io/nano\"><path d=\"M277.3 183.5h-90.2V94.2c0-.6.2-.9.8-.9h87.7c1 0 1.6 0 1.6 1.3l.1 88.9zM558.2 0v90.1h-88.3c-1.9 0-1.9 0-1.9-1.9V1.8c0-1.8 0-1.8 1.8-1.8h88.4zm-468 183.5H0V95.1c0-1.7 0-1.7 1.7-1.7h86.7c1.8 0 1.8 0 1.8 1.8v88.3zm93.6 0H93.6V95.3c0-1.9 0-1.9 1.9-1.9H182c1.8 0 1.8 0 1.8 1.8v88.3zm280.9 0h-90.2V95.1c0-1.7 0-1.7 1.6-1.7H463c1.6 0 1.6 0 1.6 1.7v61.2l.1 27.2zm93.5-90v89c0 .9-.2 1.1-1.1 1.1H468V95.2c0-1.7 0-1.7 1.7-1.7h88.5zm-187.1 90h-90.2V94.6c0-1.1.4-1.5 1.5-1.5l6.8.3h80.2c1.1 0 1.5.2 1.5 1.4l.2 61.9.5 25.1c0 .7.1 1.3-.5 1.7z\" fill=\"#cbcbcb\"/><path d=\"M183.8 45.1v43.5c0 1.1-.2 1.6-1.5 1.6H95c-1.2 0-1.4-.4-1.4-1.5V1.5C93.6.2 94 0 95.1 0h87.3c1.2 0 1.4.4 1.4 1.5v43.6zM45.1 0h43.7c1.1 0 1.4.2 1.4 1.4v87.3c0 1.1-.4 1.4-1.4 1.4H1.4c-1.1 0-1.3-.3-1.3-1.3L0 1.3C0 .2.3 0 1.3 0h43.8z\" fill=\"#1565c0\"/><path d=\"M419.6 90.1h-43.5c-1.6 0-1.6 0-1.6-1.6V1.6c0-1.6 0-1.6 1.6-1.6h87.1c1.5 0 1.5 0 1.5 1.6v86.7c0 1.8 0 1.8-1.8 1.8h-43.3zM277.3 44.9v43.5c0 1.7 0 1.7-1.6 1.7h-86.8c-1.6 0-1.6 0-1.6-1.6v-87c0-1.5 0-1.5 1.6-1.5h86.8c1.6 0 1.6 0 1.6 1.6v43.3zm93.6.3v43.2c0 1.7 0 1.7-1.6 1.7h-86.8c-1.6 0-1.6 0-1.6-1.6v-87c0-1.5 0-1.5 1.6-1.5h86.8c1.6 0 1.6 0 1.6 1.6v43.6z\" fill=\"#cbcbcb\"/></svg>";
|
|
1387
|
-
|
|
1388
|
-
var three_one = "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 558.2 183.6\" xmlns:v=\"https://vecta.io/nano\"><path d=\"M277.3 183.5h-90.2V94.2c0-.6.2-.9.8-.9h87.8c1 0 1.6 0 1.6 1.3v88.9zM558.2 0v90.1h-88.3c-1.9 0-1.9 0-1.9-1.9V1.8c0-1.8 0-1.8 1.8-1.8h88.4zm-468 183.5H0V95.1c0-1.7 0-1.7 1.7-1.7h86.7c1.8 0 1.8 0 1.8 1.8v88.3zm93.6 0H93.6V95.3c0-1.9 0-1.9 1.9-1.9H182c1.8 0 1.8 0 1.8 1.8v88.3zm280.9 0h-90.2V95.1c0-1.7 0-1.7 1.6-1.7H463c1.6 0 1.6 0 1.6 1.7V157l.1 26.5zm93.5-90v89c0 .9-.2 1.1-1.1 1.1H468V95.2c0-1.7 0-1.7 1.7-1.7h88.5zm-187.1 90h-90.2V94.6c0-1.1.4-1.5 1.5-1.5l6.8.3h80.2c1.1 0 1.5.2 1.5 1.4l.2 61.9.5 25.1c0 .7.1 1.3-.5 1.7z\" fill=\"#cbcbcb\"/><path d=\"M45.1 90.1H1.4c-1.1 0-1.5-.3-1.5-1.4L0 1.5C0 .3.3 0 1.5 0h87.3c1.2 0 1.4.4 1.4 1.5v87.1c0 1.2-.3 1.5-1.5 1.5H45.1zM138.8 0h43.5c1.1 0 1.5.3 1.5 1.4v87.2c0 1.2-.3 1.4-1.5 1.4H95.1c-1.2 0-1.5-.3-1.5-1.5V1.4C93.6.2 94 0 95.1 0h43.7z\" fill=\"#1565c0\"/><path d=\"M374.5 45.1V1.6c0-1.6 0-1.6 1.6-1.6h87.1c1.6 0 1.6 0 1.6 1.6v86.8c0 1.7 0 1.7-1.7 1.7h-86.9c-1.6 0-1.6 0-1.6-1.5l-.1-43.5z\" fill=\"#cbcbcb\"/><path d=\"M277.3 45.1v43.5c0 1.5 0 1.5-1.6 1.5h-86.9c-1.5 0-1.5 0-1.5-1.6V1.6c0-1.2.2-1.6 1.5-1.5H276c1.2 0 1.4.4 1.4 1.5l-.1 43.5z\" fill=\"#1565c0\"/><path d=\"M370.9 45.2v43.2c0 1.7 0 1.7-1.6 1.7h-86.8c-1.6 0-1.6 0-1.6-1.6v-87c0-1.5 0-1.5 1.6-1.5h86.8c1.6 0 1.6 0 1.6 1.6v43.6z\" fill=\"#cbcbcb\"/></svg>";
|
|
1389
|
-
|
|
1390
|
-
var three_two = "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 558.2 183.6\" xmlns:v=\"https://vecta.io/nano\"><path d=\"M277.3 183.5h-90.2V95c0-1.6 0-1.6 1.6-1.6h86.9c1.7 0 1.7 0 1.7 1.7v88.4z\" fill=\"#1565c0\"/><path d=\"M558.2 0v90.1h-88.3c-1.9 0-1.9 0-1.9-1.9V1.8c0-1.8 0-1.8 1.8-1.8h88.4z\" fill=\"#cbcbcb\"/><path d=\"M90.2 183.5H0V95.2c0-1.9-.2-1.8 1.7-1.8h86.7c1.7 0 1.7 0 1.7 1.8v86.6c.1.6.1 1.2.1 1.7zm93.6 0H93.6V95.2c0-1.8 0-1.8 1.7-1.8H182c1.9 0 1.7-.2 1.7 1.8l.1 88.3z\" fill=\"#1565c0\"/><path d=\"M464.7 183.5h-90.2V95.1c0-1.7 0-1.7 1.6-1.7H463c1.6 0 1.6 0 1.6 1.7v62.6l.1 25.8zm93.5-90v89c0 .9-.2 1.1-1.1 1.1H468V95.2c0-1.7 0-1.7 1.7-1.7h88.5zm-187.1 90h-90.2V94.6c0-1.1.4-1.5 1.5-1.5l6.8.3h80.2c1.1 0 1.5.2 1.5 1.4l.2 61.8.5 25.2c0 .7.1 1.3-.5 1.7z\" fill=\"#cbcbcb\"/><path d=\"M45.1 90.1H1.4c-1.1 0-1.5-.3-1.5-1.4L0 1.5C0 .3.3 0 1.5 0h87.3c1.2 0 1.4.4 1.4 1.5v87.1c0 1.2-.3 1.5-1.5 1.5H45.1zM138.8 0h43.5c1.1 0 1.5.3 1.5 1.4v87.2c0 1.2-.3 1.4-1.5 1.4H95.1c-1.2 0-1.5-.3-1.5-1.5V1.4C93.6.2 94 0 95.1 0h43.7z\" fill=\"#1565c0\"/><path d=\"M374.5 45.1V1.6c0-1.6 0-1.6 1.6-1.6h87.1c1.6 0 1.6 0 1.6 1.6v86.8c0 1.7 0 1.7-1.7 1.7h-86.9c-1.6 0-1.6 0-1.6-1.5l-.1-43.5z\" fill=\"#cbcbcb\"/><path d=\"M277.3 45.1v43.5c0 1.5 0 1.5-1.6 1.5h-86.9c-1.5 0-1.5 0-1.5-1.6V1.6c0-1.2.2-1.6 1.5-1.5H276c1.2 0 1.4.4 1.4 1.5l-.1 43.5z\" fill=\"#1565c0\"/><path d=\"M370.9 45.2v43.2c0 1.7 0 1.7-1.6 1.7h-86.8c-1.6 0-1.6 0-1.6-1.6v-87c0-1.5 0-1.5 1.6-1.5h86.8c1.6 0 1.6 0 1.6 1.6v43.6z\" fill=\"#cbcbcb\"/></svg>";
|
|
1391
|
-
|
|
1392
|
-
var four_one = "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 558.2 183.6\" xmlns:v=\"https://vecta.io/nano\"><path d=\"M558.2 0v90.1h-88.3c-1.9 0-1.9 0-1.9-1.9V1.8c0-1.8 0-1.8 1.8-1.8h88.4zm-468 183.5H0V95.1c0-1.7 0-1.7 1.7-1.7h86.7c1.8 0 1.8 0 1.8 1.8v88.3zm93.6 0H93.6V95.3c0-1.9 0-1.9 1.9-1.9H182c1.8 0 1.8 0 1.8 1.8v88.3zm280.9 0h-90.2V95.1c0-1.7 0-1.7 1.6-1.7H463c1.6 0 1.6 0 1.6 1.7v64.1l.1 24.3zm93.5-90v89c0 .9-.2 1.1-1.1 1.1H468V95.2c0-1.7 0-1.7 1.7-1.7h88.5zm-280.9 90h-90V94.8c0-.9.1-1.5 1.2-1.5H276c.9 0 1.2.3 1.2 1.2l.1 89zm93.6 0h-90V95.1c0-1.7 0-1.7 1.7-1.7h86.5c1.8 0 1.8 0 1.8 1.8v88.3z\" fill=\"#cbcbcb\"/><path d=\"M0 45.1V1.5C0 .3.3 0 1.4 0h87.3c1.2 0 1.5.3 1.4 1.5v87.1c0 1.2-.3 1.5-1.5 1.5H1.4c-1.3 0-1.5-.4-1.5-1.6L0 45.1zm93.6-.2V1.4C93.6.3 93.9 0 95 0h87.3c1.2 0 1.4.3 1.4 1.5v87.2c0 1.2-.4 1.4-1.5 1.4H95c-1.2 0-1.5-.4-1.5-1.5l.1-43.7z\" fill=\"#1565c0\"/><path d=\"M374.5 45.1V1.6c0-1.6 0-1.6 1.6-1.6h87.1c1.5 0 1.5 0 1.5 1.6v86.7c0 1.8 0 1.8-1.8 1.8h-86.7c-1.7 0-1.7 0-1.7-1.7V45.1z\" fill=\"#cbcbcb\"/><path d=\"M277.3 45.1v43.4c0 1.6 0 1.6-1.6 1.6h-86.8c-1.6 0-1.6 0-1.6-1.6V1.7c0-1.6 0-1.6 1.5-1.6h87c1.5 0 1.6 0 1.6 1.5l-.1 43.5zm3.6-.2V1.4c0-1.1.3-1.5 1.4-1.5h87.2c1.2 0 1.5.3 1.5 1.5v87.2c0 1.1-.3 1.4-1.4 1.4h-87.3c-1.1 0-1.4-.4-1.4-1.4V44.9z\" fill=\"#1565c0\"/></svg>";
|
|
1393
|
-
|
|
1394
|
-
var four_two = "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 558.2 183.6\" xmlns:v=\"https://vecta.io/nano\"><path d=\"M558.2 0v90.1h-88.3c-1.9 0-1.9 0-1.9-1.9V1.8c0-1.8 0-1.8 1.8-1.8h88.4z\" fill=\"#cbcbcb\"/><path d=\"M90.2 183.5H0V95.2c0-1.9-.2-1.8 1.7-1.8h86.7c1.7 0 1.7 0 1.7 1.8v86.6c.1.6.1 1.2.1 1.7zm93.6 0H93.6V95.2c0-1.8 0-1.8 1.7-1.8H182c1.9 0 1.7-.2 1.7 1.8l.1 88.3z\" fill=\"#1565c0\"/><path d=\"M464.6 183.5h-90.2V95.1c0-1.7 0-1.7 1.6-1.7h86.9c1.6 0 1.6 0 1.6 1.7v66.5l.1 21.9zm93.6-90v89c0 .9-.2 1.1-1.1 1.1H468V95.4c0-1.8 0-1.8 1.8-1.8h75.9c4.2-.1 8.3-.1 12.5-.1z\" fill=\"#cbcbcb\"/><path d=\"M277.3 183.5h-90c0-.5-.1-1-.1-1.4V95.2c0-1.7 0-1.7 1.7-1.7h86.7c1.7 0 1.7 0 1.7 1.7v88.3zm93.6 0h-90V95c0-1.6 0-1.6 1.6-1.6h86.8c1.7 0 1.7 0 1.7 1.7V182c-.1.6-.1 1.1-.1 1.5zM138.7 90.1H95.3c-1.6 0-1.6 0-1.6-1.6v-87c0-1.3.4-1.5 1.6-1.5h87.1c1.6 0 1.6 0 1.6 1.5v87c0 1.5 0 1.5-1.6 1.5l-43.7.1z\" fill=\"#1565c0\"/><path d=\"M374.5 45V1.6c0-1.6 0-1.6 1.6-1.6h87.1c1.6 0 1.6 0 1.6 1.6v86.8c0 1.7 0 1.7-1.7 1.7h-86.9c-1.6 0-1.6 0-1.6-1.5l-.1-43.6z\" fill=\"#cbcbcb\"/><path d=\"M277.3 45v43.6c0 1.1-.3 1.5-1.5 1.5h-87.2c-1.2 0-1.4-.4-1.4-1.5V1.5c0-1.2.3-1.5 1.5-1.5h87.1c1.3 0 1.5.4 1.5 1.5V45zm3.6.1V1.5c0-1.2.3-1.5 1.5-1.5h87.2c1.2 0 1.4.3 1.4 1.5v87.1c0 1.2-.3 1.5-1.5 1.5h-87.1c-1.3 0-1.5-.4-1.5-1.6V45.1zm-235.6 45H1.8c-1.6 0-1.6 0-1.6-1.6V1.7C.2.1.2.1 1.8.1h87c1.6 0 1.6 0 1.6 1.6v86.8c0 1.6 0 1.6-1.7 1.6H45.3z\" fill=\"#1565c0\"/></svg>";
|
|
1395
|
-
|
|
1396
|
-
var five_one = "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 558.2 183.6\" xmlns:v=\"https://vecta.io/nano\"><path d=\"M183.8 183.5H93.6V95.4c0-1.8 0-1.8 1.8-1.8H182c1.8 0 1.8 0 1.8 1.8v88.1zm280.9 0h-90.2V95.2c0-1.6 0-1.6 1.5-1.6h87.1c1.5 0 1.6 0 1.6 1.6v88.3zM558.2 0v89.8H470c-1.7 0-1.7 0-1.7-1.8V1.7c0-1.8 0-1.8 1.7-1.8l88.2.1zM90 183.5H0V95.4c0-1.7 0-1.7 1.8-1.7h86.5c1.8 0 1.8 0 1.8 1.7v86.8c-.1.5-.1.9-.1 1.3zm187.3 0h-90V94.8c0-1 .5-1.2 1.3-1.2H276c1 0 1.3.3 1.3 1.3v88.6zm93.6 0h-90V95.4c0-1.7 0-1.7 1.8-1.7h86.5c1.8 0 1.8 0 1.8 1.7v86.8c-.1.5-.1.9-.1 1.3zm187.3-89.8v88.8c0 .9-.2 1.1-1.1 1.1h-88.9V95.5c0-1.8 0-1.8 1.8-1.8h88.2z\" fill=\"#cbcbcb\"/><path d=\"M0 44.9V1.5C0 .3.3 0 1.4 0h87.3c1.2 0 1.5.3 1.5 1.5v87.1c0 1.2-.3 1.6-1.5 1.6H1.5c-1.3 0-1.5-.4-1.5-1.6V44.9zm183.8.3v43.5c0 1.1-.2 1.4-1.4 1.4H95c-1.1 0-1.4-.4-1.4-1.4V1.4c0-1.1.3-1.3 1.3-1.3h87.6c1.1 0 1.3.3 1.3 1.3v43.8zm93.5 0v43.4c0 1.2-.2 1.5-1.5 1.5h-87.1c-1.2 0-1.5-.3-1.5-1.5v-87c0-1.6 0-1.6 1.6-1.6h87c1.5 0 1.5 0 1.5 1.6v43.6zm3.6-.3V1.4c0-1.1.3-1.5 1.4-1.5h87.2c1.2 0 1.5.3 1.5 1.5v87.2c0 1.1-.3 1.4-1.4 1.4h-87.3c-1.1 0-1.4-.4-1.4-1.4V44.9zm183.4.3v43.1c0 1.6 0 1.6-1.6 1.6h-86.3c-1.2 0-1.6-.3-1.6-1.5V1.9c0-1.1.3-1.5 1.5-1.5h86.6c1.2 0 1.4.4 1.4 1.5v43.3z\" fill=\"#1565c0\"/></svg>";
|
|
1397
|
-
|
|
1398
|
-
var five_two = "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 558.2 183.6\" xmlns:v=\"https://vecta.io/nano\"><path d=\"M558.2 0v90.1h-88.3c-1.9 0-1.9 0-1.9-1.9V1.8c0-1.8 0-1.8 1.8-1.8h88.4zm0 93.5v89c0 .9-.2 1.1-1.1 1.1H468V95.4c0-1.8 0-1.8 1.8-1.8h75.9c4.2-.1 8.4-.1 12.5-.1z\" fill=\"#cbcbcb\"/><g fill=\"#1565c0\"><path d=\"M183.8 183.5H93.6V95.1c0-1.6 0-1.7 1.6-1.7H182c1.7 0 1.7 0 1.7 1.8l.1 88.3zm280.9 0h-90.2V95.2c0-1.8 0-1.8 1.7-1.8h86.7c1.7 0 1.7 0 1.7 1.8v86.6c0 .6.1 1.2.1 1.7zm-374.7 0H0V94.9c0-1.2.3-1.5 1.5-1.5h87c1.6 0 1.6 0 1.6 1.6v87.1c0 .5-.1 1-.1 1.4zm187.3 0h-90c0-.4-.1-.9-.1-1.3V95.3c0-1.7 0-1.7 1.7-1.7h86.7c1.7 0 1.7 0 1.7 1.7v88.2zm93.6 0h-90V95.4c0-1.8 0-1.8 1.8-1.8h86.5c1.8 0 1.8 0 1.8 1.8v86.7c-.1.5-.1 1-.1 1.4zM138.8 90.1H95.1c-1.2 0-1.6-.3-1.6-1.5V1.4C93.6.3 93.9 0 95 0h87.4c1.1 0 1.4.4 1.4 1.4v87.2c0 1.1-.3 1.5-1.5 1.5h-43.5zm280.6 0H376c-1.6 0-1.6 0-1.6-1.6v-87c0-1.2.2-1.5 1.5-1.5h87.2c1.2 0 1.5.3 1.5 1.5v87c0 1.6 0 1.6-1.7 1.6h-43.5zM.2 45.1V1.7C.2.1.2.1 1.9.1h86.8c1.6 0 1.6 0 1.6 1.7v86.7c0 1.6 0 1.6-1.6 1.6H1.9c-1.6 0-1.6 0-1.6-1.7L.2 45.1z\"/><path d=\"M277.3 45.1v43.4c0 1.6 0 1.6-1.6 1.6h-86.9c-1.2 0-1.6-.3-1.6-1.5V1.5c0-1.2.4-1.4 1.5-1.4h87.2c1.2 0 1.4.4 1.4 1.5v43.5zM325.8 90h-43.3c-1.6 0-1.6 0-1.6-1.5V1.6c0-1.2.3-1.5 1.5-1.5h87.1c1.2 0 1.5.3 1.5 1.5v86.8c0 1.6 0 1.6-1.6 1.6h-43.6z\"/></g></svg>";
|
|
1399
|
-
|
|
1400
|
-
var six_one = "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 558.2 183.6\" xmlns:v=\"https://vecta.io/nano\"><path d=\"M558.2 0v90.1h-88.5c-1.6 0-1.6 0-1.6-1.6V1.7c0-1.6 0-1.6 1.6-1.6l88.5-.1z\" fill=\"#1565c0\"/><path d=\"M90.2 183.5H0V95.1c0-1.7 0-1.7 1.7-1.7h86.7c1.8 0 1.8 0 1.8 1.8v88.3zm93.6 0H93.6V95.3c0-1.9 0-1.9 1.9-1.9H182c1.8 0 1.8 0 1.8 1.8v88.3zm280.9 0h-90.2V95.1c0-1.7 0-1.7 1.6-1.7H463c1.6 0 1.6 0 1.6 1.7v64.1l.1 24.3zm93.5-90v89c0 .9-.2 1.1-1.1 1.1H468V95.2c0-1.7 0-1.7 1.7-1.7h88.5zm-280.9 90h-90V94.8c0-.9.1-1.5 1.2-1.5H276c.9 0 1.2.3 1.2 1.2l.1 89zm93.6 0h-90V95.1c0-1.7 0-1.7 1.7-1.7h86.5c1.8 0 1.8 0 1.8 1.8v88.3z\" fill=\"#cbcbcb\"/><path d=\"M0 45.1V1.5C0 .3.3 0 1.4 0h87.3c1.2 0 1.5.3 1.4 1.5v87.1c0 1.2-.3 1.5-1.5 1.5H1.4c-1.3 0-1.5-.4-1.5-1.6L0 45.1zm93.6-.1V1.5C93.6.3 93.9 0 95 0h87.3c1.2 0 1.4.3 1.4 1.5v87.2c0 1.2-.4 1.4-1.5 1.4H95c-1.2 0-1.5-.4-1.5-1.5l.1-43.6zM419.7 0h43.4c1.2 0 1.6.2 1.6 1.5v87.1c0 1.2-.3 1.5-1.5 1.5H376c-1.1 0-1.5-.3-1.5-1.4V1.5c0-1.2.3-1.4 1.5-1.4l43.7-.1zM277.3 45.1v43.3c0 1.6 0 1.6-1.6 1.6h-86.8c-1.7 0-1.7 0-1.7-1.6V1.5c0-1.2.3-1.5 1.5-1.5h87.2c1.2 0 1.4.4 1.4 1.5v43.6zm3.6-.2V1.4c0-1.1.3-1.5 1.4-1.5h87.2c1.3 0 1.5.4 1.5 1.6v86.9c0 1.6 0 1.6-1.5 1.6h-87c-1.1 0-1.5-.3-1.5-1.4l-.1-43.7z\" fill=\"#1565c0\"/></svg>";
|
|
1401
|
-
|
|
1402
|
-
var six_two = "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 652.1 183.8\" fill=\"#1565c0\" xmlns:v=\"https://vecta.io/nano\"><path d=\"M652.1.3v90.1h-88.5c-1.6 0-1.6 0-1.6-1.6V2c0-1.6 0-1.6 1.6-1.6l88.5-.1zM90.5 183.8H.3V95.4c0-1.6 0-1.6 1.7-1.7h86.7c1.7 0 1.7 0 1.7 1.8v86.6c0 .6 0 1.2.1 1.7zm93.5 0H93.8V95.4c0-1.6 0-1.6 1.6-1.6h86.9c1.6 0 1.6 0 1.6 1.6v80.2l.1 8.2zm374.5 0h-90.2V95.5c0-1.9-.2-1.8 1.7-1.8h86.7c1.7 0 1.7 0 1.7 1.8v86.6c.1.6.1 1.2.1 1.7zm93.6-90.1v89c0 .9-.2 1.1-1.1 1.1h-89.1c0-.6.1-1.1.1-1.7V95.5c0-1.8 0-1.8 1.7-1.8h86.7c.5.1 1.1.1 1.7 0zm-374.5 90.1h-90c0-.5-.1-1-.1-1.4v-87c0-1.6 0-1.6 1.6-1.6h87.1c1 0 1.4.2 1.4 1.3v88.7zm93.5 0h-90V95.6c0-1.8 0-1.8 1.7-1.8h86.6c1.7 0 1.7 0 1.7 1.8v86.8c.1.5.1.9 0 1.4zm93.6 0h-90V95c0-1.3.6-1.3 1.5-1.3H463c1.7 0 1.7 0 1.7 1.8v86.7c.1.6 0 1.1 0 1.6z\"/><path d=\"M.3 45.3V1.8C.3.6.5.3 1.8.3H89c1.2 0 1.5.3 1.5 1.5v86.9c0 1.6 0 1.6-1.6 1.6H1.8c-1.5 0-1.5 0-1.5-1.6V45.3zm93.6-.1V1.8c0-1.6 0-1.6 1.5-1.6h87.1c1.5 0 1.5 0 1.5 1.6v86.9c0 1.2-.2 1.6-1.5 1.6H95.3c-1.3 0-1.5-.4-1.5-1.6l.1-43.5zm464.6.2v43.4c0 1.6 0 1.6-1.6 1.6h-87.1c-1.2 0-1.6-.2-1.6-1.5V1.8c0-1.2.3-1.5 1.5-1.5h87.2c1.2 0 1.5.4 1.5 1.5l.1 43.6zm-280.9-.1v43.5c0 1.2-.2 1.6-1.5 1.5H189c-1.2 0-1.5-.3-1.5-1.5v-87c0-1.6 0-1.6 1.6-1.6h87c1.5 0 1.5 0 1.5 1.6v43.5zm93.6-.1v43.5c0 1.6 0 1.6-1.6 1.6h-86.8c-1.6 0-1.6 0-1.6-1.6V1.9c0-1.6 0-1.6 1.5-1.6h87c1.6 0 1.6 0 1.6 1.6l-.1 43.3zm3.5.1V1.8c0-1.6 0-1.6 1.5-1.6h87c1.6 0 1.6 0 1.6 1.6v87c0 1.2-.3 1.5-1.5 1.5h-87.1c-1.2 0-1.5-.4-1.5-1.5V45.3z\"/></svg>";
|
|
1403
|
-
|
|
1404
|
-
var GridImages = {
|
|
1405
|
-
'1x1': one_one,
|
|
1406
|
-
'2x1': two_one,
|
|
1407
|
-
'3x1': three_one,
|
|
1408
|
-
'3x2': three_two,
|
|
1409
|
-
'4x1': four_one,
|
|
1410
|
-
'4x2': four_two,
|
|
1411
|
-
'5x1': five_one,
|
|
1412
|
-
'5x2': five_two,
|
|
1413
|
-
'6x1': six_one,
|
|
1414
|
-
'6x2': six_two
|
|
1415
|
-
};
|
|
1416
|
-
|
|
1417
|
-
var Settings = {
|
|
1418
|
-
render: function(){var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',[(_vm.dialogsVisibility.frames)?_c('GlobalEvents',{on:{"keydown":[function($event){if(!$event.type.indexOf('key')&&$event.keyCode!==37){ return null; }return _vm.prevFormat.apply(null, arguments)},function($event){if(!$event.type.indexOf('key')&&$event.keyCode!==39){ return null; }return _vm.nextFormat.apply(null, arguments)}]}}):_vm._e(),_vm._v(" "),_c('dialog',{ref:"frames"},[_c('div',{staticClass:"visualization-row",staticStyle:{"padding":"5px","font-weight":"bold","background-color":"var(--visualization-primary)","border-color":"var(--visualization-primary)","height":"40px","color":"white","display":"flex","justify-content":"center","padding-top":"10px"}},[_vm._v("\n "+_vm._s(_vm.$t('infoBar.gridForm'))+"\n ")]),_vm._v(" "),_c('div',{staticClass:"visualization-row",staticStyle:{"justify-content":"center"}},_vm._l((_vm.items),function(item,index){return _c('div',{key:index,staticClass:"visualization-col",staticStyle:{"min-width":"200px","max-width":"200px"}},[_c('img',{style:(_vm.framesValue !== item.value ? 'filter: grayscale(1)' : ''),attrs:{"src":item.image,"width":"100%"},on:{"click":function () { return (_vm.framesValue = item.value); }}})])}),0),_vm._v(" "),_c('div',{staticClass:"visualization-divider"}),_vm._v(" "),_c('div',{staticClass:"visualization-row",staticStyle:{"display":"flex","justify-content":"center","margin-top":"10px","margin-bottom":"10px"}},[_c('button',{staticStyle:{"border-radius":"4px","height":"35px","width":"70px","background-color":"var(--visualization-primary)","border-color":"var(--visualization-primary)","color":"white"},on:{"click":function($event){return _vm.$emit('close', 'frames')}}},[_vm._v("\n Ok\n ")])])]),_vm._v(" "),_c('dialog',{ref:"secondsPerFrame"},[_c('div',{staticClass:"visualization-row",staticStyle:{"padding":"5px","font-weight":"bold","background-color":"var(--visualization-primary)","border-color":"var(--visualization-primary)","height":"40px","color":"white","display":"flex","justify-content":"center","padding-top":"10px"}},[_vm._v("\n "+_vm._s(_vm.$t('infoBar.secondImage'))+"\n ")]),_vm._v(" "),_c('div',{staticClass:"visualization-row",staticStyle:{"margin":"25px","height":"20px"}},[_c('input',{directives:[{name:"model",rawName:"v-model",value:(_vm.secondsPerFrameValue),expression:"secondsPerFrameValue"}],ref:"secondsPerFrameInput",staticStyle:{"height":"30px","width":"300px"},attrs:{"type":"range","step":"1","max":"5","min":"1"},domProps:{"value":(_vm.secondsPerFrameValue)},on:{"__r":function($event){_vm.secondsPerFrameValue=$event.target.value;}}}),_vm._v(" "),_c('span',{staticStyle:{"padding-left":"20px","font-size":"16px"}},[_vm._v("\n "+_vm._s(_vm.secondsPerFrame + ' s'))])]),_vm._v(" "),_c('div',{staticClass:"visualization-divider",staticStyle:{"margin":"10px"}}),_vm._v(" "),_c('div',{staticClass:"visualization-row",staticStyle:{"display":"flex","justify-content":"center","margin-top":"10px"}},[_c('button',{staticStyle:{"border-radius":"4px","height":"35px","width":"70px","background-color":"var(--visualization-primary)","border-color":"var(--visualization-primary)","color":"white","margin-bottom":"8px"},on:{"click":function($event){return _vm.$emit('close', 'secondsPerFrame')}}},[_vm._v("\n Ok\n ")])])]),_vm._v(" "),_c('dialog',{ref:"goTo"},[_c('div',{staticStyle:{"padding":"5px","font-weight":"bold","background-color":"var(--visualization-primary)","border-color":"var(--visualization-primary)","height":"35px","color":"white","display":"flex","justify-content":"center","padding-top":"8px"}},[_vm._v("\n "+_vm._s(_vm.$t('infoBar.goTo'))+"\n ")]),_vm._v(" "),_c('div',{staticClass:"visualization-row",staticStyle:{"margin":"25px","height":"20px"}},[_c('input',{directives:[{name:"model",rawName:"v-model",value:(_vm.goToValue),expression:"goToValue"},{name:"mask",rawName:"v-mask",value:('##:##:##'),expression:"'##:##:##'"}],staticStyle:{"height":"30px","width":"300px","border":"0.1px solid #c2c9d6","border-radius":"3px","padding":"5px"},attrs:{"type":"text","placeholder":"hh:mm:ss"},domProps:{"value":(_vm.goToValue)},on:{"input":function($event){if($event.target.composing){ return; }_vm.goToValue=$event.target.value;}}})]),_vm._v(" "),_c('div',{staticClass:"visualization-divider",staticStyle:{"margin-top":"40px"}}),_vm._v(" "),_c('div',{staticClass:"visualization-row",staticStyle:{"display":"flex","justify-content":"center","margin-top":"10px","margin-bottom":"10px"}},[_c('button',{staticStyle:{"border-radius":"4px","height":"35px","width":"70px","background-color":"var(--visualization-primary)","border-color":"var(--visualization-primary)","color":"white"},on:{"click":function () {
|
|
1419
|
-
_vm.$emit('close', 'goTo');
|
|
1420
|
-
_vm.$emit('change-go-to', _vm.goToValue);
|
|
1421
|
-
_vm.goToValue = '';
|
|
1422
|
-
}}},[_vm._v("\n Ok\n ")])])]),_vm._v(" "),_c('GlobalEvents',{on:{"keydown":[function($event){if(!$event.type.indexOf('key')&&$event.keyCode!==107){ return null; }return _vm.changePlaybackRate(1)},function($event){if(!$event.type.indexOf('key')&&$event.keyCode!==109){ return null; }return _vm.changePlaybackRate(-1)}]}}),_vm._v(" "),_c('dialog',{ref:"playbackRate"},[_c('div',{staticClass:"visualization-row",staticStyle:{"padding":"5px","font-weight":"bold","background-color":"var(--visualization-primary)","border-color":"var(--visualization-primary)","height":"35px","color":"white","display":"flex","justify-content":"center","padding-top":"8px"}},[_vm._v("\n "+_vm._s(_vm.$t('infoBar.playbackSpeed'))+"\n ")]),_vm._v(" "),_c('div',{staticClass:"visualization-row",staticStyle:{"margin":"25px","height":"20px","width":"380px"}},[_c('input',{directives:[{name:"model",rawName:"v-model",value:(_vm.playbackRateValue),expression:"playbackRateValue"}],ref:"playbackRateInput",staticStyle:{"height":"30px","width":"300px"},attrs:{"type":"range","step":"0.25","max":"3","min":"1"},domProps:{"value":(_vm.playbackRateValue)},on:{"__r":function($event){_vm.playbackRateValue=$event.target.value;}}}),_vm._v(" "),_c('span',{staticStyle:{"padding-left":"20px","padding-right":"20px","font-size":"16px"}},[_vm._v(_vm._s(_vm.playbackRate + 'x'))])]),_vm._v(" "),_c('div',{staticClass:"visualization-divider",staticStyle:{"margin-top":"40px"}}),_vm._v(" "),_c('div',{staticClass:"visualization-row",staticStyle:{"display":"flex","justify-content":"center","margin-top":"10px","margin-bottom":"10px"}},[_c('button',{staticStyle:{"border-radius":"4px","height":"35px","width":"70px","background-color":"var(--visualization-primary)","border-color":"var(--visualization-primary)","color":"white"},on:{"click":function($event){return _vm.$emit('close', 'playbackRate')}}},[_vm._v("\n Ok\n ")])])])],1)},
|
|
1423
|
-
staticRenderFns: [],
|
|
1424
|
-
props: {
|
|
1425
|
-
dialogsVisibility: {
|
|
1426
|
-
type: Object,
|
|
1427
|
-
required: false,
|
|
1428
|
-
},
|
|
1429
|
-
playbackRate: {
|
|
1430
|
-
type: Number,
|
|
1431
|
-
required: true,
|
|
1432
|
-
},
|
|
1433
|
-
secondsPerFrame: {
|
|
1434
|
-
type: Number,
|
|
1435
|
-
required: true,
|
|
1436
|
-
},
|
|
1437
|
-
framesPerRow: {
|
|
1438
|
-
type: Number,
|
|
1439
|
-
required: true,
|
|
1440
|
-
},
|
|
1441
|
-
numberOfRows: {
|
|
1442
|
-
type: Number,
|
|
1443
|
-
required: true,
|
|
1444
|
-
},
|
|
1445
|
-
},
|
|
1446
|
-
data() {
|
|
1447
|
-
return {
|
|
1448
|
-
openBlocksDialog: false,
|
|
1449
|
-
time: '',
|
|
1450
|
-
rangeBlocks: {
|
|
1451
|
-
ini: null,
|
|
1452
|
-
end: null,
|
|
1453
|
-
date: null,
|
|
1454
|
-
},
|
|
1455
|
-
items: [
|
|
1456
|
-
{ text: '2x1', value: 1, image: GridImages['2x1'] },
|
|
1457
|
-
{ text: '3x1', value: 2, image: GridImages['3x1'] },
|
|
1458
|
-
{ text: '3x2', value: 3, image: GridImages['3x2'] },
|
|
1459
|
-
{ text: '4x1', value: 4, image: GridImages['4x1'] },
|
|
1460
|
-
{ text: '4x2', value: 5, image: GridImages['4x2'] },
|
|
1461
|
-
{ text: '5x1', value: 6, image: GridImages['5x1'] },
|
|
1462
|
-
{ text: '5x2', value: 7, image: GridImages['5x2'] },
|
|
1463
|
-
{ text: '6x1', value: 8, image: GridImages['6x1'] },
|
|
1464
|
-
{ text: '6x2', value: 9, image: GridImages['6x2'] },
|
|
1465
|
-
],
|
|
1466
|
-
|
|
1467
|
-
// NEW
|
|
1468
|
-
goToValue: '',
|
|
1469
|
-
}
|
|
1470
|
-
},
|
|
1471
|
-
mounted() {
|
|
1472
|
-
this.toogleDialogs();
|
|
1473
|
-
},
|
|
1474
|
-
computed: {
|
|
1475
|
-
secondsPerFrameValue: {
|
|
1476
|
-
get() {
|
|
1477
|
-
return this.secondsPerFrame
|
|
1478
|
-
},
|
|
1479
|
-
set(val) {
|
|
1480
|
-
this.$emit('change-seconds-per-frame', parseInt(val));
|
|
1481
|
-
},
|
|
1482
|
-
},
|
|
1483
|
-
playbackRateValue: {
|
|
1484
|
-
get() {
|
|
1485
|
-
return this.playbackRate
|
|
1486
|
-
},
|
|
1487
|
-
set(val) {
|
|
1488
|
-
this.$emit('change-playback-rate', parseFloat(val));
|
|
1489
|
-
},
|
|
1490
|
-
},
|
|
1491
|
-
framesValue: {
|
|
1492
|
-
get() {
|
|
1493
|
-
return this.items.find(
|
|
1494
|
-
(item) => item.text === `${this.framesPerRow}x${this.numberOfRows}`
|
|
1495
|
-
).value
|
|
1496
|
-
},
|
|
1497
|
-
set(value) {
|
|
1498
|
-
this.$emit('set-frames-selection', value);
|
|
1499
|
-
},
|
|
1500
|
-
},
|
|
1501
|
-
timeRules() {
|
|
1502
|
-
return [
|
|
1503
|
-
(time) =>
|
|
1504
|
-
(time >= '02:30:00' && time <= '26:29:59') ||
|
|
1505
|
-
this.$i18n.t('form.mustBeBetween'),
|
|
1506
|
-
]
|
|
1507
|
-
},
|
|
1508
|
-
},
|
|
1509
|
-
methods: {
|
|
1510
|
-
toogleDialogs() {
|
|
1511
|
-
for (const dialog of Object.values(this.$refs)) {
|
|
1512
|
-
dialog.close?.();
|
|
1513
|
-
}
|
|
1514
|
-
|
|
1515
|
-
const openDialog = Object.keys(this.dialogsVisibility).find(
|
|
1516
|
-
(key) => this.dialogsVisibility[key]
|
|
1517
|
-
);
|
|
1518
|
-
|
|
1519
|
-
if (openDialog) {
|
|
1520
|
-
this.$refs[openDialog].showModal();
|
|
1521
|
-
}
|
|
1522
|
-
},
|
|
1523
|
-
prevFormat() {
|
|
1524
|
-
if (this.items.find((format) => format.value === this.framesValue - 1)) {
|
|
1525
|
-
this.framesValue--;
|
|
1526
|
-
}
|
|
1527
|
-
},
|
|
1528
|
-
nextFormat() {
|
|
1529
|
-
if (this.items.find((format) => format.value === this.framesValue + 1)) {
|
|
1530
|
-
this.framesValue++;
|
|
1531
|
-
}
|
|
1532
|
-
},
|
|
1533
|
-
changePlaybackRate(direction = 1) {
|
|
1534
|
-
if (direction === 1) {
|
|
1535
|
-
this.$refs.playbackRateInput.stepUp();
|
|
1536
|
-
} else if (direction === -1) {
|
|
1537
|
-
this.$refs.playbackRateInput.stepDown();
|
|
1538
|
-
}
|
|
1539
|
-
this.playbackRateValue = this.$refs.playbackRateInput.value;
|
|
1540
|
-
},
|
|
1541
|
-
closeBlocksDialog() {
|
|
1542
|
-
Object.entries(this.rangeBlocks).forEach(([key, value]) => {
|
|
1543
|
-
if (!value || key == 'date') return
|
|
1544
|
-
var res = value.replace(/\D/g, '');
|
|
1545
|
-
if (res.length < 6) {
|
|
1546
|
-
for (let i = res.length; i < 6; i++) {
|
|
1547
|
-
res += '0';
|
|
1548
|
-
}
|
|
1549
|
-
}
|
|
1550
|
-
res.match(/.{1,2}/g);
|
|
1551
|
-
let a = res.substring(0, 2);
|
|
1552
|
-
let b = res.substring(2, 4);
|
|
1553
|
-
let c = res.substring(4, 6);
|
|
1554
|
-
this.rangeBlocks[key] = a + ':' + b + ':' + c;
|
|
1555
|
-
});
|
|
1556
|
-
|
|
1557
|
-
this.openBlocksDialog = false;
|
|
1558
|
-
this.$emit('goToBlockInterval', this.rangeBlocks);
|
|
1559
|
-
},
|
|
1560
|
-
},
|
|
1561
|
-
watch: {
|
|
1562
|
-
dialogsVisibility: {
|
|
1563
|
-
handler() {
|
|
1564
|
-
this.toogleDialogs();
|
|
1565
|
-
},
|
|
1566
|
-
deep: true,
|
|
1567
|
-
},
|
|
1568
|
-
},
|
|
1569
|
-
};
|
|
1570
|
-
|
|
1571
|
-
const Positions = Object.freeze({
|
|
1572
|
-
previous: 0,
|
|
1573
|
-
current: 1,
|
|
1574
|
-
next: 2,
|
|
1575
|
-
});
|
|
1576
|
-
|
|
1577
|
-
var Visualization = {
|
|
1578
|
-
render: function(){var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:"visualization-row",attrs:{"id":"visualization-container"},on:{"click":_vm.framesClicked}},[(_vm.active && _vm.canInsertTime && _vm.settingsClosed)?_c('GlobalEvents',{on:{"keydown":[function($event){if(!$event.type.indexOf('key')&&$event.keyCode!==45){ return null; }return _vm.insertTime.apply(null, arguments)},function($event){if(!$event.type.indexOf('key')&&$event.keyCode!==46){ return null; }return _vm.insertTime.apply(null, arguments)}]}}):_vm._e(),_vm._v(" "),(_vm.active && _vm.settingsClosed)?_c('GlobalEvents',{on:{"keydown":[function($event){if(!$event.type.indexOf('key')&&_vm._k($event.keyCode,"left",37,$event.key,["Left","ArrowLeft"])){ return null; }if('button' in $event && $event.button !== 0){ return null; }$event.preventDefault();return _vm.arrowLeft.apply(null, arguments)},function($event){if(!$event.type.indexOf('key')&&_vm._k($event.keyCode,"right",39,$event.key,["Right","ArrowRight"])){ return null; }if('button' in $event && $event.button !== 2){ return null; }$event.preventDefault();return _vm.arrowRight.apply(null, arguments)},function($event){if(!$event.type.indexOf('key')&&_vm._k($event.keyCode,"page-down",undefined,$event.key,undefined)){ return null; }if(!$event.shiftKey){ return null; }$event.preventDefault();return _vm.nextLoopActivate.apply(null, arguments)},function($event){if(!$event.type.indexOf('key')&&_vm._k($event.keyCode,"page-down",undefined,$event.key,undefined)){ return null; }$event.preventDefault();return _vm.next.apply(null, arguments)},function($event){if(!$event.type.indexOf('key')&&_vm._k($event.keyCode,"page-up",undefined,$event.key,undefined)){ return null; }$event.preventDefault();return _vm.prev.apply(null, arguments)},function($event){if(!$event.type.indexOf('key')&&_vm._k($event.keyCode,"page-up",undefined,$event.key,undefined)){ return null; }if(!$event.shiftKey){ return null; }$event.preventDefault();return _vm.prevLoopActivate.apply(null, arguments)},function($event){if(!$event.type.indexOf('key')&&$event.keyCode!==83){ return null; }$event.preventDefault();return _vm.setHourIni.apply(null, arguments)},function($event){if(!$event.type.indexOf('key')&&$event.keyCode!==69){ return null; }$event.preventDefault();return _vm.setHourEnd.apply(null, arguments)},function($event){if(!$event.type.indexOf('key')&&$event.keyCode!==36){ return null; }$event.preventDefault();return _vm.goToFirstFrame.apply(null, arguments)},function($event){if(!$event.type.indexOf('key')&&$event.keyCode!==35){ return null; }$event.preventDefault();return _vm.goToLastFrame.apply(null, arguments)},function($event){if(!$event.type.indexOf('key')&&$event.keyCode!==71){ return null; }$event.preventDefault();_vm.dialogs.goTo = true;},function($event){if(!$event.type.indexOf('key')&&$event.keyCode!==73){ return null; }$event.preventDefault();_vm.dialogs.secondsPerFrame = true;},function($event){if(!$event.type.indexOf('key')&&$event.keyCode!==76){ return null; }$event.preventDefault();_vm.dialogs.frames = true;},function($event){if(!$event.type.indexOf('key')&&$event.keyCode!==49&&$event.keyCode!==97){ return null; }return (function () { return (_vm.secondsPerFrame = 1); }).apply(null, arguments)},function($event){if(!$event.type.indexOf('key')&&$event.keyCode!==50&&$event.keyCode!==98){ return null; }return (function () { return (_vm.secondsPerFrame = 2); }).apply(null, arguments)},function($event){if(!$event.type.indexOf('key')&&$event.keyCode!==51&&$event.keyCode!==99){ return null; }return (function () { return (_vm.secondsPerFrame = 3); }).apply(null, arguments)},function($event){if(!$event.type.indexOf('key')&&$event.keyCode!==52&&$event.keyCode!==100){ return null; }return (function () { return (_vm.secondsPerFrame = 4); }).apply(null, arguments)},function($event){if(!$event.type.indexOf('key')&&$event.keyCode!==53&&$event.keyCode!==101){ return null; }return (function () { return (_vm.secondsPerFrame = 5); }).apply(null, arguments)}]}}):_vm._e(),_vm._v(" "),(_vm.prevLoop || _vm.nextLoop)?_c('GlobalEvents',{on:{"keydown":_vm.breakLoop,"click":_vm.breakLoop}}):_vm._e(),_vm._v(" "),(_vm.active)?_c('settings',{attrs:{"dialogs-visibility":_vm.dialogs,"playback-rate":_vm.playbackRate,"seconds-per-frame":_vm.secondsPerFrame,"frames-per-row":_vm.framesPerRow,"number-of-rows":_vm.numberOfRows},on:{"change-playback-rate":function (value) { return (_vm.playbackRate = value); },"change-go-to":_vm.changeHour,"change-seconds-per-frame":function (value) { return (_vm.secondsPerFrame = value); },"set-frames-selection":_vm.setFrameSelection,"close":function (dialog) { return (_vm.dialogs[dialog] = false); }}}):_vm._e(),_vm._v(" "),_c('div',{class:{ 'visualization-card': true, 'active-tab': _vm.active },staticStyle:{"width":"100%","padding":"0"}},[_c('command-bar',{directives:[{name:"show",rawName:"v-show",value:(_vm.commandBarShow),expression:"commandBarShow"}],attrs:{"video-playing":_vm.videoPlaying,"video-paused":_vm.paused,"insert-time":_vm.canInsertTime,"hour-ini-selected":!!_vm.hourIniSelected,"hour-end-selected":!!_vm.hourEndSelected},on:{"prev-loop-activate":_vm.prevLoopActivate,"next-loop-activate":_vm.nextLoopActivate,"prev":_vm.prev,"next":_vm.next,"go-to":function($event){_vm.dialogs.goTo = true;},"open-frame-selection":function($event){_vm.dialogs.frames = true;},"open-frames-per-second":function($event){_vm.dialogs.secondsPerFrame = true;},"open-blocks":_vm.openBlocks,"open-playback-rate":function($event){_vm.dialogs.playbackRate = true;},"play-or-pause":_vm.playOrPause,"stop-playing":_vm.stopPlayingBar,"set-hour-ini":_vm.setHourIni,"set-hour-end":_vm.setHourEnd,"insert-time":_vm.insertTime}}),_vm._v(" "),(_vm.videoProgressBar)?_c('video-progress',{directives:[{name:"show",rawName:"v-show",value:(_vm.videoPlaying),expression:"videoPlaying"}],attrs:{"video-time":_vm.videoTime}}):_vm._e(),_vm._v(" "),_c('info-bar',{attrs:{"playback-rate":_vm.playbackRate,"seconds-per-frame":_vm.secondsPerFrame,"commands-show":_vm.commandBarShow,"cache":_vm.useCache,"block-start-time":_vm.blockStartTime,"video-total-duration":_vm.videoSliderTotalDuration,"alternative-server":_vm.alternativeServer,"frames-per-row":_vm.framesPerRow,"number-of-rows":_vm.numberOfRows,"hour-ini":_vm.hourIniSelected,"hour-end":_vm.hourEndSelected},on:{"toogle-commands-visibility":function($event){_vm.commandBarShow = !_vm.commandBarShow;},"toogle-cache":function($event){_vm.useCache = !_vm.useCache;},"change-server":_vm.changeServerClick}}),_vm._v(" "),_vm._l((_vm.numberOfRows),function(rowNumber){return _c('div',{key:'row-' + rowNumber,staticClass:"visualization-row",staticStyle:{"padding":"12px"},attrs:{"id":'row-' + rowNumber}},[_vm._l((_vm.previousFrames),function(frame,frameNumber){return _c('div',{key:_vm.numberOfRows +
|
|
1579
|
-
'-' +
|
|
1580
|
-
_vm.framesPerRow +
|
|
1581
|
-
'-' +
|
|
1582
|
-
_vm.getIndex(rowNumber, frameNumber, _vm.Positions.previous),staticStyle:{"display":"none"}},[_c('span',{domProps:{"innerHTML":_vm._s(frame.img)}})])}),_vm._v(" "),_vm._l((_vm.nextFrames),function(frame,frameNumber){return _c('div',{key:_vm.numberOfRows +
|
|
1583
|
-
'-' +
|
|
1584
|
-
_vm.framesPerRow +
|
|
1585
|
-
'-' +
|
|
1586
|
-
_vm.getIndex(rowNumber, frameNumber, _vm.Positions.next),staticStyle:{"display":"none"}},[_c('span',{domProps:{"innerHTML":_vm._s(frame.img)}})])}),_vm._v(" "),_vm._l((_vm.frames.slice(
|
|
1587
|
-
_vm.framesPerRow * (rowNumber - 1),
|
|
1588
|
-
_vm.framesPerRow * rowNumber
|
|
1589
|
-
)),function(frame,frameNumber){return _c('div',{key:'row-' + rowNumber + '-frame-' + frameNumber,staticClass:"visualization-col",class:{ loaderImg: !!frame.img },attrs:{"id":("frame-" + (_vm.getIndex(rowNumber, frameNumber, _vm.Positions.current)))},on:{"click":function($event){frame.time
|
|
1590
|
-
? _vm.selectFrame(
|
|
1591
|
-
_vm.getIndex(rowNumber, frameNumber, _vm.Positions.current),
|
|
1592
|
-
frame
|
|
1593
|
-
)
|
|
1594
|
-
: null;}}},[_c('span',{staticStyle:{"padding-left":"4px"},attrs:{"id":_vm.activeFrame ? 'aa' : 0}},[_c('b',[_vm._v("\n "+_vm._s(_vm.getAudienceTime(
|
|
1595
|
-
frame.time,
|
|
1596
|
-
rowNumber,
|
|
1597
|
-
frameNumber,
|
|
1598
|
-
_vm.Positions.current
|
|
1599
|
-
))+"\n ")])]),_vm._v(" "),_c('frame',{ref:"frames",refInFor:true,staticStyle:{"margin":"0 auto"},attrs:{"frame":frame,"index":_vm.getIndex(rowNumber, frameNumber, _vm.Positions.current),"grid-settings":{ numberOfRows: _vm.numberOfRows, framesPerRow: _vm.framesPerRow },"initialTime":frame.time === _vm.hourIniSelected,"endTime":frame.time === _vm.hourEndSelected,"betweenTime":frame.time > _vm.hourIniSelected && frame.time < _vm.hourEndSelected,"active":_vm.getIndex(rowNumber, frameNumber, _vm.Positions.current) ===
|
|
1600
|
-
_vm.activeFrame,"activeTab":_vm.active,"videoUrl":_vm.fInterface ? _vm.fInterface.getVideoUrl(frame) : '',"playback-rate":_vm.playbackRate},on:{"startPlaying":_vm.startPlaying,"stopPlaying":_vm.stopPlaying,"playPauseStatus":_vm.changePlayPause,"updateSlider":_vm.updateSlider}})],1)})],2)})],2)],1)},
|
|
1601
|
-
staticRenderFns: [],
|
|
1602
|
-
name: 'visualization-container',
|
|
1603
|
-
props: {
|
|
1604
|
-
value: {
|
|
1605
|
-
type: Boolean,
|
|
1606
|
-
required: true,
|
|
1607
|
-
},
|
|
1608
|
-
date: {
|
|
1609
|
-
type: String,
|
|
1610
|
-
required: true,
|
|
1611
|
-
},
|
|
1612
|
-
channel: {
|
|
1613
|
-
type: Number,
|
|
1614
|
-
required: true,
|
|
1615
|
-
},
|
|
1616
|
-
startAudienceTime: {
|
|
1617
|
-
type: String,
|
|
1618
|
-
required: true,
|
|
1619
|
-
},
|
|
1620
|
-
videoProgressBar: {
|
|
1621
|
-
type: Boolean,
|
|
1622
|
-
default: false,
|
|
1623
|
-
},
|
|
1624
|
-
jumpOnInsert: {
|
|
1625
|
-
type: Boolean,
|
|
1626
|
-
default: false,
|
|
1627
|
-
},
|
|
1628
|
-
framesFormat: {
|
|
1629
|
-
type: [Number, String],
|
|
1630
|
-
default: 6,
|
|
1631
|
-
},
|
|
1632
|
-
maxSize: {
|
|
1633
|
-
type: Number,
|
|
1634
|
-
}
|
|
1635
|
-
},
|
|
1636
|
-
components: {
|
|
1637
|
-
Frame,
|
|
1638
|
-
CommandBar: Commands,
|
|
1639
|
-
InfoBar: Infos,
|
|
1640
|
-
VideoProgress,
|
|
1641
|
-
Settings,
|
|
1642
|
-
// Help,
|
|
1643
|
-
},
|
|
1644
|
-
data() {
|
|
1645
|
-
return {
|
|
1646
|
-
Positions,
|
|
1647
|
-
updatingChannel: null,
|
|
1648
|
-
dialog: false,
|
|
1649
|
-
timeLastBlock: null,
|
|
1650
|
-
alternativeServer: false,
|
|
1651
|
-
useCache: true,
|
|
1652
|
-
numberOfRows: 1,
|
|
1653
|
-
framesPerRow: 5,
|
|
1654
|
-
secondsPerFrame: 1,
|
|
1655
|
-
fInterface: null,
|
|
1656
|
-
velocity: 1,
|
|
1657
|
-
frames: [],
|
|
1658
|
-
previousFrames: [],
|
|
1659
|
-
nextFrames: [],
|
|
1660
|
-
channelCode: 0,
|
|
1661
|
-
videoPlaying: false,
|
|
1662
|
-
activeFrame: null,
|
|
1663
|
-
activeVideo: null,
|
|
1664
|
-
videoTime: 0,
|
|
1665
|
-
videoTotalTime: null,
|
|
1666
|
-
progressVideoDrag: false,
|
|
1667
|
-
hourIniSelected: false,
|
|
1668
|
-
hourEndSelected: false,
|
|
1669
|
-
canInsertTime: false,
|
|
1670
|
-
lastHeight: 0,
|
|
1671
|
-
loopInterval: null,
|
|
1672
|
-
nextLoop: false,
|
|
1673
|
-
prevLoop: false,
|
|
1674
|
-
videoSliderTotalDuration: 900,
|
|
1675
|
-
blockStartTime: null,
|
|
1676
|
-
media: null,
|
|
1677
|
-
changeServer: false,
|
|
1678
|
-
userMultiTabsGrid: false,
|
|
1679
|
-
userMultiTabsGridsModel: true,
|
|
1680
|
-
playbackRate: 1,
|
|
1681
|
-
paused: false,
|
|
1682
|
-
commandBarShow: true,
|
|
1683
|
-
dialogs: {
|
|
1684
|
-
playbackRate: false,
|
|
1685
|
-
goTo: false,
|
|
1686
|
-
secondsPerFrame: false,
|
|
1687
|
-
frames: false,
|
|
1688
|
-
},
|
|
1689
|
-
}
|
|
1690
|
-
},
|
|
1691
|
-
async created() {
|
|
1692
|
-
this.changeServer = this.serverOfFrames === 'alternative';
|
|
1693
|
-
this.alternativeServer = this.serverOfFrames === 'alternative';
|
|
1694
|
-
|
|
1695
|
-
const settings = [
|
|
1696
|
-
{
|
|
1697
|
-
framesPerRow: 2,
|
|
1698
|
-
numberOfRows: 1,
|
|
1699
|
-
},
|
|
1700
|
-
{
|
|
1701
|
-
framesPerRow: 3,
|
|
1702
|
-
numberOfRows: 1,
|
|
1703
|
-
},
|
|
1704
|
-
{
|
|
1705
|
-
framesPerRow: 3,
|
|
1706
|
-
numberOfRows: 2,
|
|
1707
|
-
},
|
|
1708
|
-
{
|
|
1709
|
-
framesPerRow: 4,
|
|
1710
|
-
numberOfRows: 1,
|
|
1711
|
-
},
|
|
1712
|
-
{
|
|
1713
|
-
framesPerRow: 4,
|
|
1714
|
-
numberOfRows: 2,
|
|
1715
|
-
},
|
|
1716
|
-
{
|
|
1717
|
-
framesPerRow: 5,
|
|
1718
|
-
numberOfRows: 1,
|
|
1719
|
-
},
|
|
1720
|
-
{
|
|
1721
|
-
framesPerRow: 5,
|
|
1722
|
-
numberOfRows: 2,
|
|
1723
|
-
},
|
|
1724
|
-
{
|
|
1725
|
-
framesPerRow: 6,
|
|
1726
|
-
numberOfRows: 1,
|
|
1727
|
-
},
|
|
1728
|
-
{
|
|
1729
|
-
framesPerRow: 6,
|
|
1730
|
-
numberOfRows: 2,
|
|
1731
|
-
},
|
|
1732
|
-
];
|
|
1733
|
-
|
|
1734
|
-
const storedOnDb = settings[parseInt(this.framesFormat) - 1];
|
|
1735
|
-
this.framesPerRow = storedOnDb.framesPerRow;
|
|
1736
|
-
this.numberOfRows = storedOnDb.numberOfRows;
|
|
1737
|
-
|
|
1738
|
-
await this.createFramesInterface();
|
|
1739
|
-
if (this.maxSize) {
|
|
1740
|
-
this.resize(this.maxSize, true);
|
|
1741
|
-
}
|
|
1742
|
-
},
|
|
1743
|
-
methods: {
|
|
1744
|
-
framesClicked(e) {
|
|
1745
|
-
if (e.target.id != 'insert') {
|
|
1746
|
-
this.active = true;
|
|
1747
|
-
}
|
|
1748
|
-
},
|
|
1749
|
-
async goToStartBlock() {
|
|
1750
|
-
try {
|
|
1751
|
-
const d = new Date();
|
|
1752
|
-
let timestamp = Date.UTC(
|
|
1753
|
-
d.getFullYear(),
|
|
1754
|
-
d.getMonth(),
|
|
1755
|
-
d.getDate(),
|
|
1756
|
-
d.getHours(),
|
|
1757
|
-
d.getMinutes(),
|
|
1758
|
-
d.getSeconds()
|
|
1759
|
-
);
|
|
1760
|
-
|
|
1761
|
-
const response = (
|
|
1762
|
-
await FramesService.getNextAvailableBlock({
|
|
1763
|
-
channel: this.channel,
|
|
1764
|
-
time: timestamp / 1000,
|
|
1765
|
-
})
|
|
1766
|
-
).data;
|
|
1767
|
-
|
|
1768
|
-
this.dialog = false;
|
|
1769
|
-
this.changeHour(this.convertToAudienceTime(response.data.start, ':'));
|
|
1770
|
-
} catch (err) {
|
|
1771
|
-
console.error(err);
|
|
1772
|
-
}
|
|
1773
|
-
},
|
|
1774
|
-
async checkAvailableBlock() {
|
|
1775
|
-
try {
|
|
1776
|
-
const d = new Date();
|
|
1777
|
-
let timestamp = Date.UTC(
|
|
1778
|
-
d.getFullYear(),
|
|
1779
|
-
d.getMonth(),
|
|
1780
|
-
d.getDate(),
|
|
1781
|
-
d.getHours(),
|
|
1782
|
-
d.getMinutes(),
|
|
1783
|
-
d.getSeconds()
|
|
1784
|
-
);
|
|
1785
|
-
|
|
1786
|
-
const response = (
|
|
1787
|
-
await FramesService.getNextAvailableBlock({
|
|
1788
|
-
channel: this.channel,
|
|
1789
|
-
time: timestamp / 1000,
|
|
1790
|
-
})
|
|
1791
|
-
).data;
|
|
1792
|
-
|
|
1793
|
-
this.timeLastBlock = this.convertToAudienceTime(response.data.end, ':');
|
|
1794
|
-
this.dialog = true;
|
|
1795
|
-
if (!response.status) {
|
|
1796
|
-
this.timeLastBlock = 'N/D';
|
|
1797
|
-
}
|
|
1798
|
-
} catch (err) {
|
|
1799
|
-
console.error(err);
|
|
1800
|
-
}
|
|
1801
|
-
},
|
|
1802
|
-
updateSlider(videoStartTime, time) {
|
|
1803
|
-
// * atualizar slider se estiver fora do range definido previamente
|
|
1804
|
-
if (
|
|
1805
|
-
time < this.blockStartTime ||
|
|
1806
|
-
time > this.blockStartTime ||
|
|
1807
|
-
videoStartTime > this.blockStartTime + this.videoSliderTotalDuration
|
|
1808
|
-
) {
|
|
1809
|
-
this.blockStartTime = videoStartTime;
|
|
1810
|
-
this.videoSliderTotalDuration = 900;
|
|
1811
|
-
}
|
|
1812
|
-
},
|
|
1813
|
-
nextLoopActivate() {
|
|
1814
|
-
this.breakLoop();
|
|
1815
|
-
this.loopInterval = setInterval(this.next, 40);
|
|
1816
|
-
setTimeout(() => {
|
|
1817
|
-
this.nextLoop = true;
|
|
1818
|
-
}, 0);
|
|
1819
|
-
},
|
|
1820
|
-
prevLoopActivate() {
|
|
1821
|
-
this.breakLoop();
|
|
1822
|
-
this.loopInterval = setInterval(this.prev, 40);
|
|
1823
|
-
setTimeout(() => {
|
|
1824
|
-
this.prevLoop = true;
|
|
1825
|
-
}, 0);
|
|
1826
|
-
},
|
|
1827
|
-
breakLoop() {
|
|
1828
|
-
clearInterval(this.loopInterval);
|
|
1829
|
-
this.loopInterval = null;
|
|
1830
|
-
this.nextLoop = false;
|
|
1831
|
-
this.prevLoop = false;
|
|
1832
|
-
},
|
|
1833
|
-
changePlayPause(status) {
|
|
1834
|
-
this.paused = !status;
|
|
1835
|
-
},
|
|
1836
|
-
resize(height=this.lastHeight) {
|
|
1837
|
-
this.lastHeight = height;
|
|
1838
|
-
if (this.$refs.frames) {
|
|
1839
|
-
for (let frame of this.$refs.frames) {
|
|
1840
|
-
frame.resize(height);
|
|
1841
|
-
}
|
|
1842
|
-
}
|
|
1843
|
-
this.$emit('resized');
|
|
1844
|
-
},
|
|
1845
|
-
async goToFirstFrame() {
|
|
1846
|
-
let frames = this.$refs.frames;
|
|
1847
|
-
|
|
1848
|
-
let audienceTime = null;
|
|
1849
|
-
if (frames.length > 0) {
|
|
1850
|
-
let frame = frames[0].frame;
|
|
1851
|
-
audienceTime = this.getAudienceTime(frame.time, 0, 0, 0);
|
|
1852
|
-
}
|
|
1853
|
-
// if (audienceTime) {
|
|
1854
|
-
// this.changeHour(this.getLastFirtsBlockTime(audienceTime, true))
|
|
1855
|
-
// }
|
|
1856
|
-
if (audienceTime) {
|
|
1857
|
-
const [hours, minutes, seconds] = audienceTime.split(':');
|
|
1858
|
-
const totalSeconds =
|
|
1859
|
-
parseInt(hours) * 3600 + parseInt(minutes) * 60 + parseInt(seconds);
|
|
1860
|
-
if (totalSeconds >= 9000)
|
|
1861
|
-
this.changeHour(this.getLastFirtsBlockTime(audienceTime, true));
|
|
1862
|
-
else this.changeHour(this.getLastFirtsBlockTime('02:30:00', true));
|
|
1863
|
-
}
|
|
1864
|
-
},
|
|
1865
|
-
async goToLastFrame() {
|
|
1866
|
-
let frames = this.$refs.frames;
|
|
1867
|
-
let audienceTime = null;
|
|
1868
|
-
if (frames.length > 0) {
|
|
1869
|
-
let frame = frames[0].frame;
|
|
1870
|
-
|
|
1871
|
-
audienceTime = this.getAudienceTime(frame.time, 0, 0, 0);
|
|
1872
|
-
}
|
|
1873
|
-
if (audienceTime) {
|
|
1874
|
-
this.changeHour(this.getLastFirtsBlockTime(audienceTime));
|
|
1875
|
-
}
|
|
1876
|
-
},
|
|
1877
|
-
getLastFirtsBlockTime(time, first = false) {
|
|
1878
|
-
if (time.indexOf(':') !== -1) {
|
|
1879
|
-
time = time.replace(/:/g, '');
|
|
1880
|
-
}
|
|
1881
|
-
let h, m, newTime;
|
|
1882
|
-
const t = time.match(/.{1,2}/g);
|
|
1883
|
-
if (t[0] && t[1]) {
|
|
1884
|
-
h = parseInt(t[0]);
|
|
1885
|
-
m = parseInt(t[1]);
|
|
1886
|
-
}
|
|
1887
|
-
if (h < 26) {
|
|
1888
|
-
if (m < 15)
|
|
1889
|
-
if (first) newTime = t[0] + ':00:00';
|
|
1890
|
-
else newTime = t[0] + ':14:59';
|
|
1891
|
-
else if (m < 30)
|
|
1892
|
-
if (first) newTime = t[0] + ':15:00';
|
|
1893
|
-
else newTime = t[0] + ':29:59';
|
|
1894
|
-
else if (m < 45)
|
|
1895
|
-
if (first) newTime = t[0] + ':30:00';
|
|
1896
|
-
else newTime = t[0] + ':44:59';
|
|
1897
|
-
else if (first) newTime = t[0] + ':45:00';
|
|
1898
|
-
else newTime = t[0] + ':59:59';
|
|
1899
|
-
} else {
|
|
1900
|
-
if (m < 15)
|
|
1901
|
-
if (first) newTime = '26:00:00';
|
|
1902
|
-
else newTime = '26:14:59';
|
|
1903
|
-
else {
|
|
1904
|
-
if (first) newTime = '26:15:00';
|
|
1905
|
-
else newTime = '26:29:59';
|
|
1906
|
-
}
|
|
1907
|
-
}
|
|
1908
|
-
return newTime
|
|
1909
|
-
},
|
|
1910
|
-
openBlocks() {
|
|
1911
|
-
this.$refs.settings2?.openBlocks();
|
|
1912
|
-
},
|
|
1913
|
-
playOrPause() {
|
|
1914
|
-
const array = this.$refs.frames.filter((fc) => !!fc.active);
|
|
1915
|
-
if (array.length === 1) {
|
|
1916
|
-
const frame = array[0];
|
|
1917
|
-
frame.playOrPause(this.playbackRate);
|
|
1918
|
-
}
|
|
1919
|
-
},
|
|
1920
|
-
stopPlayingBar() {
|
|
1921
|
-
for (let ref of this.$refs.frames) {
|
|
1922
|
-
if (
|
|
1923
|
-
ref.videoStatus === ref.Status.playing ||
|
|
1924
|
-
ref.videoStatus === ref.Status.paused
|
|
1925
|
-
) {
|
|
1926
|
-
ref.stop(false);
|
|
1927
|
-
}
|
|
1928
|
-
}
|
|
1929
|
-
},
|
|
1930
|
-
async setFrameSelection(selected) {
|
|
1931
|
-
this.frames = this.loadingArray;
|
|
1932
|
-
switch (parseInt(selected)) {
|
|
1933
|
-
// 2x1
|
|
1934
|
-
case 1:
|
|
1935
|
-
this.framesPerRow = 2;
|
|
1936
|
-
this.numberOfRows = 1;
|
|
1937
|
-
break
|
|
1938
|
-
// 3x1
|
|
1939
|
-
case 2:
|
|
1940
|
-
this.framesPerRow = 3;
|
|
1941
|
-
this.numberOfRows = 1;
|
|
1942
|
-
break
|
|
1943
|
-
// 3x2
|
|
1944
|
-
case 3:
|
|
1945
|
-
this.framesPerRow = 3;
|
|
1946
|
-
this.numberOfRows = 2;
|
|
1947
|
-
break
|
|
1948
|
-
// 4x1
|
|
1949
|
-
case 4:
|
|
1950
|
-
this.framesPerRow = 4;
|
|
1951
|
-
this.numberOfRows = 1;
|
|
1952
|
-
break
|
|
1953
|
-
// 4x2
|
|
1954
|
-
case 5:
|
|
1955
|
-
this.framesPerRow = 4;
|
|
1956
|
-
this.numberOfRows = 2;
|
|
1957
|
-
break
|
|
1958
|
-
// 5x1
|
|
1959
|
-
case 6:
|
|
1960
|
-
this.framesPerRow = 5;
|
|
1961
|
-
this.numberOfRows = 1;
|
|
1962
|
-
break
|
|
1963
|
-
// 5x2
|
|
1964
|
-
case 7:
|
|
1965
|
-
this.framesPerRow = 5;
|
|
1966
|
-
this.numberOfRows = 2;
|
|
1967
|
-
break
|
|
1968
|
-
// 6x1
|
|
1969
|
-
case 8:
|
|
1970
|
-
this.framesPerRow = 6;
|
|
1971
|
-
this.numberOfRows = 1;
|
|
1972
|
-
break
|
|
1973
|
-
// 6x2
|
|
1974
|
-
case 9:
|
|
1975
|
-
this.framesPerRow = 6;
|
|
1976
|
-
this.numberOfRows = 2;
|
|
1977
|
-
break
|
|
1978
|
-
}
|
|
1979
|
-
await this.fInterface.changeSize(this.numberOfRows, this.framesPerRow);
|
|
1980
|
-
this.getFramesArray();
|
|
1981
|
-
setTimeout(() => {
|
|
1982
|
-
for (let ref of this.$refs.frames) {
|
|
1983
|
-
ref?.resize(this.lastHeight);
|
|
1984
|
-
}
|
|
1985
|
-
}, 150);
|
|
1986
|
-
},
|
|
1987
|
-
getFramesArray() {
|
|
1988
|
-
this.frames = this.fInterface.getFrames(Positions.current);
|
|
1989
|
-
this.nextFrames = this.fInterface.getFrames(Positions.next);
|
|
1990
|
-
this.previousFrames = this.fInterface.getFrames(Positions.previous);
|
|
1991
|
-
},
|
|
1992
|
-
async createFramesInterface() {
|
|
1993
|
-
this.frames = this.loadingArray;
|
|
1994
|
-
let ch = this.channel;
|
|
1995
|
-
let associationTMP = {
|
|
1996
|
-
1735073: 1,
|
|
1997
|
-
1735074: 139,
|
|
1998
|
-
1735075: 3,
|
|
1999
|
-
1735076: 132,
|
|
2000
|
-
};
|
|
2001
|
-
//
|
|
2002
|
-
this.channelCode = associationTMP[ch] ? associationTMP[ch] : ch;
|
|
2003
|
-
|
|
2004
|
-
const t = this.startAudienceTime.match(/.{1,2}/g);
|
|
2005
|
-
const d = this.getDateParts();
|
|
2006
|
-
const time = Date.UTC(d.year, d.month, d.day, t[0], t[1], t[2]) / 1000;
|
|
2007
|
-
// * iniciar slider
|
|
2008
|
-
this.blockStartTime = time;
|
|
2009
|
-
this.fInterface = await new FramesInterface(
|
|
2010
|
-
this.channelCode,
|
|
2011
|
-
this.numberOfRows,
|
|
2012
|
-
this.framesPerRow,
|
|
2013
|
-
time,
|
|
2014
|
-
this.startAudienceTime,
|
|
2015
|
-
this.useCache
|
|
2016
|
-
);
|
|
2017
|
-
await this.fInterface.init();
|
|
2018
|
-
|
|
2019
|
-
this.getFramesArray();
|
|
2020
|
-
|
|
2021
|
-
this.activeFrame = this.getIndex(1, 0, Positions.current);
|
|
2022
|
-
|
|
2023
|
-
this.activeVideo = null;
|
|
2024
|
-
},
|
|
2025
|
-
getIndex(rowNumber, frameIndex, position) {
|
|
2026
|
-
let from = this.framesPerRow * this.numberOfRows * position;
|
|
2027
|
-
let till = this.framesPerRow * this.numberOfRows * (position + 1);
|
|
2028
|
-
|
|
2029
|
-
return (from + till * (rowNumber - 1)) / rowNumber + frameIndex
|
|
2030
|
-
},
|
|
2031
|
-
getAudienceTime(frameTime, rowNumber, frameNumber, position) {
|
|
2032
|
-
if (!frameTime) {
|
|
2033
|
-
return 'Loading...'
|
|
2034
|
-
} else if (
|
|
2035
|
-
this.getIndex(rowNumber, frameNumber, position) === this.activeVideo
|
|
2036
|
-
) {
|
|
2037
|
-
return this.convertToAudienceTime(this.videoTime)
|
|
2038
|
-
} else {
|
|
2039
|
-
return this.convertToAudienceTime(frameTime)
|
|
2040
|
-
}
|
|
2041
|
-
},
|
|
2042
|
-
dateInUtc(miliSeconds) {
|
|
2043
|
-
var date = new Date(miliSeconds);
|
|
2044
|
-
var utc = new Date(
|
|
2045
|
-
date.getUTCFullYear(),
|
|
2046
|
-
date.getUTCMonth(),
|
|
2047
|
-
date.getUTCDate(),
|
|
2048
|
-
date.getUTCHours(),
|
|
2049
|
-
date.getUTCMinutes(),
|
|
2050
|
-
date.getUTCSeconds()
|
|
2051
|
-
);
|
|
2052
|
-
return utc
|
|
2053
|
-
},
|
|
2054
|
-
convertToAudienceTime(time, separator = ':') {
|
|
2055
|
-
const d = this.getDateParts();
|
|
2056
|
-
const limit = Date.UTC(d.year, d.month, d.day, 23, 59, 59) / 1000;
|
|
2057
|
-
|
|
2058
|
-
let hour = this.dateInUtc(time * 1000)
|
|
2059
|
-
.toTimeString()
|
|
2060
|
-
.split(' ')[0]
|
|
2061
|
-
.split(':')
|
|
2062
|
-
.map(Number);
|
|
2063
|
-
|
|
2064
|
-
if (time > limit && time <= limit + this.startAudienceSeconds) {
|
|
2065
|
-
hour[0] = 24 + hour[0];
|
|
2066
|
-
}
|
|
2067
|
-
return hour
|
|
2068
|
-
.map((part) => (part > 9 ? part.toString() : '0' + part))
|
|
2069
|
-
.join(separator)
|
|
2070
|
-
},
|
|
2071
|
-
getDateParts(date = this.date) {
|
|
2072
|
-
const d = new Date(date);
|
|
2073
|
-
return {
|
|
2074
|
-
year: d.getFullYear(),
|
|
2075
|
-
month: d.getMonth(),
|
|
2076
|
-
day: d.getDate(),
|
|
2077
|
-
}
|
|
2078
|
-
},
|
|
2079
|
-
selectFrame(index, frame) {
|
|
2080
|
-
const d = this.getDateParts();
|
|
2081
|
-
const limit = Date.UTC(d.year, d.month, d.day, 23, 59, 59) / 1000;
|
|
2082
|
-
const frameTime = frame?.time;
|
|
2083
|
-
|
|
2084
|
-
if (frameTime - (this.startAudienceSeconds + limit) <= 0) {
|
|
2085
|
-
if (this.hourIniSelected === true) {
|
|
2086
|
-
this.hourIniSelected = frameTime;
|
|
2087
|
-
|
|
2088
|
-
if (
|
|
2089
|
-
this.hourEndSelected &&
|
|
2090
|
-
this.hourIniSelected > this.hourEndSelected
|
|
2091
|
-
) {
|
|
2092
|
-
this.hourEndSelected = false;
|
|
2093
|
-
}
|
|
2094
|
-
} else if (this.hourEndSelected === true) {
|
|
2095
|
-
if (frameTime > this.hourIniSelected) {
|
|
2096
|
-
this.hourEndSelected = frameTime;
|
|
2097
|
-
this.canInsertTime = true;
|
|
2098
|
-
} else {
|
|
2099
|
-
this.hourEndSelected = false;
|
|
2100
|
-
}
|
|
2101
|
-
}
|
|
2102
|
-
}
|
|
2103
|
-
|
|
2104
|
-
if (this.activeFrame !== index) {
|
|
2105
|
-
// ? Se clicar no frame diferente de onde está a dar play, faz pausa
|
|
2106
|
-
const array = this.$refs.frames.filter(
|
|
2107
|
-
(fc) => fc.videoStatus === fc.Status.playing
|
|
2108
|
-
);
|
|
2109
|
-
if (array.length === 1) {
|
|
2110
|
-
const frame = array[0];
|
|
2111
|
-
frame.playOrPause();
|
|
2112
|
-
}
|
|
2113
|
-
this.activeVideo = null;
|
|
2114
|
-
this.activeFrame = index;
|
|
2115
|
-
}
|
|
2116
|
-
},
|
|
2117
|
-
setHourIni() {
|
|
2118
|
-
this.canInsertTime = true;
|
|
2119
|
-
this.hourIniSelected = true;
|
|
2120
|
-
document.getElementById(`frame-${this.activeFrame}`).click();
|
|
2121
|
-
this.$emit('setHourIni', {
|
|
2122
|
-
hour_ini: this.hourIniSelected
|
|
2123
|
-
? this.convertToAudienceTime(this.hourIniSelected, '')
|
|
2124
|
-
: null,
|
|
2125
|
-
});
|
|
2126
|
-
},
|
|
2127
|
-
setHourEnd() {
|
|
2128
|
-
this.canInsertTime = true;
|
|
2129
|
-
this.hourEndSelected = true;
|
|
2130
|
-
document.getElementById(`frame-${this.activeFrame}`).click();
|
|
2131
|
-
},
|
|
2132
|
-
//* Navegação
|
|
2133
|
-
arrowRight() {
|
|
2134
|
-
if (this.checkLimitRight(false)) {
|
|
2135
|
-
if (
|
|
2136
|
-
this.activeFrame ===
|
|
2137
|
-
this.numberOfRows * this.framesPerRow * 2 - 1
|
|
2138
|
-
) {
|
|
2139
|
-
this.next();
|
|
2140
|
-
} else {
|
|
2141
|
-
this.activeFrame++;
|
|
2142
|
-
}
|
|
2143
|
-
}
|
|
2144
|
-
},
|
|
2145
|
-
arrowLeft() {
|
|
2146
|
-
if (this.checkLimitLeft(false)) {
|
|
2147
|
-
if (this.activeFrame === this.numberOfRows * this.framesPerRow) {
|
|
2148
|
-
this.prev();
|
|
2149
|
-
} else {
|
|
2150
|
-
this.activeFrame--;
|
|
2151
|
-
}
|
|
2152
|
-
}
|
|
2153
|
-
},
|
|
2154
|
-
checkLimitRight(value) {
|
|
2155
|
-
const d = this.getDateParts();
|
|
2156
|
-
const high = Date.UTC(d.year, d.month, d.day, 26, 29, 59);
|
|
2157
|
-
|
|
2158
|
-
if (value) {
|
|
2159
|
-
return (
|
|
2160
|
-
high > (this.fInterface.getCurrentTime() - 1) * 1000 &&
|
|
2161
|
-
this.nextFrames[0].title !== -1
|
|
2162
|
-
)
|
|
2163
|
-
} else {
|
|
2164
|
-
// return high > (this.fInterface.getCurrentTime() + this.activeFrame) * 1000
|
|
2165
|
-
return high > this.fInterface.getCurrentTime() * 1000
|
|
2166
|
-
}
|
|
2167
|
-
},
|
|
2168
|
-
checkLimitLeft(value) {
|
|
2169
|
-
const d = this.getDateParts();
|
|
2170
|
-
const low = Date.UTC(d.year, d.month, d.day, 2, 30, 0);
|
|
2171
|
-
|
|
2172
|
-
if (value) {
|
|
2173
|
-
return low <= (this.fInterface.getCurrentTime() - 1) * 1000
|
|
2174
|
-
} else {
|
|
2175
|
-
return (
|
|
2176
|
-
low <
|
|
2177
|
-
(this.fInterface.getCurrentTime() +
|
|
2178
|
-
this.activeFrame -
|
|
2179
|
-
this.numberOfRows * this.framesPerRow) *
|
|
2180
|
-
1000
|
|
2181
|
-
)
|
|
2182
|
-
}
|
|
2183
|
-
},
|
|
2184
|
-
async next() {
|
|
2185
|
-
if (this.checkLimitRight(true)) {
|
|
2186
|
-
const array = this.$refs.frames.filter(
|
|
2187
|
-
(fc) =>
|
|
2188
|
-
fc.videoStatus === fc.Status.playing ||
|
|
2189
|
-
fc.videoStatus === fc.Status.paused
|
|
2190
|
-
);
|
|
2191
|
-
|
|
2192
|
-
if (array.length === 1) {
|
|
2193
|
-
const frame = array[0];
|
|
2194
|
-
frame.stop(false);
|
|
2195
|
-
}
|
|
2196
|
-
this.fInterface.setCurrentStep(this.secondsPerFrame);
|
|
2197
|
-
await this.fInterface.loadNextFrames();
|
|
2198
|
-
|
|
2199
|
-
this.activeFrame = this.getIndex(1, 0, Positions.current);
|
|
2200
|
-
this.activeVideo = null;
|
|
2201
|
-
|
|
2202
|
-
this.getFramesArray();
|
|
2203
|
-
}
|
|
2204
|
-
},
|
|
2205
|
-
async prev() {
|
|
2206
|
-
if (this.checkLimitLeft(true)) {
|
|
2207
|
-
const array = this.$refs.frames.filter(
|
|
2208
|
-
(fc) =>
|
|
2209
|
-
fc.videoStatus === fc.Status.playing ||
|
|
2210
|
-
fc.videoStatus === fc.Status.paused
|
|
2211
|
-
);
|
|
2212
|
-
if (array.length === 1) {
|
|
2213
|
-
const frame = array[0];
|
|
2214
|
-
frame.stop(false);
|
|
2215
|
-
}
|
|
2216
|
-
|
|
2217
|
-
this.fInterface.setCurrentStep(this.secondsPerFrame);
|
|
2218
|
-
await this.fInterface.loadPrevFrames();
|
|
2219
|
-
|
|
2220
|
-
this.activeFrame = this.getIndex(
|
|
2221
|
-
this.numberOfRows,
|
|
2222
|
-
this.framesPerRow - 1,
|
|
2223
|
-
Positions.current
|
|
2224
|
-
);
|
|
2225
|
-
this.activeVideo = null;
|
|
2226
|
-
|
|
2227
|
-
this.getFramesArray();
|
|
2228
|
-
}
|
|
2229
|
-
},
|
|
2230
|
-
async setStartTime(time) {
|
|
2231
|
-
if (time.indexOf(':') !== -1) {
|
|
2232
|
-
time = time.replace(/:/g, '');
|
|
2233
|
-
}
|
|
2234
|
-
const t = time.match(/.{1,2}/g);
|
|
2235
|
-
const d = this.getDateParts();
|
|
2236
|
-
const setTime = Date.UTC(d.year, d.month, d.day, t[0], t[1], t[2]) / 1000;
|
|
2237
|
-
this.frames = this.loadingArray;
|
|
2238
|
-
|
|
2239
|
-
await this.fInterface.changeTime(setTime);
|
|
2240
|
-
|
|
2241
|
-
this.getFramesArray();
|
|
2242
|
-
|
|
2243
|
-
this.activeFrame = this.getIndex(1, 0, Positions.current);
|
|
2244
|
-
// let frames = this.$refs.frames
|
|
2245
|
-
|
|
2246
|
-
// let audienceTime = null
|
|
2247
|
-
// if (frames.length > 0) {
|
|
2248
|
-
// let frame = frames[0].frame
|
|
2249
|
-
// audienceTime = this.getAudienceTime(frame.time, 0, 0, 0)
|
|
2250
|
-
// }
|
|
2251
|
-
|
|
2252
|
-
this.activeVideo = null;
|
|
2253
|
-
|
|
2254
|
-
return true
|
|
2255
|
-
},
|
|
2256
|
-
hourToTimeStamp(time) {
|
|
2257
|
-
if (time.indexOf(':') !== -1) {
|
|
2258
|
-
time = time.replace(/:/g, '');
|
|
2259
|
-
}
|
|
2260
|
-
const t = time.match(/.{1,2}/g);
|
|
2261
|
-
const d = this.getDateParts();
|
|
2262
|
-
const setTime = Date.UTC(d.year, d.month, d.day, t[0], t[1], t[2]) / 1000;
|
|
2263
|
-
|
|
2264
|
-
return setTime
|
|
2265
|
-
},
|
|
2266
|
-
async changeHour(value) {
|
|
2267
|
-
if (value) {
|
|
2268
|
-
setTimeout(() => {
|
|
2269
|
-
const array = this.$refs.frames.filter(
|
|
2270
|
-
(fc) =>
|
|
2271
|
-
fc.videoStatus === fc.Status.playing ||
|
|
2272
|
-
fc.videoStatus === fc.Status.paused
|
|
2273
|
-
);
|
|
2274
|
-
|
|
2275
|
-
if (array.length === 1) {
|
|
2276
|
-
const frame = array[0];
|
|
2277
|
-
frame.stop(false);
|
|
2278
|
-
}
|
|
2279
|
-
|
|
2280
|
-
this.setStartTime(value, true);
|
|
2281
|
-
}, 0);
|
|
2282
|
-
}
|
|
2283
|
-
},
|
|
2284
|
-
changeBlockInterval(value) {
|
|
2285
|
-
this.changeHour(value.ini);
|
|
2286
|
-
let time_ini, time_end;
|
|
2287
|
-
time_ini = this.hourToTimeStamp(value.ini);
|
|
2288
|
-
time_end = this.hourToTimeStamp(value.end);
|
|
2289
|
-
this.videoSliderTotalDuration = time_end - time_ini;
|
|
2290
|
-
this.$refs.frames[0].changeSettings(time_ini);
|
|
2291
|
-
this.blockStartTime = time_ini;
|
|
2292
|
-
},
|
|
2293
|
-
//eslint-disable-next-line
|
|
2294
|
-
async updateVideoTime(index, videoTime) {
|
|
2295
|
-
this.activeVideo = index;
|
|
2296
|
-
this.videoTime = videoTime;
|
|
2297
|
-
},
|
|
2298
|
-
//eslint-disable-next-line
|
|
2299
|
-
updateVideoStatus(currentTime) {
|
|
2300
|
-
if (!this.progressVideoDrag) ;
|
|
2301
|
-
},
|
|
2302
|
-
async startPlaying(frame, totalTime) {
|
|
2303
|
-
const array = this.$refs.frames.filter(
|
|
2304
|
-
(fc) => fc.frame.time !== frame.time
|
|
2305
|
-
);
|
|
2306
|
-
|
|
2307
|
-
for (let ref of array) {
|
|
2308
|
-
if (
|
|
2309
|
-
ref.videoStatus === ref.Status.playing ||
|
|
2310
|
-
ref.videoStatus === ref.Status.paused
|
|
2311
|
-
) {
|
|
2312
|
-
ref.stop(false);
|
|
2313
|
-
}
|
|
2314
|
-
}
|
|
2315
|
-
|
|
2316
|
-
this.videoTotalTime = totalTime;
|
|
2317
|
-
this.videoPlaying = true;
|
|
2318
|
-
},
|
|
2319
|
-
stopPlaying() {
|
|
2320
|
-
this.videoTotalTime = null;
|
|
2321
|
-
this.videoPlaying = false;
|
|
2322
|
-
this.paused = false;
|
|
2323
|
-
},
|
|
2324
|
-
insertTime() {
|
|
2325
|
-
this.$emit('timeToInsert', {
|
|
2326
|
-
channel: this.channel,
|
|
2327
|
-
hour_ini: this.hourIniSelected
|
|
2328
|
-
? this.convertToAudienceTime(this.hourIniSelected, '')
|
|
2329
|
-
: null,
|
|
2330
|
-
hour_end: this.hourEndSelected
|
|
2331
|
-
? this.convertToAudienceTime(this.hourEndSelected, '')
|
|
2332
|
-
: null,
|
|
2333
|
-
force: false,
|
|
2334
|
-
});
|
|
2335
|
-
|
|
2336
|
-
if (this.jumpOnInsert) {
|
|
2337
|
-
this.changeHour(
|
|
2338
|
-
this.convertToAudienceTime(
|
|
2339
|
-
(this.hourEndSelected || this.hourIniSelected) + 1
|
|
2340
|
-
)
|
|
2341
|
-
);
|
|
2342
|
-
}
|
|
2343
|
-
|
|
2344
|
-
this.hourIniSelected = null;
|
|
2345
|
-
this.hourEndSelected = null;
|
|
2346
|
-
this.canInsertTime = false;
|
|
2347
|
-
|
|
2348
|
-
// this.fInterface.setCurrentPosition(this.hourEndSelected)
|
|
2349
|
-
},
|
|
2350
|
-
insertTimeForce() {
|
|
2351
|
-
this.$emit('timeToInsert', {
|
|
2352
|
-
channel: this.channel,
|
|
2353
|
-
hour_ini: this.hourIniSelected
|
|
2354
|
-
? this.convertToAudienceTime(this.hourIniSelected, '')
|
|
2355
|
-
: null,
|
|
2356
|
-
hour_end: this.hourEndSelected
|
|
2357
|
-
? this.convertToAudienceTime(this.hourEndSelected, '')
|
|
2358
|
-
: null,
|
|
2359
|
-
force: true,
|
|
2360
|
-
});
|
|
2361
|
-
|
|
2362
|
-
this.hourIniSelected = null;
|
|
2363
|
-
this.hourEndSelected = null;
|
|
2364
|
-
this.canInsertTime = false;
|
|
2365
|
-
|
|
2366
|
-
// this.fInterface.setCurrentPosition(this.hourEndSelected)
|
|
2367
|
-
},
|
|
2368
|
-
async getChannelMedia() {
|
|
2369
|
-
// this.media = (await ChannelService.show(this.channel)).data.MEDIA
|
|
2370
|
-
},
|
|
2371
|
-
async changeServerClick() {
|
|
2372
|
-
this.changeServer = !this.changeServer;
|
|
2373
|
-
// this.$store.dispatch(
|
|
2374
|
-
// 'serverOfFrames',
|
|
2375
|
-
// this.changeServer ? 'alternative' : 'default'
|
|
2376
|
-
// )
|
|
2377
|
-
sessionStorage.setItem(
|
|
2378
|
-
'serverOfFrames',
|
|
2379
|
-
this.changeServer ? 'alternative' : 'default'
|
|
2380
|
-
);
|
|
2381
|
-
|
|
2382
|
-
// if (this.$route.params.time != this.frames[0].time)
|
|
2383
|
-
// this.$router.push({
|
|
2384
|
-
// name: 'grid',
|
|
2385
|
-
// params: {
|
|
2386
|
-
// date: this.date,
|
|
2387
|
-
// channel: this.channelCode,
|
|
2388
|
-
// time: this.frames[0].time,
|
|
2389
|
-
// },
|
|
2390
|
-
// })
|
|
2391
|
-
location.reload();
|
|
2392
|
-
},
|
|
2393
|
-
},
|
|
2394
|
-
computed: {
|
|
2395
|
-
active: {
|
|
2396
|
-
get() {
|
|
2397
|
-
return this.value
|
|
2398
|
-
},
|
|
2399
|
-
set(value) {
|
|
2400
|
-
this.$emit('input', value);
|
|
2401
|
-
},
|
|
2402
|
-
},
|
|
2403
|
-
settingsClosed() {
|
|
2404
|
-
return !Object.values(this.dialogs).find((v) => v)
|
|
2405
|
-
},
|
|
2406
|
-
startAudienceSeconds() {
|
|
2407
|
-
const t = this.startAudienceTime.match(/.{1,2}/g);
|
|
2408
|
-
return parseInt(t[0] * 3600 + t[1] * 60 + t[2])
|
|
2409
|
-
},
|
|
2410
|
-
loadingArray() {
|
|
2411
|
-
return Array.from(Array(this.numberOfRows * this.framesPerRow).keys())
|
|
2412
|
-
},
|
|
2413
|
-
serverOfFrames() {
|
|
2414
|
-
return sessionStorage.getItem('server')
|
|
2415
|
-
},
|
|
2416
|
-
},
|
|
2417
|
-
watch: {
|
|
2418
|
-
framesFormat(value) {
|
|
2419
|
-
this.setFrameSelection(value);
|
|
2420
|
-
},
|
|
2421
|
-
active() {
|
|
2422
|
-
// ? sempre que trocamos de tabs dar reset as horas selected
|
|
2423
|
-
this.hourIniSelected = false;
|
|
2424
|
-
this.hourEndSelected = false;
|
|
2425
|
-
},
|
|
2426
|
-
useCache() {
|
|
2427
|
-
this.createFramesInterface();
|
|
2428
|
-
},
|
|
2429
|
-
hourIniSelected(value) {
|
|
2430
|
-
if (value) {
|
|
2431
|
-
sessionStorage.setItem(
|
|
2432
|
-
'currentTimeFrames',
|
|
2433
|
-
this.convertToAudienceTime(this.hourIniSelected, '')
|
|
2434
|
-
);
|
|
2435
|
-
} else {
|
|
2436
|
-
sessionStorage.removeItem('currentTimeFrames');
|
|
2437
|
-
}
|
|
2438
|
-
},
|
|
2439
|
-
activeFrame(value) {
|
|
2440
|
-
if (value) {
|
|
2441
|
-
this.stopPlayingBar();
|
|
2442
|
-
}
|
|
2443
|
-
},
|
|
2444
|
-
channel() {
|
|
2445
|
-
this.updatingChannel = new Promise((resolve, reject) => {
|
|
2446
|
-
try {
|
|
2447
|
-
this.createFramesInterface();
|
|
2448
|
-
resolve(true);
|
|
2449
|
-
} catch (err) {
|
|
2450
|
-
reject(err);
|
|
2451
|
-
}
|
|
2452
|
-
});
|
|
2453
|
-
},
|
|
2454
|
-
},
|
|
2455
|
-
};
|
|
2456
|
-
|
|
2457
|
-
var Visualization$1 = /*#__PURE__*/Object.freeze({
|
|
2458
|
-
__proto__: null,
|
|
2459
|
-
'default': Visualization
|
|
2460
|
-
});
|
|
2461
|
-
|
|
2462
|
-
return index;
|
|
2463
|
-
|
|
2464
|
-
}));
|