mirror of
https://github.com/haiwen/seahub.git
synced 2025-09-07 01:41:39 +00:00
Added support for previewing Video and mp3 files.
This commit is contained in:
@@ -162,6 +162,15 @@ if (!($.browser.msie && parseInt($.browser.version) < 10)) {
|
||||
}
|
||||
{% endif %}
|
||||
|
||||
{% if filetype == 'Video' %}
|
||||
$('#file-view').html('<div class="video-container"><video src="{{raw_path}}" width="800" height="400"></video></div>');
|
||||
$('video').mediaelementplayer(/* Options */);
|
||||
{% endif %}
|
||||
|
||||
{% if filetype == 'Audio' %}
|
||||
$('#file-view').html('<div class="audio-container"><audio src="{{raw_path}}" width="500" height="30"></audio></div>');
|
||||
$('audio').mediaelementplayer(/* Options */);
|
||||
{% endif %}
|
||||
{% if filetype == 'Unknown' %}
|
||||
$('#file-view').html('<div id="file-view-tip"><p>{% trans "This type of file cannot be viewed online." %}</p></div>');
|
||||
{% endif %}
|
||||
|
@@ -7,6 +7,9 @@
|
||||
{% if filetype == 'PDF' and use_pdfjs %}
|
||||
<script type="text/javascript" src="{{MEDIA_URL}}js/pdf.js"></script>
|
||||
{% endif %}
|
||||
{% if filetype == 'Video' or filetype == 'Audio' %}
|
||||
<script src="{{MEDIA_URL}}js/mediaelement-and-player.min.js"></script>
|
||||
{% endif %}
|
||||
{% if filetype == 'Markdown' %}
|
||||
<script type="text/javascript" src="{{MEDIA_URL}}js/showdown.js"></script>
|
||||
{% endif %}
|
||||
|
@@ -19,3 +19,7 @@
|
||||
#file-view { text-align:center; padding:30px 0; }
|
||||
</style>
|
||||
{% endif %}
|
||||
|
||||
{% if filetype == 'Video' or filetype == 'Audio' %}
|
||||
<link rel="stylesheet" href="{{MEDIA_URL}}css/mediaelementplayer.css" />
|
||||
{% endif %}
|
||||
|
Reference in New Issue
Block a user