Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
X
xxx_phase2_web
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
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
夏敏伟
xxx_phase2_web
Commits
99aa173f
Commit
99aa173f
authored
Jul 18, 2024
by
高飞
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改图片预览默认宽高自适应和视频预览报错后,再次就无法预览问题
parent
07f0cf39
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
84 additions
and
32 deletions
+84
-32
src/components/common/video_player.vue
src/components/common/video_player.vue
+31
-28
src/view/flfg/znfx.vue
src/view/flfg/znfx.vue
+7
-1
src/view/flfg/znfxZfcl.vue
src/view/flfg/znfxZfcl.vue
+32
-1
src/view/fzjc/znfx.vue
src/view/fzjc/znfx.vue
+7
-1
src/view/sjgl/wxk_public.vue
src/view/sjgl/wxk_public.vue
+7
-1
No files found.
src/components/common/video_player.vue
View file @
99aa173f
...
@@ -26,42 +26,45 @@ export default {
...
@@ -26,42 +26,45 @@ export default {
if
(
this
.
src
.
endsWith
(
"
flv
"
))
{
if
(
this
.
src
.
endsWith
(
"
flv
"
))
{
if
(
flvjs
.
isSupported
())
{
if
(
flvjs
.
isSupported
())
{
var
videoElement
=
document
.
getElementById
(
'
my-player
'
);
var
videoElement
=
document
.
getElementById
(
'
my-player
'
);
this
.
flvPlayer
=
flvjs
.
createPlayer
({
this
.
$nextTick
(()
=>
{
type
:
'
flv
'
,
this
.
flvPlayer
=
flvjs
.
createPlayer
({
isLive
:
true
,
type
:
'
flv
'
,
url
:
this
.
src
,
//flv格式流地址
isLive
:
true
,
},
{
url
:
this
.
src
,
//flv格式流地址
enableWorker
:
false
,
//不启用分离线程
},
{
enableStashBuffer
:
false
,
//关闭IO隐藏缓冲区
enableWorker
:
false
,
//不启用分离线程
reuseRedirectedURL
:
true
,
//重用301/302重定向url,用于随后的请求,如查找、重新连接等。
enableStashBuffer
:
false
,
//关闭IO隐藏缓冲区
autoCleanupSourceBuffer
:
true
//自动清除缓存
reuseRedirectedURL
:
true
,
//重用301/302重定向url,用于随后的请求,如查找、重新连接等。
});
autoCleanupSourceBuffer
:
true
//自动清除缓存
this
.
flvPlayer
.
attachMediaElement
(
videoElement
);
});
this
.
flvPlayer
.
load
();
//加载
this
.
flvPlayer
.
attachMediaElement
(
videoElement
);
this
.
flvPlayer
.
play
();
//播放
this
.
flvPlayer
.
load
();
//加载
this
.
flvPlayer
.
play
();
//播放
})
}
}
}
else
{
}
else
{
videojs
.
addLanguage
(
"
zh-CN
"
,
videozhCN
);
videojs
.
addLanguage
(
"
zh-CN
"
,
videozhCN
);
this
.
mp4Player
=
videojs
(
'
my-player
'
,
{
this
.
$nextTick
(()
=>
{
sources
:
[
{
this
.
mp4Player
=
videojs
(
'
my-player
'
,
{
language
:
"
zh-CN
"
,
sources
:
[{
src
:
this
.
src
,
language
:
"
zh-CN
"
,
autoplay
:
true
,
src
:
this
.
src
,
playbackRates
:
[
0.5
,
1
,
1.5
,
2
]
//倍速播放
autoplay
:
true
,
}]
playbackRates
:
[
0.5
,
1
,
1.5
,
2
]
//倍速播放
},
function
()
{
}]
});
}
);
this
.
mp4Player
.
play
(
);
this
.
mp4Player
.
play
();
})
}
}
},
},
destroyed
()
{
destroyed
()
{
this
.
flvPlayer
&&
this
.
flvPlayer
.
unload
();
//
this.flvPlayer && this.flvPlayer.unload();
this
.
flvPlayer
&&
this
.
flvPlayer
.
detachMediaElement
()
//
this.flvPlayer && this.flvPlayer.detachMediaElement()
this
.
flvPlayer
&&
this
.
flvPlayer
.
destroy
();
this
.
flvPlayer
&&
this
.
flvPlayer
.
destroy
();
this
.
mp4Player
&&
this
.
mp4Player
.
pause
()
this
.
mp4Player
&&
this
.
mp4Player
.
dispose
();
this
.
mp4Player
&&
this
.
mp4Player
.
dispose
();
this
.
mp4Player
=
null
;
this
.
flvPlayer
=
null
;
// this.mp4Player && this.mp4Player.pause()
}
}
}
}
</
script
>
</
script
>
\ No newline at end of file
src/view/flfg/znfx.vue
View file @
99aa173f
...
@@ -364,7 +364,7 @@
...
@@ -364,7 +364,7 @@
<el-dialog
:title=
"title_img"
:visible.sync=
"centerDialogVisible_img"
center
width=
"800px"
<el-dialog
:title=
"title_img"
:visible.sync=
"centerDialogVisible_img"
center
width=
"800px"
:destroyOnClose=
"true"
>
:destroyOnClose=
"true"
>
<div
style=
"text-align: center;"
v-loading=
"loadings"
>
<div
style=
"text-align: center;"
v-loading=
"loadings"
>
<el-image
style=
"width: 750px; height: 500px"
:src=
"img_src"
:preview-src-list=
"[img_src]"
>
<el-image
style=
"width: 750px; height: 500px"
:src=
"img_src"
:preview-src-list=
"[img_src]"
class=
"imgs"
>
</el-image>
</el-image>
</div>
</div>
</el-dialog>
</el-dialog>
...
@@ -970,6 +970,7 @@ export default {
...
@@ -970,6 +970,7 @@ export default {
convertBMPtoPNG
(
bmpImage
,
callback
)
{
convertBMPtoPNG
(
bmpImage
,
callback
)
{
// 创建一个新的 Image 对象
// 创建一个新的 Image 对象
const
img
=
new
Image
();
const
img
=
new
Image
();
img
.
setAttribute
(
"
crossOrigin
"
,
'
Anonymous
'
)
img
.
onload
=
function
()
{
img
.
onload
=
function
()
{
// 创建一个 Canvas 元素
// 创建一个 Canvas 元素
const
canvas
=
document
.
createElement
(
'
canvas
'
);
const
canvas
=
document
.
createElement
(
'
canvas
'
);
...
@@ -1569,5 +1570,10 @@ export default {
...
@@ -1569,5 +1570,10 @@ export default {
}
}
}
}
}
}
.imgs
{
.el-image__preview
{
object-fit
:
contain
;
}
}
}
}
</
style
>
</
style
>
src/view/flfg/znfxZfcl.vue
View file @
99aa173f
...
@@ -364,7 +364,7 @@
...
@@ -364,7 +364,7 @@
<el-dialog
:title=
"title_img"
:visible.sync=
"centerDialogVisible_img"
center
width=
"800px"
<el-dialog
:title=
"title_img"
:visible.sync=
"centerDialogVisible_img"
center
width=
"800px"
:destroyOnClose=
"true"
>
:destroyOnClose=
"true"
>
<div
style=
"text-align: center;"
v-loading=
"loadings"
>
<div
style=
"text-align: center;"
v-loading=
"loadings"
>
<el-image
style=
"width: 750px; height: 500px"
:src=
"img_src"
:preview-src-list=
"[img_src]"
>
<el-image
style=
"width: 750px; height: 500px"
:src=
"img_src"
:preview-src-list=
"[img_src]"
class=
"imgs"
>
</el-image>
</el-image>
</div>
</div>
</el-dialog>
</el-dialog>
...
@@ -967,6 +967,32 @@ export default {
...
@@ -967,6 +967,32 @@ export default {
this
.
searchs
(
1
);
this
.
searchs
(
1
);
this
.
wjfx_qh
=
true
;
this
.
wjfx_qh
=
true
;
},
},
convertBMPtoPNG
(
bmpImage
,
callback
)
{
// 创建一个新的 Image 对象
const
img
=
new
Image
();
img
.
setAttribute
(
"
crossOrigin
"
,
'
Anonymous
'
)
img
.
onload
=
function
()
{
// 创建一个 Canvas 元素
const
canvas
=
document
.
createElement
(
'
canvas
'
);
canvas
.
width
=
img
.
width
;
canvas
.
height
=
img
.
height
;
// 获取 CanvasRenderingContext2D 对象
const
ctx
=
canvas
.
getContext
(
'
2d
'
);
// 将 BMP 图片绘制到 Canvas 上
ctx
.
drawImage
(
img
,
0
,
0
);
// 将 Canvas 的内容转换为 PNG 格式的 DataURL
const
pngImage
=
canvas
.
toDataURL
(
'
image/png
'
);
// 调用回调函数并传递转换后的 PNG 图片
callback
(
pngImage
);
};
// 设置 BMP 图片源
img
.
src
=
bmpImage
;
}
},
},
mounted
()
{
mounted
()
{
let
_this
=
this
;
let
_this
=
this
;
...
@@ -1544,5 +1570,10 @@ export default {
...
@@ -1544,5 +1570,10 @@ export default {
}
}
}
}
}
}
.imgs
{
.el-image__preview
{
object-fit
:
contain
;
}
}
}
}
</
style
>
</
style
>
src/view/fzjc/znfx.vue
View file @
99aa173f
...
@@ -365,7 +365,7 @@
...
@@ -365,7 +365,7 @@
<el-dialog
:title=
"title_img"
:visible.sync=
"centerDialogVisible_img"
center
width=
"800px"
<el-dialog
:title=
"title_img"
:visible.sync=
"centerDialogVisible_img"
center
width=
"800px"
:destroyOnClose=
"true"
>
:destroyOnClose=
"true"
>
<div
style=
"text-align: center;"
v-loading=
"loadings"
>
<div
style=
"text-align: center;"
v-loading=
"loadings"
>
<el-image
style=
"width: 750px; height: 500px"
:src=
"img_src"
:preview-src-list=
"[img_src]"
>
<el-image
style=
"width: 750px; height: 500px"
:src=
"img_src"
:preview-src-list=
"[img_src]"
class=
"imgs"
>
</el-image>
</el-image>
</div>
</div>
</el-dialog>
</el-dialog>
...
@@ -1023,6 +1023,7 @@ export default {
...
@@ -1023,6 +1023,7 @@ export default {
convertBMPtoPNG
(
bmpImage
,
callback
)
{
convertBMPtoPNG
(
bmpImage
,
callback
)
{
// 创建一个新的 Image 对象
// 创建一个新的 Image 对象
const
img
=
new
Image
();
const
img
=
new
Image
();
img
.
setAttribute
(
"
crossOrigin
"
,
'
Anonymous
'
)
img
.
onload
=
function
()
{
img
.
onload
=
function
()
{
// 创建一个 Canvas 元素
// 创建一个 Canvas 元素
const
canvas
=
document
.
createElement
(
'
canvas
'
);
const
canvas
=
document
.
createElement
(
'
canvas
'
);
...
@@ -1639,5 +1640,10 @@ export default {
...
@@ -1639,5 +1640,10 @@ export default {
}
}
}
}
}
}
.imgs
{
.el-image__preview
{
object-fit
:
contain
;
}
}
}
}
</
style
>
</
style
>
src/view/sjgl/wxk_public.vue
View file @
99aa173f
...
@@ -387,7 +387,7 @@
...
@@ -387,7 +387,7 @@
<el-dialog
:title=
"title_img"
:visible.sync=
"centerDialogVisible_img"
center
width=
"800px"
<el-dialog
:title=
"title_img"
:visible.sync=
"centerDialogVisible_img"
center
width=
"800px"
:destroyOnClose=
"true"
>
:destroyOnClose=
"true"
>
<div
style=
"text-align: center;"
v-loading=
"loadings"
>
<div
style=
"text-align: center;"
v-loading=
"loadings"
>
<el-image
style=
"width: 750px; height: 500px"
:src=
"img_src"
:preview-src-list=
"[img_src]"
>
<el-image
style=
"width: 750px; height: 500px"
:src=
"img_src"
:preview-src-list=
"[img_src]"
class=
"imgs"
>
</el-image>
</el-image>
</div>
</div>
</el-dialog>
</el-dialog>
...
@@ -1593,6 +1593,7 @@ export default {
...
@@ -1593,6 +1593,7 @@ export default {
convertBMPtoPNG
(
bmpImage
,
callback
)
{
convertBMPtoPNG
(
bmpImage
,
callback
)
{
// 创建一个新的 Image 对象
// 创建一个新的 Image 对象
const
img
=
new
Image
();
const
img
=
new
Image
();
img
.
setAttribute
(
"
crossOrigin
"
,
'
Anonymous
'
)
img
.
onload
=
function
()
{
img
.
onload
=
function
()
{
// 创建一个 Canvas 元素
// 创建一个 Canvas 元素
const
canvas
=
document
.
createElement
(
'
canvas
'
);
const
canvas
=
document
.
createElement
(
'
canvas
'
);
...
@@ -2354,6 +2355,11 @@ export default {
...
@@ -2354,6 +2355,11 @@ export default {
background-color
:
#00648a
96
!
important
;
background-color
:
#00648a
96
!
important
;
// border-radius: 5px;
// border-radius: 5px;
}
}
.imgs
{
.el-image__preview
{
object-fit
:
contain
;
}
}
}
}
</
style
>
</
style
>
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