Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
D
digital-construction
Project
Project
Details
Activity
Releases
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
张牧越
digital-construction
Commits
04fb8503
Commit
04fb8503
authored
Apr 28, 2023
by
张牧越
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
全部预览
parent
e679940b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
32 additions
and
7 deletions
+32
-7
Index.vue
src/components/supervisory/Index.vue
+32
-7
No files found.
src/components/supervisory/Index.vue
View file @
04fb8503
...
...
@@ -74,11 +74,7 @@
</div>
</
template
>
<
script
>
import
{
getVideoTreeData
,
getVideoLiveAddressUrl
,
getAllVideoUrl
,
}
from
"@/api/index"
;
import
{
getVideoTreeData
,
getVideoLiveAddressUrl
}
from
"@/api/index"
;
require
(
"vue-video-player/node_modules/video.js/dist/video-js.css"
);
import
videojs
from
"video.js"
;
import
"videojs-contrib-hls"
;
...
...
@@ -260,8 +256,37 @@ export default {
});
})
.
flat
();
getAllVideoUrl
({
ids
:
allVideoIdArray
.
join
(
","
)
}).
then
((
res
)
=>
{
console
.
log
(
res
);
allVideoIdArray
.
map
((
id
,
index
)
=>
{
this
.
cameraList
.
push
({
player
:
undefined
,
id
:
id
,
});
getVideoLiveAddressUrl
(
id
).
then
((
res
)
=>
{
this
.
$nextTick
(()
=>
{
const
myVideoDiv
=
document
.
getElementById
(
`video-container-
${
index
+
1
}
`
);
myVideoDiv
.
innerHTML
=
`<video
id="singleVideo
${
index
+
1
}
"
autoplay="autoplay"
class="video-js vjs-default-skin"
></video>`
;
const
singlePlayer
=
videojs
(
`singleVideo
${
index
+
1
}
`
,
{
autoplay
:
true
,
// 自动播放
controls
:
true
,
// 控件显示
preload
:
"auto"
,
//定义视频加载模式
loop
:
true
,
//是否循环播放
});
singlePlayer
.
src
({
src
:
res
.
data
.
live_address_url
,
type
:
"application/x-mpegURL"
,
});
singlePlayer
.
play
();
this
.
cameraList
[
index
].
player
=
singlePlayer
;
});
});
});
},
},
...
...
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