Display video blobs in-line like images
This commit is contained in:
parent
31b87b8cab
commit
e4cca4d7fd
5 changed files with 24 additions and 2 deletions
|
@ -61,11 +61,13 @@
|
|||
.file-content {
|
||||
background: $white-light;
|
||||
|
||||
&.image_file {
|
||||
&.image_file,
|
||||
&.video {
|
||||
background: $file-image-bg;
|
||||
text-align: center;
|
||||
|
||||
img {
|
||||
img,
|
||||
video {
|
||||
padding: 20px;
|
||||
max-width: 80%;
|
||||
}
|
||||
|
|
|
@ -27,6 +27,8 @@ class Blob < SimpleDelegator
|
|||
BlobViewer::Image,
|
||||
BlobViewer::Sketch,
|
||||
|
||||
BlobViewer::Video,
|
||||
|
||||
BlobViewer::PDF,
|
||||
|
||||
BlobViewer::BinarySTL,
|
||||
|
|
12
app/models/blob_viewer/video.rb
Normal file
12
app/models/blob_viewer/video.rb
Normal file
|
@ -0,0 +1,12 @@
|
|||
module BlobViewer
|
||||
class Video < Base
|
||||
include Rich
|
||||
include ClientSide
|
||||
|
||||
self.partial_name = 'video'
|
||||
self.extensions = UploaderHelper::VIDEO_EXT
|
||||
self.binary = true
|
||||
self.switcher_icon = 'film'
|
||||
self.switcher_title = 'video'
|
||||
end
|
||||
end
|
2
app/views/projects/blob/viewers/_video.html.haml
Normal file
2
app/views/projects/blob/viewers/_video.html.haml
Normal file
|
@ -0,0 +1,2 @@
|
|||
.file-content.video
|
||||
%video{ src: blob_raw_url, controls: true, data: { setup: '{}' } }
|
4
changelogs/unreleased/dm-video-viewer.yml
Normal file
4
changelogs/unreleased/dm-video-viewer.yml
Normal file
|
@ -0,0 +1,4 @@
|
|||
---
|
||||
title: Display video blobs in-line like images
|
||||
merge_request:
|
||||
author:
|
Loading…
Reference in a new issue