File tree 2 files changed +13
-2
lines changed
2 files changed +13
-2
lines changed Original file line number Diff line number Diff line change @@ -41,6 +41,14 @@ Template.file.onRendered ->
41
41
self .showOriginal .set true
42
42
return
43
43
img .src = @data .file .link ()
44
+
45
+ else if @data .file .isVideo
46
+ video = document .getElementById @data .file ._id
47
+ unless video .canPlayType @data .file .type
48
+ @ $ (' #cantPlayVideo' ).show ()
49
+ video .style .display = ' none'
50
+ else
51
+ video .play ()
44
52
window .IS_RENDERED = true
45
53
return
46
54
Original file line number Diff line number Diff line change @@ -56,8 +56,11 @@ template(name="file")
56
56
.file-cell : audio.file-preview.file-audio ( controls autoplay preload ="auto" loop )
57
57
source( src ="{{link}}?play=true" type ="#{type} " )
58
58
else if isVideo
59
- .file-cell : video.file-preview ( controls autoplay preload ="auto" loop )
60
- source( src ="{{link}}?play=true" type ="#{type} " )
59
+ .file-cell
60
+ video.file-preview ( id ="{{_id}}" controls autoplay preload ="auto" loop )
61
+ p Can not play this video. The "#{type} " format may be not supported in your browser
62
+ source( src ="{{link}}?play=true" type ="#{type} " )
63
+ p#cantPlayVideo ( style ="display:none" ) Can not play this video. The "#{type} " format may be not supported in your browser
61
64
else if compare isText ' or' isJSON
62
65
if warning
63
66
.file-cell : h3.files-note
You can’t perform that action at this time.
0 commit comments