fix video from external storage

This commit is contained in:
jr-k 2024-07-30 18:34:00 +02:00
parent 9e20bb65bd
commit 564b064f50
2 changed files with 3 additions and 1 deletions

View File

@ -148,6 +148,7 @@ class PlayerController(ObController):
slide['position'] = position
slide['type'] = ContentType.guess_content_type_file(str(file.resolve())).value
slide['name'] = file.stem
slide['delegate_duration'] = 1 if slide['type'] == ContentType.VIDEO.value else 0
slide['location'] = "{}/{}".format(
self._model_store.content().resolve_content_location(content),
file.name

View File

@ -362,7 +362,8 @@
};
const loadVideo = function(element, callbackReady, item) {
element.innerHTML = `<video ${previewMode ? 'controls' : ''}><source src=/${item.location} type="video/mp4" /></video>`;
const location = item.location.indexOf('http') === 0 ? item.location : `/${item.location}`;
element.innerHTML = `<video ${previewMode ? 'controls' : ''}><source src=${location} type="video/mp4" /></video>`;
const video = element.querySelector('video');
callbackReady(function() {});