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
fdabbc36
Commit
fdabbc36
authored
Sep 27, 2021
by
Jacques
Committed by
Peter Hegman
Sep 29, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add video viewer
Added a video viewer as part of the blob refactor
parent
0335e0c4
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
42 additions
and
0 deletions
+42
-0
app/assets/javascripts/repository/components/blob_viewers/index.js
...s/javascripts/repository/components/blob_viewers/index.js
+5
-0
app/assets/javascripts/repository/components/blob_viewers/video_viewer.vue
...ripts/repository/components/blob_viewers/video_viewer.vue
+15
-0
spec/frontend/repository/components/blob_viewers/video_viewer_spec.js
...d/repository/components/blob_viewers/video_viewer_spec.js
+22
-0
No files found.
app/assets/javascripts/repository/components/blob_viewers/index.js
View file @
fdabbc36
...
...
@@ -10,6 +10,8 @@ export const loadViewer = (type) => {
return
()
=>
import
(
/* webpackChunkName: 'blob_download_viewer' */
'
./download_viewer.vue
'
);
case
'
image
'
:
return
()
=>
import
(
/* webpackChunkName: 'blob_image_viewer' */
'
./image_viewer.vue
'
);
case
'
video
'
:
return
()
=>
import
(
/* webpackChunkName: 'blob_video_viewer' */
'
./video_viewer.vue
'
);
default
:
return
null
;
}
...
...
@@ -31,5 +33,8 @@ export const viewerProps = (type, blob) => {
url
:
blob
.
rawPath
,
alt
:
blob
.
name
,
},
video
:
{
url
:
blob
.
rawPath
,
},
}[
type
];
};
app/assets/javascripts/repository/components/blob_viewers/video_viewer.vue
0 → 100644
View file @
fdabbc36
<
script
>
export
default
{
props
:
{
url
:
{
type
:
String
,
required
:
true
,
},
},
};
</
script
>
<
template
>
<div
class=
"gl-text-center gl-p-7 gl-bg-gray-50"
>
<video
:src=
"url"
controls
data-testid=
"video"
class=
"gl-max-w-full"
></video>
</div>
</
template
>
spec/frontend/repository/components/blob_viewers/video_viewer_spec.js
0 → 100644
View file @
fdabbc36
import
{
shallowMountExtended
}
from
'
helpers/vue_test_utils_helper
'
;
import
VideoViewer
from
'
~/repository/components/blob_viewers/video_viewer.vue
'
;
describe
(
'
Video Viewer
'
,
()
=>
{
let
wrapper
;
const
propsData
=
{
url
:
'
some/video.mp4
'
};
const
createComponent
=
()
=>
{
wrapper
=
shallowMountExtended
(
VideoViewer
,
{
propsData
});
};
const
findVideo
=
()
=>
wrapper
.
findByTestId
(
'
video
'
);
it
(
'
renders a Video element
'
,
()
=>
{
createComponent
();
expect
(
findVideo
().
exists
()).
toBe
(
true
);
expect
(
findVideo
().
attributes
(
'
src
'
)).
toBe
(
propsData
.
url
);
expect
(
findVideo
().
attributes
(
'
controls
'
)).
not
.
toBeUndefined
();
});
});
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