diff options
author | Christopher Allan Webber <cwebber@dustycloud.org> | 2013-03-02 19:06:31 -0600 |
---|---|---|
committer | Christopher Allan Webber <cwebber@dustycloud.org> | 2013-03-02 19:06:31 -0600 |
commit | ddbf6af1e20222882a7ce559804ed48f4ad31a92 (patch) | |
tree | e53664048ed3f46d8c034eee64fff298b1f7ae13 /mediagoblin/templates | |
parent | fd693e368bf7d344c29ff99b77acbb92f4524b73 (diff) | |
download | mediagoblin-ddbf6af1e20222882a7ce559804ed48f4ad31a92.tar.lz mediagoblin-ddbf6af1e20222882a7ce559804ed48f4ad31a92.tar.xz mediagoblin-ddbf6af1e20222882a7ce559804ed48f4ad31a92.zip |
Huge amount of work to (mostly) allow .ogg (and maybe other) formats to skip transcode
- Update get_display_media in several ways:
- now uses the media type's own declaration of the order of things
- returns both the media_size and the media_path, as per the docstring
- implicitly uses self.media_files as opposed to forcing you to pass it in
- update videos to use get_display_media
- update images to declare media_fetch_order in the media manager (videos also)
- update stl to use media.media_files['original'] instead of weird
use of get_display_media
- update sidebar to only conditionally show webm_640
TODO still: identify video type information *during* processing, show
that in the <video><source /></video> element.
This commit sponsored by Nathan Yergler. Thanks, nyergler!
Diffstat (limited to 'mediagoblin/templates')
3 files changed, 7 insertions, 5 deletions
diff --git a/mediagoblin/templates/mediagoblin/media_displays/stl.html b/mediagoblin/templates/mediagoblin/media_displays/stl.html index 043faac8..a89e0b4f 100644 --- a/mediagoblin/templates/mediagoblin/media_displays/stl.html +++ b/mediagoblin/templates/mediagoblin/media_displays/stl.html @@ -23,7 +23,7 @@ {% set model_download = request.app.public_store.file_url( - media.get_display_media(media.media_files)) %} + media.media_files['original']) %} {% set perspective_view = request.app.public_store.file_url( media.media_files['perspective']) %} {% set top_view = request.app.public_store.file_url( diff --git a/mediagoblin/templates/mediagoblin/media_displays/video.html b/mediagoblin/templates/mediagoblin/media_displays/video.html index 9eeb7c85..2e33e1a3 100644 --- a/mediagoblin/templates/mediagoblin/media_displays/video.html +++ b/mediagoblin/templates/mediagoblin/media_displays/video.html @@ -33,7 +33,7 @@ data-setup='{"height": {{ media.media_data.height }}, "width": {{ media.media_data.width }} }'> <source src="{{ request.app.public_store.file_url( - media.media_files['webm_640']) }}" + media.get_display_media()[1]) }}" type="video/webm; codecs="vp8, vorbis"" /> <div class="no_html5"> {%- trans -%}Sorry, this video will not work because @@ -53,7 +53,9 @@ <li><a href="{{ request.app.public_store.file_url( media.media_files.original) }}">{% trans %}Original file{% endtrans %}</a> {% endif %} - <li><a href="{{ request.app.public_store.file_url( - media.media_files.webm_640) }}">{% trans %}WebM file (640p; VP8/Vorbis){% endtrans %}</a> + {% if 'webm_640' in media.media_files %} + <li><a href="{{ request.app.public_store.file_url( + media.media_files.webm_640) }}">{% trans %}WebM file (640p; VP8/Vorbis){% endtrans %}</a> + {% endif %} </ul> {% endblock %} diff --git a/mediagoblin/templates/mediagoblin/user_pages/media.html b/mediagoblin/templates/mediagoblin/user_pages/media.html index f151c577..b77c12b9 100644 --- a/mediagoblin/templates/mediagoblin/user_pages/media.html +++ b/mediagoblin/templates/mediagoblin/user_pages/media.html @@ -47,7 +47,7 @@ <div class="media_image_container"> {% block mediagoblin_media %} {% set display_media = request.app.public_store.file_url( - media.get_display_media(media.media_files)) %} + media.get_display_media()[1]) %} {# if there's a medium file size, that means the medium size # isn't the original... so link to the original! #} |