fix videos length on slide add only + fix player loop when 1 element only
This commit is contained in:
parent
02c54566a9
commit
790b9d422f
@ -42,8 +42,9 @@ class SlideController(ObController):
|
||||
|
||||
slide = Slide(
|
||||
content_id=content.id if content else request.form['content_id'],
|
||||
enabled='enabled' in request.form and request.form['enabled'] == '1',
|
||||
delegate_duration='delegate_duration' in request.form and request.form['delegate_duration'] == '1',
|
||||
duration=request.form['duration'],
|
||||
enabled='enabled' in request.form and request.form['enabled'],
|
||||
is_notification=True if 'is_notification' in request.form and request.form['is_notification'] == '1' else False,
|
||||
playlist_id=request.form['playlist_id'] if 'playlist_id' in request.form and request.form['playlist_id'] else None,
|
||||
cron_schedule=get_optional_string(request.form['cron_schedule']),
|
||||
|
||||
@ -84,6 +84,14 @@
|
||||
let notificationItemIndex = null;
|
||||
|
||||
// Functions
|
||||
const itemsLoadedProcess = function() {
|
||||
if (items.loop.length === 1) {
|
||||
const duplicatedItem = Object.assign({}, items.loop[0]);
|
||||
duplicatedItem['id'] = duplicatedItem['id'] + 'bis';
|
||||
items.loop.push(duplicatedItem);
|
||||
}
|
||||
};
|
||||
|
||||
const itemCheck = setInterval(function() {
|
||||
if (previewMode) {
|
||||
return;
|
||||
@ -95,6 +103,7 @@
|
||||
}
|
||||
}).then(function(data) {
|
||||
items = data;
|
||||
itemsLoadedProcess();
|
||||
|
||||
if (needHardRefresh === null) {
|
||||
needHardRefresh = items.hard_refresh_request;
|
||||
@ -202,6 +211,7 @@
|
||||
};
|
||||
|
||||
const main = function() {
|
||||
itemsLoadedProcess();
|
||||
setInterval(checkAndMoveNotifications, 1000);
|
||||
setTimeout(function() {
|
||||
if (items.loop.length === 0) {
|
||||
@ -391,7 +401,9 @@
|
||||
|
||||
if (element.innerHTML.match('<video>')) {
|
||||
if (!previewMode) {
|
||||
setTimeout(function() {
|
||||
video.play();
|
||||
}, 1000);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user