You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
87 lines
5.5 KiB
JavaScript
87 lines
5.5 KiB
JavaScript
define(function (require, exports, module) {
|
|
function e() {
|
|
this.m_aChannelList = [], this.m_aWndList = [], this.m_iAnalogChNum = 0, this.m_iDigitalChNum = 0, this.m_iZeroChanNum = 0, this.m_oXmlAnalogChList = null, this.m_oXmlDigitalChList = null, this.m_oXmlDigitalChStatusList = null, this.m_oXmlZeroChannel = null, this.m_oXmlImageInfo = null, this.m_iWndIndex = 0, this.m_iStreamType = 0, this.m_iWndSplitMode = 4, this.m_iWndSizeMode = 4, this.m_iPluginType = 4, this.m_oWndParams = {
|
|
bHasWndPlay: !1,
|
|
bHasWndRecord: !1,
|
|
bTalking: !1,
|
|
iSoundWndIndex: -1
|
|
}, this.m_iMaxWndNum = 16, this.m_oLoaded = {bChannel: !1, bSearch: !1, bTimebar: !1, bPlugin: !1}, this.init()
|
|
}
|
|
|
|
var a, t, n;
|
|
a = require("isapi/device"), t = require("utils"), n = require("common"), e.prototype = {
|
|
getAnalogChList: function () {
|
|
var e = this;
|
|
e.m_oXmlAnalogChList = a.getChannel(a.m_oChannelType.ANALOG), e.m_iAnalogChNum = $(e.m_oXmlAnalogChList).find("VideoInputChannel").length
|
|
}, getDigitalChList: function () {
|
|
var e = this;
|
|
e.m_oXmlDigitalChList = a.getChannel(a.m_oChannelType.DIGITAL), e.m_iDigitalChNum = $(e.m_oXmlDigitalChList).find("InputProxyChannel").length
|
|
}, getDigitalChStatusList: function () {
|
|
var e = this;
|
|
e.m_oXmlDigitalChStatusList = a.getChannelStatus()
|
|
}, getZeroChannelList: function () {
|
|
var e = this;
|
|
e.m_iZeroChanNum = 0, e.m_oXmlZeroChannel = a.getChannel(a.m_oChannelType.ZERO), $.each($(e.m_oXmlZeroChannel).find("ZeroVideoChannel"), function () {
|
|
t.nodeValue(this, "enabled", "b") && e.m_iZeroChanNum++
|
|
})
|
|
}, getImageInfo: function () {
|
|
var e = this;
|
|
e.m_oXmlImageInfo = a.getImageInfo()
|
|
}, init: function () {
|
|
var e = this, a = null, i = null;
|
|
e.getAnalogChList(), n.m_bAnonymous || (e.getDigitalChList(), e.getDigitalChStatusList(), e.getZeroChannelList(), e.getImageInfo());
|
|
for (var o, r, s, l, d, c = 0; e.m_iAnalogChNum + e.m_iDigitalChNum + e.m_iZeroChanNum > c; ++c) e.m_iAnalogChNum > c ? (a = $(e.m_oXmlAnalogChList).find("VideoInputChannel").eq(c), o = parseInt(a.find("id").eq(0).text(), 10), r = a.find("name").eq(0).text() || "Channel " + a.find("id").eq(0).text(), s = "analog", l = "" == t.nodeValue(a, "videoInputEnabled") || "true" == t.nodeValue(a, "videoInputEnabled") ? !0 : !1, d = t.nodeValue(a, "videoFormat") || "PAL") : e.m_iAnalogChNum + e.m_iDigitalChNum > c ? (a = $(e.m_oXmlDigitalChList).find("InputProxyChannel").eq(c - e.m_iAnalogChNum), i = $(e.m_oXmlDigitalChStatusList).find("InputProxyChannelStatus").eq(c - e.m_iAnalogChNum), o = parseInt(a.find("id").eq(0).text(), 10), r = a.find("name").eq(0).text() || "Channel " + a.find("id").eq(0).text(), s = "digital", l = "true" == t.nodeValue(i, "online") ? !0 : !1) : (a = $(e.m_oXmlZeroChannel).find("ZeroVideoChannel").eq(c - e.m_iAnalogChNum - e.m_iDigitalChNum), o = parseInt(a.find("id").eq(0).text(), 10), r = 9 >= o ? "ZeroChannel 0" + o : "ZeroChannel " + o, s = "zero", l = !0), e.m_aChannelList[c] = {
|
|
iId: o,
|
|
szName: r,
|
|
bPlay: !1,
|
|
bRecord: !1,
|
|
iWndPlayIndex: -1,
|
|
iStreamType: e.m_iStreamType,
|
|
szType: s,
|
|
bOnline: l,
|
|
szVideoFormat: d || "PAL"
|
|
};
|
|
for (var c = 0; e.m_iMaxWndNum > c; ++c) e.m_aWndList[c] = {
|
|
iChannelId: -1,
|
|
iChannelPlayIndex: -1,
|
|
bPlay: !1,
|
|
bPause: !1,
|
|
iSpeed: 1,
|
|
bReversePlay: !1,
|
|
bTranscoding: !1,
|
|
bRecord: !1,
|
|
bFrame: !1,
|
|
bEzoom: !1,
|
|
bRegionExposure: !1,
|
|
bRegionFocus: !1,
|
|
b3DZoom: !1,
|
|
bManualTrack: !1,
|
|
bAutoPan: !1,
|
|
bPTZCtrl: !1,
|
|
bManualTrackEvidence: !1
|
|
};
|
|
var m, u = e.m_aChannelList;
|
|
$(e.m_oXmlImageInfo).find("ImageChannel").each(function () {
|
|
o = t.nodeValue(this, "id", "i"), m = t.nodeValue(this, "corridor enabled", "b"), $.each(u, function () {
|
|
return o === this.iId ? (this.bCorridor = m, !1) : void 0
|
|
})
|
|
})
|
|
}, getChannelByChannelId: function (e) {
|
|
var a = this, t = null;
|
|
return $.each(a.m_aChannelList, function () {
|
|
return this.iId == e ? (t = this, !1) : void 0
|
|
}), t
|
|
}, setChannelByChannelId: function (e, a) {
|
|
var t = this, n = null;
|
|
return $.each(t.m_aChannelList, function () {
|
|
return this.iId == e ? (n = this, !1) : void 0
|
|
}), n && $.extend(n, a), n
|
|
}, disableEzoom: function (e, a) {
|
|
var t = this, n = t.m_aWndList[t.m_iWndIndex];
|
|
(n.bEzoom || n.bRegionExposure || n.bRegionFocus || n.bManualTrack || n.b3DZoom || n.bManualTrackEvidence) && 0 === e.disableEzoom(t.m_iWndIndex) && (n.bEzoom = !1, n.bRegionExposure = !1, n.bRegionFocus = !1, n.bManualTrack = !1, n.b3DZoom = !1, n.bManualTrackEvidence = !1, a && (a.bManualTrack = !1, a.b3DZoom = !1, a.bManualTrackEvidence = !1))
|
|
}, isSingleChannel: function () {
|
|
var e = this;
|
|
return 1 == e.m_iAnalogChNum && !a.m_oDeviceCapa.bSupportDigitalChan
|
|
}
|
|
}, module.exports = new e
|
|
}); |