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.apps import AppConfig
from django.conf import settings
from django.core.checks import Warning, register from django.core.checks import Warning, register
from wagtailvideos import ffmpeg from wagtailvideos import ffmpeg
...@@ -6,7 +7,10 @@ from wagtailvideos import ffmpeg ...@@ -6,7 +7,10 @@ from wagtailvideos import ffmpeg
def ffmpeg_check(app_configs, **kwargs): def ffmpeg_check(app_configs, **kwargs):
messages = [] messages = []
if not ffmpeg.installed(): if (
not ffmpeg.installed()
and not getattr(settings, 'WAGTAIL_VIDEOS_DISABLE_TRANSCODE', False)
):
messages.append( messages.append(
Warning( Warning(
'ffmpeg could not be found on your system. Transcoding will be disabled', 'ffmpeg could not be found on your system. Transcoding will be disabled',
......
...@@ -59,7 +59,7 @@ ...@@ -59,7 +59,7 @@
<dl style='margin-top: 0'> <dl style='margin-top: 0'>
{% if video.thumbnail %} {% if video.thumbnail %}
<dt>{% trans "Thumbnail" %}</dt> <dt>{% trans "Thumbnail" %}</dt>
<dd><img src="{{ video.thumbnail.url }}" /></dd> <dd><img src="{{ video.thumbnail.url }}" alt="{% trans 'Video thumbnail' %}" /></dd>
{% endif %} {% endif %}
<dt>{% trans "Filesize" %}</dt> <dt>{% trans "Filesize" %}</dt>
<dd>{% if filesize %}{{ filesize|filesizeformat }}{% else %}{% trans "File not found" %}{% endif %}</dd> <dd>{% if filesize %}{{ filesize|filesizeformat }}{% else %}{% trans "File not found" %}{% endif %}</dd>
...@@ -113,7 +113,7 @@ ...@@ -113,7 +113,7 @@
</form> </form>
{% else %} {% else %}
<br/><br/> <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 %} {% endif %}
{% if tracks_action_url %} {% if tracks_action_url %}
<h2 class="u-text-transform-uppercase">{% trans "Tracks" %}</h2> <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