mirror of
https://github.com/phpbb/phpbb.git
synced 2025-05-13 11:06:03 +02:00
[ticket/16863] Support playing video attachments
Correctly implement audio and video HTML5 tags (there is only one source) PHPBB3-16863
This commit is contained in:
parent
52c8de0bd7
commit
e6e7f5afe3
@ -253,7 +253,7 @@ class attachment extends controller
|
||||
// Content-type header
|
||||
$response->headers->set('Content-Type', $attachment['mimetype']);
|
||||
|
||||
// Display images in browser and force download for other file types
|
||||
// Display file types in browser and force download for others
|
||||
if (strpos($attachment['mimetype'], 'image') !== false
|
||||
|| strpos($attachment['mimetype'], 'audio') !== false
|
||||
|| strpos($attachment['mimetype'], 'video') !== false
|
||||
|
@ -32,9 +32,7 @@
|
||||
{% if _file.S_AUDIO_FILE %}
|
||||
<dl class="file">
|
||||
<dt class="c-file-header">
|
||||
<audio class="c-file-audio-controls" controls="controls" preload="metadata">
|
||||
<source class="c-file-audio-source" src="{{ _file.U_DOWNLOAD_LINK }}" type="{{ _file.MIMETYPE }}">
|
||||
</audio>
|
||||
<audio src="{{ _file.U_DOWNLOAD_LINK }}" type="{{ _file.MIMETYPE }}" class="c-file-audio-controls" controls="controls" preload="metadata"></audio>
|
||||
</dt>
|
||||
{% if _file.COMMENT %}
|
||||
<dd class="c-file-comment">{{ _file.COMMENT }}</dd>
|
||||
@ -43,7 +41,7 @@
|
||||
{% if _file.UPLOAD_ICON %}
|
||||
<span class="o-icon c-file-icon">{{ _file.UPLOAD_ICON }}</span>
|
||||
{% endif %}
|
||||
<a class="c-file-actions-link postlink" href="{{ _file.U_DOWNLOAD_LINK }}" download>{{ _file.DOWNLOAD_NAME }}</a>
|
||||
<a class="c-file-actions-link postlink" href="{{ _file.U_DOWNLOAD_LINK }}">{{ _file.DOWNLOAD_NAME }}</a>
|
||||
<span class="c-file-actions-meta">({{ _file.FILESIZE }} {{ _file.SIZE_LANG }}) {{ _file.L_DOWNLOAD_COUNT }}</span>
|
||||
</dd>
|
||||
</dl>
|
||||
@ -52,9 +50,7 @@
|
||||
{% if _file.S_VIDEO_FILE %}
|
||||
<dl class="file">
|
||||
<dt class="c-file-header">
|
||||
<video class="c-file-video-controls" controls="controls" preload="metadata">
|
||||
<source class="c-file-video-source" src="{{ _file.U_DOWNLOAD_LINK }}" type="{{ _file.MIMETYPE }}">
|
||||
</video>
|
||||
<video src="{{ _file.U_DOWNLOAD_LINK }}" type="{{ _file.MIMETYPE }}" class="c-file-video-controls" controls="controls" preload="metadata"></video>
|
||||
</dt>
|
||||
{% if _file.COMMENT %}
|
||||
<dd class="c-file-comment">{{ _file.COMMENT }}</dd>
|
||||
@ -63,7 +59,7 @@
|
||||
{% if _file.UPLOAD_ICON %}
|
||||
<span class="o-icon c-file-icon">{{ _file.UPLOAD_ICON }}</span>
|
||||
{% endif %}
|
||||
<a class="c-file-actions-link postlink" href="{{ _file.U_DOWNLOAD_LINK }}" download>{{ _file.DOWNLOAD_NAME }}</a>
|
||||
<a class="c-file-actions-link postlink" href="{{ _file.U_DOWNLOAD_LINK }}">{{ _file.DOWNLOAD_NAME }}</a>
|
||||
<span class="c-file-actions-meta">({{ _file.FILESIZE }} {{ _file.SIZE_LANG }}) {{ _file.L_DOWNLOAD_COUNT }}</span>
|
||||
</dd>
|
||||
</dl>
|
||||
|
@ -688,18 +688,10 @@ dl.thumbnail dt a:hover img {
|
||||
max-width: 100%;
|
||||
}
|
||||
|
||||
.c-file-audio-source {
|
||||
/** placeholder */
|
||||
}
|
||||
|
||||
.c-file-video-controls {
|
||||
max-width: 100%;
|
||||
}
|
||||
|
||||
.c-file-video-source {
|
||||
/** placeholder */
|
||||
}
|
||||
|
||||
/* Post poll styles
|
||||
---------------------------------------- */
|
||||
fieldset.polls {
|
||||
|
Loading…
x
Reference in New Issue
Block a user