mirror of
https://github.com/mediacms-io/mediacms.git
synced 2025-08-19 09:11:37 +02:00
Disable encoding and show only original file (#829)
Disable encoding and show only original file #829
This commit is contained in:
@@ -430,8 +430,13 @@ class Media(models.Model):
|
||||
self.set_media_type()
|
||||
if self.media_type == "video":
|
||||
self.set_thumbnail(force=True)
|
||||
self.produce_sprite_from_video()
|
||||
self.encode()
|
||||
if settings.DO_NOT_TRANSCODE_VIDEO:
|
||||
self.encoding_status = "success"
|
||||
self.save()
|
||||
self.produce_sprite_from_video()
|
||||
else:
|
||||
self.produce_sprite_from_video()
|
||||
self.encode()
|
||||
elif self.media_type == "image":
|
||||
self.set_thumbnail(force=True)
|
||||
return True
|
||||
@@ -667,6 +672,13 @@ class Media(models.Model):
|
||||
return ret
|
||||
for key in ENCODE_RESOLUTIONS_KEYS:
|
||||
ret[key] = {}
|
||||
|
||||
# if this is enabled, return original file on a way
|
||||
# that video.js can consume
|
||||
if settings.DO_NOT_TRANSCODE_VIDEO:
|
||||
ret['0-original'] = {"h264": {"url": helpers.url_from_path(self.media_file.path), "status": "success", "progress": 100}}
|
||||
return ret
|
||||
|
||||
for encoding in self.encodings.select_related("profile").filter(chunk=False):
|
||||
if encoding.profile.extension == "gif":
|
||||
continue
|
||||
|
Reference in New Issue
Block a user