Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
supervise-front
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
5
Issues
5
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
牛晓林
supervise-front
Commits
34632a05
Commit
34632a05
authored
Aug 13, 2019
by
niuxiaolin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
latest ui 08/13/2019 12:05:46
parent
f2a28a4e
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
63 additions
and
28 deletions
+63
-28
video.component.ts
src/app/video/video.component.ts
+41
-28
index.html
src/index.html
+22
-0
No files found.
src/app/video/video.component.ts
View file @
34632a05
...
...
@@ -3,6 +3,8 @@ import { DynamicScriptLoaderService } from '../dynamic-script.service';
import
{
NzTreeNodeOptions
,
NzFormatEmitEvent
}
from
'ng-zorro-antd'
;
import
{
HttpClient
}
from
'@angular/common/http'
;
import
{
DefaultService
}
from
'../api'
;
import
{
mergeMap
,
merge
}
from
'rxjs/operators'
;
import
{
of
,
concat
}
from
'rxjs'
;
declare
var
WebControl
;
declare
var
JSEncrypt
;
declare
var
$
;
...
...
@@ -55,12 +57,17 @@ export class VideoComponent implements OnInit {
break
;
}
if
(
node
&&
node
.
getChildren
().
length
===
0
&&
node
.
isExpanded
)
{
this
.
http
.
get
(
this
.
d
.
basePath
+
request
+
node
.
key
).
subscribe
(
res
=>
{
console
.
log
(
res
);
if
(
node
.
level
==
2
){
(
res
as
any
).
data
.
forEach
((
element
,
index
)
=>
{
this
.
preview2
(
element
.
cameraIndexCode
,
index
+
1
)
});
// concat(...previews);
//of('test').pipe(...concatMaps);
}
node
.
addChildren
((
res
as
any
).
data
.
map
((
d
,
index
)
=>
({
title
:
d
.
name
||
d
.
cameraName
,
key
:
d
.
id
||
d
.
cameraIndexCode
,
index
:
index
,
isLeaf
:
node
.
level
==
2
})));
});
...
...
@@ -73,7 +80,7 @@ export class VideoComponent implements OnInit {
}
}
addVCR
(
$event
:
Required
<
NzFormatEmitEvent
>
){
this
.
preview2
(
$event
.
node
.
key
,
$event
.
node
.
origin
.
index
+
1
);
this
.
preview2
(
$event
.
node
.
key
,
0
);
}
loadNode
():
Promise
<
NzTreeNodeOptions
[]
>
{
return
new
Promise
(
resolve
=>
{
...
...
@@ -96,28 +103,30 @@ export class VideoComponent implements OnInit {
console
.
log
(
'Button cancel clicked!'
);
this
.
isVisible
=
false
;
}
preview
()
{
var
cameraIndexCode
=
"862edc0a09734e83a69101f69f840e0d"
;
//获取输入的监控点编号值,必填
var
streamMode
=
0
;
//主子码流标识:0-主码流,1-子码流
var
transMode
=
1
;
//传输协议:0-UDP,1-TCP
var
gpuMode
=
0
;
//是否启用GPU硬解,0-不启用,1-启用
var
wndId
=
-
1
;
//播放窗口序号(在2x2以上布局下可指定播放窗口)
//
preview() {
//
var cameraIndexCode ="862edc0a09734e83a69101f69f840e0d"; //获取输入的监控点编号值,必填
//
var streamMode = 0; //主子码流标识:0-主码流,1-子码流
//
var transMode = 1; //传输协议:0-UDP,1-TCP
//
var gpuMode = 0; //是否启用GPU硬解,0-不启用,1-启用
//
var wndId = -1; //播放窗口序号(在2x2以上布局下可指定播放窗口)
cameraIndexCode
=
cameraIndexCode
.
replace
(
/
(
^
\s
*
)
/g
,
""
);
cameraIndexCode
=
cameraIndexCode
.
replace
(
/
(\s
*$
)
/g
,
""
);
//
cameraIndexCode = cameraIndexCode.replace(/(^\s*)/g, "");
//
cameraIndexCode = cameraIndexCode.replace(/(\s*$)/g, "");
this
.
oWebControl
.
JS_RequestInterface
({
funcName
:
"startPreview"
,
argument
:
JSON
.
stringify
({
cameraIndexCode
:
cameraIndexCode
,
//监控点编号
streamMode
:
streamMode
,
//主子码流标识
transMode
:
transMode
,
//传输协议
gpuMode
:
gpuMode
,
//是否开启GPU硬解
wndId
:
wndId
//可指定播放窗口
})
})
}
preview2
(
cameraIndexCode
:
string
,
wndId
)
{
// this.oWebControl.JS_RequestInterface({
// funcName: "startPreview",
// argument: JSON.stringify({
// cameraIndexCode:cameraIndexCode, //监控点编号
// streamMode: streamMode, //主子码流标识
// transMode: transMode, //传输协议
// gpuMode: gpuMode, //是否开启GPU硬解
// wndId:wndId //可指定播放窗口
// })
// })
// }
preview2
(
cameraIndexCode
:
string
,
idnex
):
Promise
<
string
>
{
return
new
Promise
((
res
,
rej
)
=>
{
console
.
log
(
'start'
)
//var cameraIndexCode ="bb44edc4e843421da68f33699e7203f2"; //获取输入的监控点编号值,必填
var
streamMode
=
0
;
//主子码流标识:0-主码流,1-子码流
var
transMode
=
1
;
//传输协议:0-UDP,1-TCP
...
...
@@ -133,11 +142,15 @@ export class VideoComponent implements OnInit {
streamMode
:
streamMode
,
//主子码流标识
transMode
:
transMode
,
//传输协议
gpuMode
:
gpuMode
,
//是否开启GPU硬解
wndId
:
wndId
//可指定播放窗口
wndId
:
idnex
//可指定播放窗口
})
}).
then
(
msg
=>
{
console
.
log
(
msg
)
}).
finally
(
e
=>
{
console
.
log
(
'end'
)
res
(
e
);
});
});
}
startVideo
()
{
// 监听resize事件,使插件窗口尺寸跟随DIV窗口变化
...
...
@@ -152,7 +165,7 @@ export class VideoComponent implements OnInit {
});
// 监听滚动条scroll事件,使插件窗口跟随浏览器滚动而移动
$
(
window
).
scroll
(
function
()
{
$
(
window
).
scroll
(
function
()
{
if
(
oWebControl
!=
null
)
{
var
width
=
$
(
document
).
width
()
var
height
=
$
(
document
).
height
()
...
...
@@ -164,7 +177,7 @@ $(window).scroll(function () {
// 设置窗口裁剪,当因滚动条滚动导致窗口需要被遮住的情况下需要JS_CuttingPartWindow部分窗口
function
setWndCover
()
{
function
setWndCover
()
{
var
iWidth
=
$
(
window
).
width
();
var
iHeight
=
$
(
window
).
height
();
var
oDivRect
=
$
(
"#playWnd"
).
get
(
0
).
getBoundingClientRect
();
...
...
@@ -179,7 +192,7 @@ function setWndCover() {
iCoverRight
=
(
iCoverRight
>
1500
)
?
1500
:
iCoverRight
;
iCoverBottom
=
(
iCoverBottom
>
700
)
?
700
:
iCoverBottom
;
oWebControl
.
JS_RepairPartWindow
(
0
,
0
,
1001
,
700
);
// 多1个像素点防止还原后边界缺失一个像素条
oWebControl
.
JS_RepairPartWindow
(
0
,
0
,
1001
,
700
);
// 多1个像素点防止还原后边界缺失一个像素条
if
(
iCoverLeft
!=
0
)
{
oWebControl
.
JS_CuttingPartWindow
(
0
,
0
,
iCoverLeft
,
700
);
}
...
...
src/index.html
View file @
34632a05
...
...
@@ -4,7 +4,29 @@
<meta
charset=
"utf-8"
>
<title>
Map
</title>
<base
href=
"/"
>
<!-- pre-zone polyfills -->
<script
src=
"node_modules/core-js/client/shim.min.js"
></script>
<script
src=
"node_modules/web-animations-js/web-animations.min.js"
></script>
<script>
/**
* you can configure some zone flags which can disable zone interception for some
* asynchronous activities to improve startup performance - use these options only
* if you know what you are doing as it could result in hard to trace down bugs..
*/
// __Zone_disable_requestAnimationFrame = true; // disable patch requestAnimationFrame
// __Zone_disable_on_property = true; // disable patch onProperty such as onclick
// __zone_symbol__BLACK_LISTED_EVENTS = ['scroll', 'mousemove']; // disable patch specified eventNames
/*
* in IE/Edge developer tools, the addEventListener will also be wrapped by zone.js
* with the following flag, it will bypass `zone.js` patch for IE/Edge
*/
// __Zone_enable_cross_context_check = true;
</script>
<!-- zone.js required by Angular -->
<script
src=
"node_modules/zone.js/dist/zone.js"
></script>
<!-- application polyfills -->
<meta
name=
"viewport"
content=
"width=device-width, initial-scale=1"
>
<link
rel=
"icon"
type=
"image/x-icon"
href=
"favicon.ico"
>
<script
src=
"assets/map_load.js"
></script>
...
...
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