Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
2ecc5ae2
Commit
2ecc5ae2
authored
Oct 16, 2019
by
Jesse Hall
Committed by
Nick Thomas
Oct 16, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Feature #19822, users can preview audio in a repository.
parent
f081f1dd
Changes
7
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
38 additions
and
2 deletions
+38
-2
app/assets/stylesheets/framework/files.scss
app/assets/stylesheets/framework/files.scss
+2
-0
app/models/blob.rb
app/models/blob.rb
+1
-0
app/models/blob_viewer/audio.rb
app/models/blob_viewer/audio.rb
+12
-0
app/models/blob_viewer/video.rb
app/models/blob_viewer/video.rb
+0
-2
app/views/projects/blob/viewers/_audio.html.haml
app/views/projects/blob/viewers/_audio.html.haml
+2
-0
changelogs/unreleased/19822-audio-preview-in-repo.yml
changelogs/unreleased/19822-audio-preview-in-repo.yml
+5
-0
spec/models/blob_spec.rb
spec/models/blob_spec.rb
+16
-0
No files found.
app/assets/stylesheets/framework/files.scss
View file @
2ecc5ae2
...
...
@@ -108,12 +108,14 @@
background
:
$white-light
;
&
.image_file
,
&
.audio
,
&
.video
{
background
:
$gray-darker
;
text-align
:
center
;
padding
:
30px
;
img
,
audio
,
video
{
max-width
:
80%
;
}
...
...
app/models/blob.rb
View file @
2ecc5ae2
...
...
@@ -32,6 +32,7 @@ class Blob < SimpleDelegator
BlobViewer
::
Balsamiq
,
BlobViewer
::
Video
,
BlobViewer
::
Audio
,
BlobViewer
::
PDF
,
...
...
app/models/blob_viewer/audio.rb
0 → 100644
View file @
2ecc5ae2
# frozen_string_literal: true
module
BlobViewer
class
Audio
<
Base
include
Rich
include
ClientSide
self
.
partial_name
=
'audio'
self
.
extensions
=
UploaderHelper
::
SAFE_AUDIO_EXT
self
.
binary
=
true
end
end
app/models/blob_viewer/video.rb
View file @
2ecc5ae2
...
...
@@ -8,7 +8,5 @@ module BlobViewer
self
.
partial_name
=
'video'
self
.
extensions
=
UploaderHelper
::
SAFE_VIDEO_EXT
self
.
binary
=
true
self
.
switcher_icon
=
'film'
self
.
switcher_title
=
'video'
end
end
app/views/projects/blob/viewers/_audio.html.haml
0 → 100644
View file @
2ecc5ae2
.file-content.audio
%audio
{
src:
blob_raw_path
,
controls:
true
,
data:
{
setup:
'
{}
'
}
}
changelogs/unreleased/19822-audio-preview-in-repo.yml
0 → 100644
View file @
2ecc5ae2
---
title
:
Users can preview audio files in a repository.
merge_request
:
18354
author
:
Jesse Hall @jessehall3
type
:
added
spec/models/blob_spec.rb
View file @
2ecc5ae2
...
...
@@ -320,6 +320,22 @@ describe Blob do
expect
(
blob
.
rich_viewer
).
to
be_a
(
BlobViewer
::
Markup
)
end
end
context
'when the blob is video'
do
it
'returns a video viewer'
do
blob
=
fake_blob
(
path:
'file.mp4'
,
binary:
true
)
expect
(
blob
.
rich_viewer
).
to
be_a
(
BlobViewer
::
Video
)
end
end
context
'when the blob is audio'
do
it
'returns an audio viewer'
do
blob
=
fake_blob
(
path:
'file.wav'
,
binary:
true
)
expect
(
blob
.
rich_viewer
).
to
be_a
(
BlobViewer
::
Audio
)
end
end
end
describe
'#auxiliary_viewer'
do
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment