1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-18 08:16:07 +00:00

[history/shared file view] modification for video files

This commit is contained in:
llj
2016-11-11 13:53:47 +08:00
parent 9e48df9ca9
commit 2e565e4434
4 changed files with 17 additions and 5 deletions

View File

@@ -139,8 +139,13 @@ try {
{% endif %}
{% if filetype == 'Video' %}
$('#file-view').html('<div class="video-container"><video src="{{raw_path}}" width="800" height="400"></video></div>');
$('video').mediaelementplayer(/* Options */);
$('#file-view').html('<div class="video-container"><video id="sf-video" src="{{raw_path}}" width="800" height="400" class="video-js vjs-default-skin"></video></div>');
videojs.options.flash.swf = "{{MEDIA_URL}}js/video-js.swf";
videojs('sf-video', {
'controls': true,
'autoplay': false,
'preload': 'auto'
});
{% endif %}
{% if filetype == 'Audio' %}

View File

@@ -4,9 +4,12 @@
{% if filetype == 'PDF' and use_pdfjs %}
<script type="text/javascript" src="{{MEDIA_URL}}js/pdf.js"></script>
{% endif %}
{% if filetype == 'Video' or filetype == 'Audio' %}
{% if filetype == 'Audio' %}
<script src="{{MEDIA_URL}}js/mediaelement-and-player.min.js"></script>
{% endif %}
{% if filetype == 'Video' %}
<script src="{{MEDIA_URL}}js/video.min.js"></script>
{% endif %}
{% if filetype == 'Markdown' %}
<script type="text/javascript" src="{{MEDIA_URL}}js/editormd/lib/marked.min.js"></script>
{% endif %}

View File

@@ -14,10 +14,14 @@
</style>
{% endif %}
{% if filetype == 'Video' or filetype == 'Audio' %}
{% if filetype == 'Audio' %}
<link rel="stylesheet" href="{{MEDIA_URL}}css/mediaelementplayer.css" />
{% endif %}
{% if filetype == 'Video' %}
<link rel="stylesheet" href="{{MEDIA_URL}}css/video-js.min.css" />
{% endif %}
{% if filetype == 'Document' or filetype == 'PDF' and not use_pdfjs %}
{% include 'snippets/office_convert_style.html' %}
{% endif %}

View File

@@ -102,7 +102,7 @@ PREVIEW_FILEEXT = {
PDF: ('pdf',),
OPENDOCUMENT: ('odt', 'fodt', 'odp', 'fodp'),
MARKDOWN: ('markdown', 'md'),
VIDEO: ('mp4', 'ogv', 'webm', 'wmv', 'mov'),
VIDEO: ('mp4', 'ogv', 'webm', 'mov'),
AUDIO: ('mp3', 'oga', 'ogg'),
'3D': ('stl', 'obj'),
}