Commit 8ef217e1 authored by Kevin Gutierrez's avatar Kevin Gutierrez
Browse files

Check WAGTAIL_VIDEOS_DISABLE_TRANSCODE in app startup

parent b18eb705
from django.apps import AppConfig
from django.conf import settings
from django.core.checks import Warning, register
from wagtailvideos import ffmpeg
......@@ -6,7 +7,10 @@ from wagtailvideos import ffmpeg
def ffmpeg_check(app_configs, **kwargs):
messages = []
if not ffmpeg.installed():
if (
not ffmpeg.installed()
and not getattr(settings, 'WAGTAIL_VIDEOS_DISABLE_TRANSCODE', False)
):
messages.append(
Warning(
'ffmpeg could not be found on your system. Transcoding will be disabled',
......
......@@ -59,7 +59,7 @@
<dl style='margin-top: 0'>
{% if video.thumbnail %}
<dt>{% trans "Thumbnail" %}</dt>
<dd><img src="{{ video.thumbnail.url }}" /></dd>
<dd><img src="{{ video.thumbnail.url }}" alt="{% trans 'Video thumbnail' %}" /></dd>
{% endif %}
<dt>{% trans "Filesize" %}</dt>
<dd>{% if filesize %}{{ filesize|filesizeformat }}{% else %}{% trans "File not found" %}{% endif %}</dd>
......@@ -113,7 +113,7 @@
</form>
{% else %}
<br/><br/>
<span class='transcode-error'>{% trans "Ffmpeg is not found on your server. Please install if you wish to transcode videos into an HTML5 video compliant format." %}</span>
<span class='transcode-error'>{% trans "Ffmpeg is not found on your server or you have disabled transcodes. Please install and enable transcodes if you wish to transcode videos into an HTML5 video compliant format." %}</span>
{% endif %}
{% if tracks_action_url %}
<h2 class="u-text-transform-uppercase">{% trans "Tracks" %}</h2>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment