Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
slm-fileview
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
梁杰芳
slm-fileview
Commits
41d90150
Commit
41d90150
authored
May 16, 2019
by
陈精华
Committed by
kl
May 23, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
支持flv视频预览
parent
3f40b60c
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
36 additions
and
0 deletions
+36
-0
MediaFilePreviewImpl.java
...ain/java/cn/keking/service/impl/MediaFilePreviewImpl.java
+6
-0
flv.min.js
jodconverter-web/src/main/resources/static/js/flv.min.js
+0
-0
flv.ftl
jodconverter-web/src/main/resources/web/flv.ftl
+30
-0
No files found.
jodconverter-web/src/main/java/cn/keking/service/impl/MediaFilePreviewImpl.java
View file @
41d90150
package
cn
.
keking
.
service
.
impl
;
import
cn.keking.model.FileAttribute
;
import
cn.keking.service.FilePreview
;
import
cn.keking.utils.FileUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
...
...
@@ -20,6 +21,11 @@ public class MediaFilePreviewImpl implements FilePreview {
@Override
public
String
filePreviewHandle
(
String
url
,
Model
model
)
{
model
.
addAttribute
(
"mediaUrl"
,
url
);
FileAttribute
fileAttribute
=
fileUtils
.
getFileAttribute
(
url
);
String
suffix
=
fileAttribute
.
getSuffix
();
if
(
"flv"
.
equalsIgnoreCase
(
suffix
))
{
return
"flv"
;
}
return
"media"
;
}
...
...
jodconverter-web/src/main/resources/static/js/flv.min.js
0 → 100644
View file @
41d90150
This source diff could not be displayed because it is too large. You can
view the blob
instead.
jodconverter-web/src/main/resources/web/flv.ftl
0 → 100644
View file @
41d90150
<!DOCTYPE html>
<html
lang=
"en"
>
<head>
<meta
charset=
"utf-8"
>
<title>
多媒体文件预览
</title>
</head>
<style>
body
{
background-color
:
#262626
}
.m
{
margin-left
:
auto
;
margin-right
:
auto
;
width
:
1024px
;
margin-top
:
100px
;
}
</style>
<body>
<div
class=
"m"
>
<video
width=
"1024"
id=
"videoElement"
></video>
</div>
<script
src=
"js/flv.min.js"
></script>
<script>
if
(
flvjs
.
isSupported
())
{
var
videoElement
=
document
.
getElementById
(
'videoElement'
);
var
flvPlayer
=
flvjs
.
createPlayer
({
type
:
'flv'
,
url
:
'${mediaUrl}'
});
flvPlayer
.
attachMediaElement
(
videoElement
);
flvPlayer
.
load
();
flvPlayer
.
play
();
}
</script>
</body>
</html>
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