webVideoCtrl.js 155 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290
  1. !function (e) {
  2. if (!e.WebVideoCtrl) {
  3. var t = function () {
  4. function t() {
  5. this.id = this.createUUID()
  6. }
  7. var r = "100%", s = "100%", o = "", i = "", a = {
  8. szContainerID: "",
  9. szColorProperty: "",
  10. szOcxClassId: "clsid:FDF0038A-CF64-4634-81AB-80F0A7946D6C",
  11. szMimeTypes: "application/webvideo-plugin-kit",
  12. szBasePath: "",
  13. iWndowType: 1,
  14. iPlayMode: 2,
  15. bWndFull: !0,
  16. iPackageType: 2,
  17. bDebugMode: !1,
  18. bNoPlugin: !0,
  19. cbSelWnd: null,
  20. cbDoubleClickWnd: null,
  21. cbEvent: null,
  22. cbRemoteConfig: null,
  23. cbInitPluginComplete: null
  24. }, c = null, u = 0, l = !1, d = [], p = [], P = null, h = null, I = null, f = null, m = this, C = null,
  25. S = 1, v = 2, y = 200, g = 0, x = 1, D = 2, z = 3, T = 4, b = 5, A = 6, M = 0, R = 2, L = 3, q = 21,
  26. G = -1, W = 0, X = "IPCamera", w = "IPDome", H = "IPZoom",
  27. k = "<?xml version='1.0' encoding='utf-8'?><FileVersion><Platform name='win32'><npWebVideoKitPlugin.dll>3,0,6,2</npWebVideoKitPlugin.dll><WebVideoKitActiveX.ocx>3,0,6,2</WebVideoKitActiveX.ocx><PlayCtrl.dll>7,3,3,61</PlayCtrl.dll><StreamTransClient.dll>1,1,3,6</StreamTransClient.dll><SystemTransform.dll>2,5,2,8</SystemTransform.dll><NetStream.dll>1,0,5,59</NetStream.dll></Platform></FileVersion>";
  28. e.GetSelectWndInfo = function (e) {
  29. if (re()) {
  30. u = e;
  31. var t = [];
  32. t.push("<RealPlayInfo>"), t.push("<SelectWnd>" + e + "</SelectWnd>"), t.push("</RealPlayInfo>"), a.cbSelWnd && a.cbSelWnd(f.loadXML(t.join("")))
  33. } else {
  34. var r = f.loadXML(e);
  35. if (n.$XML(r).find("SelectWnd", !0).length > 0) {
  36. u = parseInt(n.$XML(r).find("SelectWnd").eq(0).text(), 10), null === C && U();
  37. var t = [];
  38. t.push("<RealPlayInfo>"), t.push("<SelectWnd>" + u + "</SelectWnd>"), t.push("</RealPlayInfo>"), a.cbSelWnd && a.cbSelWnd(f.loadXML(t.join("")))
  39. } else if (n.$XML(r).find("DoubleClickWnd", !0).length > 0) {
  40. var s = parseInt(n.$XML(r).find("DoubleClickWnd").eq(0).text(), 10);
  41. l = "0" === n.$XML(r).find("IsFullScreen").eq(0).text(), a.cbDoubleClickWnd && a.cbDoubleClickWnd(s, l)
  42. }
  43. }
  44. }, e.WindowDblClick = function (e) {
  45. l = e, a.cbDoubleClickWnd && a.cbDoubleClickWnd(u, l)
  46. }, e.ZoomInfoCallback = function (e) {
  47. var t = m.findWndIndexByIndex(u);
  48. if (-1 != t) {
  49. var n = p[t];
  50. if (t = m.findDeviceIndexByIP(n.szDeviceIdentify), -1 != t) {
  51. var r = d[t];
  52. r.oProtocolInc.set3DZoom(r, n, e, {
  53. success: function (e) {
  54. }, error: function () {
  55. }
  56. })
  57. }
  58. }
  59. }, e.PluginEventHandler = function (e, t, n) {
  60. re() ? a.cbEvent && a.cbEvent(n, t, "") : (_("插件事件:PluginEventHandler iEventType:%s iParam1: %s, iParam2: %s", e, t, n), M == e || R == e ? m.I_Stop(t) : q == e ? m.I_StopRecord(t) : L == e && m.I_StopVoiceTalk(), a.cbEvent && a.cbEvent(e, t, n))
  61. }, e.GetHttpInfo = function (e, t, n) {
  62. _("http响应返回:http状态:%s, http数据:%s", e, t), ue.prototype.processCallback(e, t)
  63. }, e.RemoteConfigInfo = function (e) {
  64. a.cbRemoteConfig && a.cbRemoteConfig(e)
  65. }, e.KeyBoardEventInfo = function (e) {
  66. 100 === parseInt(e, 10) && (l = !1, a.cbDoubleClickWnd && a.cbDoubleClickWnd(u, l))
  67. };
  68. var _ = function () {
  69. if (a.bDebugMode) {
  70. var e = E(arguments);
  71. P._alert(e)
  72. }
  73. }, E = function () {
  74. for (var e = arguments[0], t = 1; t < arguments.length; t++) e = e.replace("%s", arguments[t]);
  75. return e
  76. }, Z = function (e) {
  77. var t = e.indexOf(":");
  78. return t > -1 ? e.substring(0, t) : e
  79. }, B = function (e) {
  80. return "undefined" == typeof e
  81. }, N = function (e) {
  82. return "[object Object]" === Object.prototype.toString.call(e)
  83. }, F = function () {
  84. var e = "";
  85. if (f.browser().msie) e = "<object classid='" + a.szOcxClassId + "' codebase='' standby='Waiting...' id='" + o + "' width='" + r + "' height='" + s + "' align='center' ><param name='wndtype' value='" + a.iWndowType + "'><param name='playmode' value='" + a.iPlayMode + "'><param name='colors' value='" + a.szColorProperty + "'></object>"; else for (var t = navigator.mimeTypes.length, n = 0; t > n; n++) navigator.mimeTypes[n].type.toLowerCase() == a.szMimeTypes && (e = "<embed align='center' type='" + a.szMimeTypes + "' width='" + r + "' height='" + s + "' name='" + i + "' wndtype='" + a.iWndowType + "' playmode='" + a.iPlayMode + "' colors='" + a.szColorProperty + "'>");
  86. return e
  87. }, U = function () {
  88. if (!re() && null !== c) {
  89. var e = c.HWP_GetLocalConfig();
  90. C = f.loadXML(e)
  91. }
  92. }, V = function (e) {
  93. m.I_GetDeviceInfo(e.szIP, {
  94. success: function (t) {
  95. e.szDeviceType = n.$XML(t).find("deviceType").eq(0).text()
  96. }
  97. }), m.I_GetAnalogChannelInfo(e.szIP, {
  98. success: function (t) {
  99. e.iAnalogChannelNum = n.$XML(t).find("VideoInputChannel", !0).length
  100. }
  101. }), m.I_GetAudioInfo(e.szIP, {
  102. success: function (t) {
  103. var r = n.$XML(t).find("audioCompressionType", !0);
  104. if (r.length > 0) {
  105. var s = n.$XML(r).eq(0).text(), o = 0;
  106. "G.711ulaw" == s ? o = 1 : "G.711alaw" == s ? o = 2 : "G.726" == s ? o = 3 : "MP2L2" == s || "MPEL2" == s ? o = 4 : "G.722.1" == s ? o = 0 : "AAC" == s ? o = 5 : "PCM" == s && (o = 6), e.iAudioType = o
  107. }
  108. "" !== n.$XML(t).find("audioBitRate").eq(0).text() ? e.m_iAudioBitRate = 1e3 * parseInt(n.$XML(t).find("audioBitRate").eq(0).text(), 10) : e.m_iAudioBitRate = 0, "" !== n.$XML(t).find("audioSamplingRate").eq(0).text() ? e.m_iAudioSamplingRate = 1e3 * parseInt(n.$XML(t).find("audioSamplingRate").eq(0).text(), 10) : e.m_iAudioSamplingRate = 0
  109. }
  110. })
  111. }, j = function (e) {
  112. e.bSupportWebsocket = !1, e.bSupportSubStreamPlayback = !1, e.oProtocolInc.getSystemCapa(e, {
  113. success: function (t) {
  114. var r = n.$XML(t).find("NetworkCap").eq(0).find("isSupportWebsocket", !0);
  115. r.length > 0 && (e.bSupportWebsocket = "true" === n.$XML(t).find("NetworkCap").eq(0).find("isSupportWebsocket").eq(0).text()), r = n.$XML(t).find("RacmCap").eq(0).find("isSupportMainAndSubRecord", !0), r.length > 0 && (e.bSupportSubStreamPlayback = "true" === n.$XML(t).find("RacmCap").eq(0).find("isSupportMainAndSubRecord").eq(0).text())
  116. }
  117. })
  118. }, O = function () {
  119. var e = a.bWndFull ? 1 : 0;
  120. c.HWP_SetCanFullScreen(e), c.HWP_SetPackageType(a.iPackageType)
  121. }, J = function (e) {
  122. var t = -1, n = -1, r = -1, s = null;
  123. if (ee(e)) s = K(e), t = s.iRtspPort, r = s.iDevicePort; else {
  124. for (var o = Q(e), i = !1, a = 0; a < o.length; a++) if (o[a].ipv4 == e.szIP || o[a].ipv6 == e.szIP) {
  125. i = !0;
  126. break
  127. }
  128. i ? s = K(e) : (s = Y(e), -1 == s.iRtspPort && -1 == s.iDevicePort && (s = K(e))), t = s.iRtspPort, n = s.iHttpPort, r = s.iDevicePort
  129. }
  130. return s
  131. }, K = function (e) {
  132. var t = -1, r = -1, s = -1;
  133. return e.oProtocolInc.getPortInfo(e, {
  134. async: !1, success: function (e) {
  135. var o = n.$XML(e).find("AdminAccessProtocol", !0);
  136. t = 554;
  137. for (var i = 0, a = o.length; a > i; i++) "rtsp" === n.$XML(o).eq(i).find("protocol").eq(0).text().toLowerCase() && (t = parseInt(n.$XML(o).eq(i).find("portNo").eq(0).text(), 10)), "http" === n.$XML(o).eq(i).find("protocol").eq(0).text().toLowerCase() && (r = parseInt(n.$XML(o).eq(i).find("portNo").eq(0).text(), 10)), "dev_manage" === n.$XML(o).eq(i).find("protocol").eq(0).text().toLowerCase() && (s = parseInt(n.$XML(o).eq(i).find("portNo").eq(0).text(), 10))
  138. }, error: function () {
  139. t = -1, r = -1, s = -1
  140. }
  141. }), {iRtspPort: t, iHttpPort: r, iDevicePort: s}
  142. }, Y = function (e) {
  143. var t = -1, r = -1, s = -1;
  144. return e.oProtocolInc.getUPnPPortStatus(e, {
  145. async: !1, success: function (e) {
  146. for (var o = n.$XML(e).find("portStatus", !0), i = 0, a = o.length; a > i; i++) "rtsp" == n.$XML(o).eq(i).find("internalPort").eq(0).text().toLowerCase() && (t = parseInt(n.$XML(o).eq(i).find("externalPort").eq(0).text(), 10)), "http" == n.$XML(o).eq(i).find("internalPort").eq(0).text().toLowerCase() && (r = parseInt(n.$XML(o).eq(i).find("externalPort").eq(0).text(), 10)), "admin" == n.$XML(o).eq(i).find("internalPort").eq(0).text().toLowerCase() && (s = parseInt(n.$XML(o).eq(i).find("externalPort").eq(0).text(), 10))
  147. }, error: function () {
  148. t = -1, r = -1, s = -1
  149. }
  150. }), {iRtspPort: t, iHttpPort: r, iDevicePort: s}
  151. }, Q = function (e) {
  152. var t = [];
  153. return e.oProtocolInc.getNetworkBond(e, {
  154. async: !1, success: function (r) {
  155. "true" == n.$XML(r).find("enabled").eq(0).text() ? t.push({
  156. ipv4: n.$XML(r).find("ipAddress").eq(0).text(),
  157. ipv6: n.$XML(r).find("ipv6Address").eq(0).text()
  158. }) : e.oProtocolInc.getNetworkInterface(e, {
  159. async: !1, success: function (e) {
  160. for (var r = n.$XML(e).find("NetworkInterface", !0), s = 0, o = r.length; o > s; s++) {
  161. t.push({
  162. ipv4: n.$XML(e).find("ipAddress").eq(0).text(),
  163. ipv6: n.$XML(e).find("ipv6Address").eq(0).text()
  164. });
  165. break
  166. }
  167. }, error: function () {
  168. }
  169. })
  170. }, error: function () {
  171. e.oProtocolInc.getNetworkInterface(e, {
  172. async: !1, success: function (e) {
  173. for (var r = n.$XML(e).find("NetworkInterface", !0), s = 0, o = r.length; o > s; s++) {
  174. t.push({
  175. ipv4: n.$XML(e).find("ipAddress").eq(0).text(),
  176. ipv6: n.$XML(e).find("ipv6Address").eq(0).text()
  177. });
  178. break
  179. }
  180. }, error: function () {
  181. }
  182. })
  183. }
  184. }), t
  185. }, ee = function (e) {
  186. var t = !1;
  187. return e.oProtocolInc.getPPPoEStatus(e, {
  188. async: !1, success: function (e) {
  189. t = n.$XML(e).find("ipAddress", !0).length > 0 ? !0 : n.$XML(e).find("ipv6Address", !0).length > 0
  190. }, error: function () {
  191. t = !1
  192. }
  193. }), t
  194. }, te = function (e) {
  195. e.oStreamCapa.bObtained || e.oProtocolInc instanceof le && e.oProtocolInc.getSDKCapa(e, {
  196. async: !1,
  197. success: function (t) {
  198. e.oStreamCapa.bObtained = !0, e.oStreamCapa.bSupportShttpPlay = "true" === n.$XML(t).find("isSupportHttpPlay").eq(0).text(), e.oStreamCapa.bSupportShttpPlayback = "true" === n.$XML(t).find("isSupportHttpPlayback").eq(0).text(), e.oStreamCapa.bSupportShttpsPlay = "true" === n.$XML(t).find("isSupportHttpsPlay").eq(0).text(), e.oStreamCapa.bSupportShttpsPlayback = "true" === n.$XML(t).find("isSupportHttpsPlayback").eq(0).text(), e.oStreamCapa.bSupportShttpPlaybackTransCode = "true" === n.$XML(t).find("isSupportHttpTransCodePlayback").eq(0).text(), e.oStreamCapa.bSupportShttpsPlaybackTransCode = "true" === n.$XML(t).find("isSupportHttpsTransCodePlayback").eq(0).text(), n.$XML(t).find("ipChanBase", !0).length > 0 && (e.oStreamCapa.iIpChanBase = parseInt(n.$XML(t).find("ipChanBase").eq(0).text(), 10))
  199. },
  200. error: function () {
  201. e.oStreamCapa.bObtained = !0
  202. }
  203. })
  204. }, ne = function (e) {
  205. var t = {TransFrameRate: "", TransResolution: "", TransBitrate: ""};
  206. if (f.extend(t, e), "" == t.TransFrameRate || "" == t.TransResolution || "" == t.TransBitrate) return "";
  207. var n = [];
  208. return n.push("<?xml version='1.0' encoding='UTF-8'?>"), n.push("<CompressionInfo>"), n.push("<TransFrameRate>" + t.TransFrameRate + "</TransFrameRate>"), n.push("<TransResolution>" + t.TransResolution + "</TransResolution>"), n.push("<TransBitrate>" + t.TransBitrate + "</TransBitrate>"), n.push("</CompressionInfo>"), n.join("")
  209. }, re = function () {
  210. if (a.bNoPlugin) {
  211. var e = f.browser();
  212. return !!(e.chrome && parseInt(e.version, 10) > 45 || e.mozilla && parseInt(e.version, 10) > 52)
  213. }
  214. return !1
  215. }, se = function (e) {
  216. var t = location.hostname, n = location.port || "80";
  217. return /^(http|https):\/\/([^\/]+)(.+)$/.test(e) && (e = e.replace(RegExp.$2, t + ":" + n)), f.cookie("webVideoCtrlProxy", RegExp.$2, {raw: !0}), e
  218. }, oe = function () {
  219. var e = "<ResponseStatus>";
  220. return e += "<requestURL></requestURL>", e += "<statusCode>4</statusCode>", e += "<statusString>Invalid Operation</statusString>", e += "<subStatusCode>notSupport</subStatusCode>", e += "</ResponseStatus>", f.loadXML(e)
  221. };
  222. this.I_InitPlugin = function (t, n, o) {
  223. if (r = t, s = n, f.extend(a, o), re()) {
  224. var i = f.getDirName();
  225. i && ("object" == typeof exports && "undefined" != typeof module || ("function" == typeof define && define.amd ? require([i + "/jsPlugin-1.0.0.min.js"], function (t) {
  226. e.JSPlugin = t.JSPlugin, o.cbInitPluginComplete && o.cbInitPluginComplete()
  227. }) : f.loadScript(i + "/jsPlugin-1.0.0.min.js", function () {
  228. o.cbInitPluginComplete && o.cbInitPluginComplete()
  229. }))), e.addEventListener("resize", function () {
  230. null !== c && c.JS_Resize(r, s)
  231. }), B(document.fullScreen) ? B(document.webkitIsFullScreen) ? B(document.mozFullScreen) || document.addEventListener("mozfullscreenchange", function (t) {
  232. var n = document.fullscreen || document.webkitIsFullScreen || document.mozFullScreen || !1;
  233. l && !n && e.KeyBoardEventInfo(100)
  234. }) : document.addEventListener("webkitfullscreenchange", function (t) {
  235. var n = document.fullscreen || document.webkitIsFullScreen || document.mozFullScreen || !1;
  236. l && !n && e.KeyBoardEventInfo(100)
  237. }) : document.addEventListener("fullscreenchange", function (t) {
  238. var n = document.fullscreen || document.webkitIsFullScreen || document.mozFullScreen || !1;
  239. l && !n && e.KeyBoardEventInfo(100)
  240. }), e.addEventListener("unload", function () {
  241. null !== c && c.JS_DestroyWorker()
  242. })
  243. } else o.cbInitPluginComplete && o.cbInitPluginComplete()
  244. }, this.I_InsertOBJECTPlugin = function (t) {
  245. if (B(t) || (a.szContainerID = t), null == document.getElementById(a.szContainerID)) return -1;
  246. if (null != document.getElementById(o) || 0 != document.getElementsByName(o).length) return -1;
  247. if (re()) {
  248. var n = {
  249. szId: t,
  250. iType: 1,
  251. iWidth: r,
  252. iHeight: s,
  253. iMaxSplit: 4,
  254. iCurrentSplit: a.iWndowType,
  255. szBasePath: f.getDirName()
  256. }, u = a.szColorProperty;
  257. if ("" != u) {
  258. for (var l = {}, d = u.split(";"), p = "", P = 0, h = d.length; h > P; P++) p = d[P], p.indexOf("sub-background") > -1 ? l.background = p.split(":")[1] : p.indexOf("sub-border-select") > -1 ? l.borderSelect = p.split(":")[1] : p.indexOf("sub-border") > -1 && (l.border = p.split(":")[1]);
  259. n.oStyle = l
  260. }
  261. c = new JSPlugin(n)
  262. } else document.getElementById(a.szContainerID).innerHTML = F(), c = f.browser().msie ? document.getElementById(o) : document.getElementsByName(i)[0];
  263. return null == c && null == c.object ? -1 : ("object" == typeof e.attachEvent && f.browser().msie && (c.attachEvent("GetSelectWndInfo", GetSelectWndInfo), c.attachEvent("ZoomInfoCallback", ZoomInfoCallback), c.attachEvent("GetHttpInfo", GetHttpInfo), c.attachEvent("PluginEventHandler", PluginEventHandler), c.attachEvent("RemoteConfigInfo", RemoteConfigInfo), c.attachEvent("KeyBoardEventInfo", KeyBoardEventInfo)), U(), 0)
  264. }, this.I_WriteOBJECT_XHTML = function () {
  265. return re() ? -1 : (document.writeln(F()), c = f.browser().msie ? document.getElementById(o) : document.getElementsByName(i)[0], null == c && null == c.object ? -1 : ("object" == typeof e.attachEvent && f.browser().msie && (c.attachEvent("GetSelectWndInfo", GetSelectWndInfo), c.attachEvent("ZoomInfoCallback", ZoomInfoCallback), c.attachEvent("GetHttpInfo", GetHttpInfo), c.attachEvent("PluginEventHandler", PluginEventHandler), c.attachEvent("RemoteConfigInfo", RemoteConfigInfo), c.attachEvent("KeyBoardEventInfo", KeyBoardEventInfo)), U(), 0))
  266. }, this.I_OpenFileDlg = function (e) {
  267. var t = "";
  268. if (re()) return t;
  269. if (t = c.HWP_OpenFileBrowser(e, ""), null == t) return "";
  270. if (1 == e) {
  271. if (t.length > 100) return -1
  272. } else if (t.length > 130) return -1;
  273. return t
  274. }, this.I_GetLocalCfg = function () {
  275. var e = null;
  276. if (re()) return e;
  277. var t = c.HWP_GetLocalConfig(), r = [];
  278. return C = f.loadXML(t), r.push("<LocalConfigInfo>"), r.push("<ProtocolType>" + n.$XML(C).find("ProtocolType").eq(0).text() + "</ProtocolType>"), r.push("<PackgeSize>" + n.$XML(C).find("PackgeSize").eq(0).text() + "</PackgeSize>"), r.push("<PlayWndType>" + n.$XML(C).find("PlayWndType").eq(0).text() + "</PlayWndType>"), r.push("<BuffNumberType>" + n.$XML(C).find("BuffNumberType").eq(0).text() + "</BuffNumberType>"), r.push("<RecordPath>" + n.$XML(C).find("RecordPath").eq(0).text() + "</RecordPath>"), r.push("<CapturePath>" + n.$XML(C).find("CapturePath").eq(0).text() + "</CapturePath>"), r.push("<PlaybackFilePath>" + n.$XML(C).find("PlaybackFilePath").eq(0).text() + "</PlaybackFilePath>"), r.push("<PlaybackPicPath>" + n.$XML(C).find("PlaybackPicPath").eq(0).text() + "</PlaybackPicPath>"), r.push("<DeviceCapturePath>" + n.$XML(C).find("DeviceCapturePath").eq(0).text() + "</DeviceCapturePath>"), r.push("<DownloadPath>" + n.$XML(C).find("DownloadPath").eq(0).text() + "</DownloadPath>"), r.push("<IVSMode>" + n.$XML(C).find("IVSMode").eq(0).text() + "</IVSMode>"), r.push("<CaptureFileFormat>" + n.$XML(C).find("CaptureFileFormat").eq(0).text() + "</CaptureFileFormat>"), r.push("</LocalConfigInfo>"), e = f.loadXML(r.join(""))
  279. }, this.I_SetLocalCfg = function (e) {
  280. if (re()) return -1;
  281. var t = f.loadXML(e), r = !1;
  282. return n.$XML(C).find("ProtocolType").eq(0).text(n.$XML(t).find("ProtocolType").eq(0).text()), n.$XML(C).find("PackgeSize").eq(0).text(n.$XML(t).find("PackgeSize").eq(0).text()), n.$XML(C).find("PlayWndType").eq(0).text(n.$XML(t).find("PlayWndType").eq(0).text()), n.$XML(C).find("BuffNumberType").eq(0).text(n.$XML(t).find("BuffNumberType").eq(0).text()), n.$XML(C).find("RecordPath").eq(0).text(n.$XML(t).find("RecordPath").eq(0).text()), n.$XML(C).find("CapturePath").eq(0).text(n.$XML(t).find("CapturePath").eq(0).text()), n.$XML(C).find("PlaybackFilePath").eq(0).text(n.$XML(t).find("PlaybackFilePath").eq(0).text()), n.$XML(C).find("DeviceCapturePath").eq(0).text(n.$XML(t).find("DeviceCapturePath").eq(0).text()), n.$XML(C).find("PlaybackPicPath").eq(0).text(n.$XML(t).find("PlaybackPicPath").eq(0).text()), n.$XML(C).find("DownloadPath").eq(0).text(n.$XML(t).find("DownloadPath").eq(0).text()), n.$XML(C).find("IVSMode").eq(0).text(n.$XML(t).find("IVSMode").eq(0).text()), n.$XML(C).find("CaptureFileFormat").eq(0).text(n.$XML(t).find("CaptureFileFormat").eq(0).text()), r = c.HWP_SetLocalConfig(f.toXMLStr(C)), r ? 0 : -1
  283. };
  284. var ie = function (e, t, n, r, s, o, i) {
  285. var a = {protocol: t, success: null, error: null};
  286. f.extend(a, i), f.extend(a, {
  287. success: function (a) {
  288. var c = new ae;
  289. c.szIP = e, 2 == t ? (c.szHttpProtocol = "https://", c.iHttpsPort = n) : (c.szHttpProtocol = "http://", c.iHttpPort = n), c.iCGIPort = n, c.szDeviceIdentify = e + "_" + n, c.szAuth = r, c.iDeviceProtocol = s, c.oProtocolInc = o, d.push(c), _("使用%s协议登录成功", s), V(c), O(), j(c), i.success && i.success(a)
  290. }, error: function (e, t) {
  291. i.error && i.error(e, t)
  292. }
  293. }), o.login(e, n, r, a)
  294. };
  295. this.I_Login = function (t, r, s, o, i, a) {
  296. var c = t + "_" + s, u = this.findDeviceIndexByIP(c);
  297. if (-1 != u) return _("设备已经登录过"), -1;
  298. var l = h, p = S;
  299. if (B(a.cgi) || (S == a.cgi ? (l = h, p = S) : (l = I, p = v)), re()) if (S == p) {
  300. var P = {success: null, error: null};
  301. f.extend(P, {
  302. success: function (c) {
  303. var u = {success: null, error: null};
  304. f.extend(u, {
  305. success: function (o) {
  306. var i = new ae;
  307. i.szIP = t, 2 == r ? (i.szHttpProtocol = "https://", i.iHttpsPort = s) : (i.szHttpProtocol = "http://", i.iHttpPort = s), i.iCGIPort = s, i.szDeviceIdentify = t + "_" + s, i.szAuth = n.$XML(o).find("sessionID").eq(0).text(), i.iDeviceProtocol = p, i.oProtocolInc = l, d.push(i), _("使用%s协议登录成功", p), V(i), j(i), i.sessionFailed = 0, i.sesstionTimer = setInterval(function () {
  308. l.sessionHeartbeat(i, function () {
  309. i.sessionFailed = 0
  310. }, function () {
  311. i.sessionFailed++, i.sessionFailed >= 5 && (clearInterval(i.sesstionTimer), e.PluginEventHandler(G, i.szDeviceIdentify))
  312. })
  313. }, 3e4), a.success && a.success(o)
  314. }, error: function (e, t) {
  315. a.error && a.error(e, t)
  316. }
  317. }), l.sessionLogin(t, r, s, o, i, c, u)
  318. }, error: function (e, t) {
  319. a.error && a.error(e, t)
  320. }
  321. }), l.getSessionCap(t, r, s, o, P)
  322. } else a.error && a.error(403, oe()); else {
  323. var m = "";
  324. if (S == p) {
  325. m = f.Base64.encode(":" + o + ":" + i);
  326. var P = {success: null, error: null};
  327. f.extend(P, a), f.extend(P, {
  328. error: function (e, n) {
  329. m = f.Base64.encode(o + ":" + i), p = S, l = h;
  330. var c = {success: null, error: null};
  331. f.extend(c, a), f.extend(c, {
  332. error: function () {
  333. if (!B(a.cgi)) return void (a.error && a.error(e, n));
  334. m = f.Base64.encode(":" + o + ":" + i), p = v, l = I;
  335. var c = {success: null, error: null};
  336. f.extend(c, a), f.extend(c, {
  337. error: function (e, n) {
  338. m = f.Base64.encode(o + ":" + i), p = v, l = I;
  339. var c = {success: null, error: null};
  340. f.extend(c, a), f.extend(c, {
  341. error: function () {
  342. a.error && a.error(e, n)
  343. }
  344. }), ie(t, r, s, m, p, l, c)
  345. }
  346. }), ie(t, r, s, m, p, l, c)
  347. }
  348. }), ie(t, r, s, m, p, l, c)
  349. }
  350. }), ie(t, r, s, m, p, l, P)
  351. } else {
  352. m = f.Base64.encode(":" + o + ":" + i), p = v, l = I;
  353. var P = {success: null, error: null};
  354. f.extend(P, a), f.extend(P, {
  355. error: function (e, n) {
  356. m = f.Base64.encode(o + ":" + i), p = v, l = I;
  357. var c = {success: null, error: null};
  358. f.extend(c, a), f.extend(c, {
  359. error: function () {
  360. a.error && a.error(e, n)
  361. }
  362. }), ie(t, r, s, m, p, l, c)
  363. }
  364. }), ie(t, r, s, m, p, l, P)
  365. }
  366. }
  367. }, this.I_Logout = function (e) {
  368. var t = this.findDeviceIndexByIP(e);
  369. if (-1 != t) {
  370. if (re()) {
  371. var n = d[t];
  372. clearInterval(n.sesstionTimer), n.oProtocolInc.sessionLogout(n, {})
  373. }
  374. return d.splice(t, 1), 0
  375. }
  376. return -1
  377. }, this.I_GetAudioInfo = function (e, t) {
  378. var n = this.findDeviceIndexByIP(e);
  379. if (-1 != n) {
  380. var r = d[n], s = {success: null, error: null};
  381. f.extend(s, t), r.oProtocolInc.getAudioInfo(r, s)
  382. }
  383. }, this.I_GetDeviceInfo = function (e, t) {
  384. var n = this.findDeviceIndexByIP(e);
  385. if (-1 != n) {
  386. var r = d[n], s = {success: null, error: null};
  387. f.extend(s, t), r.oProtocolInc.getDeviceInfo(r, s)
  388. }
  389. }, this.I_GetAnalogChannelInfo = function (e, t) {
  390. var n = this.findDeviceIndexByIP(e);
  391. if (-1 != n) {
  392. var r = d[n], s = {success: null, error: null};
  393. f.extend(s, t), r.oProtocolInc.getAnalogChannelInfo(r, s)
  394. }
  395. }, this.I_GetDigitalChannelInfo = function (e, t) {
  396. var n = this.findDeviceIndexByIP(e);
  397. if (-1 != n) {
  398. var r = d[n], s = {success: null, error: null};
  399. f.extend(s, t), r.oProtocolInc.getDigitalChannelInfo(r, s)
  400. }
  401. }, this.I_GetZeroChannelInfo = function (e, t) {
  402. var n = this.findDeviceIndexByIP(e);
  403. if (-1 != n) {
  404. var r = d[n], s = {success: null, error: null};
  405. f.extend(s, t), r.oProtocolInc.getZeroChannelInfo(r, s)
  406. }
  407. }, this.I_StartRealPlay = function (e, t) {
  408. var r = this.findDeviceIndexByIP(e), s = "", o = "", i = -1, a = 0, c = 0, l = !1,
  409. P = {iWndIndex: u, iStreamType: 1, iChannelID: 1, bZeroChannel: !1};
  410. if (f.extend(P, t), -1 != r) {
  411. te(d[r]);
  412. var h = d[r];
  413. if (re()) {
  414. if (!h.bSupportWebsocket) return void (t.error && t.error(403, oe()));
  415. s = h.oProtocolInc.CGI.startWsRealPlay, o = "ws://", B(P.iWSPort) ? h.iWSPort = 7681 : h.iWSPort = P.iWSPort, i = h.iWSPort, c = P.iStreamType, a = P.iChannelID <= h.iAnalogChannelNum ? P.iChannelID : h.oStreamCapa.iIpChanBase + parseInt(P.iChannelID, 10) - h.iAnalogChannelNum - 1, l = !0
  416. } else {
  417. var I = parseInt(n.$XML(C).find("ProtocolType").eq(0).text(), 10);
  418. I == W && h.oStreamCapa.bSupportShttpPlay ? (_("SHTTP RealPlay"), s = h.oProtocolInc.CGI.startShttpRealPlay, o = "http://", c = P.iStreamType - 1, a = P.iChannelID <= h.iAnalogChannelNum ? P.iChannelID : h.oStreamCapa.iIpChanBase + parseInt(P.iChannelID, 10) - h.iAnalogChannelNum - 1, l = !0, B(P.iPort) ? "https://" == h.szHttpProtocol ? (-1 == h.iHttpPort && (h.iHttpPort = J(h).iHttpPort), i = h.iHttpPort) : i = h.iCGIPort : (h.iHttpPort = P.iPort, i = P.iPort)) : (_("RTSP RealPlay"), s = h.oProtocolInc.CGI.startRealPlay, o = "rtsp://", c = P.iStreamType, a = P.iChannelID, B(P.iRtspPort) || (h.iRtspPort = P.iRtspPort), -1 == h.iRtspPort && (h.iRtspPort = J(h).iRtspPort), i = h.iRtspPort)
  419. }
  420. if (-1 == i) return _("获取端口号失败"), void (t.error && t.error());
  421. if (f.extend(P, {
  422. urlProtocol: o,
  423. cgi: s,
  424. iPort: i,
  425. iStreamType: c,
  426. iChannelID: a
  427. }), r = this.findWndIndexByIndex(P.iWndIndex), -1 == r) if (re()) h.oProtocolInc.startRealPlay(h, P).then(function () {
  428. r = this.findWndIndexByIndex(P.iWndIndex);
  429. var e = p[r];
  430. e.bShttpIPChannel = l, t.success && t.success()
  431. }, function () {
  432. t.error && t.error()
  433. }); else {
  434. var m = h.oProtocolInc.startRealPlay(h, P);
  435. if (0 == m) {
  436. r = this.findWndIndexByIndex(P.iWndIndex);
  437. var S = p[r];
  438. S.bShttpIPChannel = l, t.success && t.success()
  439. } else h.iRtspPort = -1, t.error && t.error()
  440. }
  441. } else t.error && t.error()
  442. }, this.I_Stop = function (e) {
  443. var t = {iWndIndex: u};
  444. N(e) ? f.extend(t, e) : B(e) || (t.iWndIndex = e);
  445. var n = this.findWndIndexByIndex(t.iWndIndex);
  446. if (-1 != n) {
  447. var r = p[n];
  448. if (r.bRecord && (re() || c.HWP_StopSave(r.iIndex)), r.bSound && (re() || c.HWP_CloseSound()), r.bEZoom && (re() || c.HWP_DisableZoom(r.iIndex)), re()) c.JS_Stop(t.iWndIndex).then(function () {
  449. p.splice(n, 1), t.success && t.success()
  450. }, function () {
  451. t.error && t.error()
  452. }); else {
  453. var s = c.HWP_Stop(t.iWndIndex);
  454. 0 == s ? (p.splice(n, 1), t.success && t.success()) : t.error && t.error()
  455. }
  456. } else t.error && t.error()
  457. }, this.I_OpenSound = function (e) {
  458. e = B(e) ? u : e;
  459. var t = this.findWndIndexByIndex(e), n = -1;
  460. if (-1 != t) {
  461. var r = p[t];
  462. r.bSound || (n = re() ? c.JS_OpenSound(e) : c.HWP_OpenSound(e), 0 == n && (r.bSound = !0))
  463. }
  464. return n
  465. }, this.I_CloseSound = function (e) {
  466. e = B(e) ? u : e;
  467. var t = this.findWndIndexByIndex(e), n = -1;
  468. if (-1 != t) {
  469. var r = p[t];
  470. r.bSound && (n = re() ? c.JS_CloseSound() : c.HWP_CloseSound(), 0 == n && (r.bSound = !1))
  471. }
  472. return n
  473. }, this.I_SetVolume = function (e, t) {
  474. var n = -1;
  475. if (e = parseInt(e, 10), isNaN(e)) return n;
  476. if (0 > e || e > 100) return n;
  477. t = B(t) ? u : t;
  478. var r = this.findWndIndexByIndex(t);
  479. return -1 != r && (re() ? (c.JS_SetVolume(t, e), n = 0) : n = c.HWP_SetVolume(t, e)), n
  480. }, this.I_CapturePic = function (e, t) {
  481. var n = {iWndIndex: u, bDateDir: !0};
  482. N(t) ? f.extend(n, t) : B(t) || (n.iWndIndex = t);
  483. var r = this.findWndIndexByIndex(n.iWndIndex), s = -1;
  484. if (-1 != r) if (re()) {
  485. var o = "JPEG";
  486. ".jpg" === e.slice(-4).toLowerCase() ? e = e.slice(0, -4) : ".jpeg" === e.slice(-5).toLowerCase() ? e = e.slice(0, -5) : ".bmp" === e.slice(-4).toLowerCase() && (e = e.slice(0, -4), o = "BMP"), s = c.JS_CapturePicture(n.iWndIndex, e, o)
  487. } else ".jpg" === e.slice(-4).toLowerCase() ? e = e.slice(0, -4) : ".jpeg" === e.slice(-5).toLowerCase() && (e = e.slice(0, -5)), s = c.HWP_CapturePicture(n.iWndIndex, e, n.bDateDir);
  488. return s
  489. }, this.I_StartRecord = function (e, t) {
  490. var n = {iWndIndex: u, bDateDir: !0};
  491. N(t) ? f.extend(n, t) : B(t) || (n.iWndIndex = t);
  492. var r = this.findWndIndexByIndex(n.iWndIndex);
  493. if (-1 != r) {
  494. var s = p[r];
  495. if (s.bRecord) n.error && n.error(); else if (re()) {
  496. var o = f.browser();
  497. o.chrome ? c.JS_StartSave(n.iWndIndex, e).then(function () {
  498. s.bRecord = !0, n.success && n.success()
  499. }, function () {
  500. n.error && n.error()
  501. }) : n.error && n.error()
  502. } else {
  503. var i = c.HWP_StartSave(n.iWndIndex, e, n.bDateDir);
  504. 0 == i ? (s.bRecord = !0, n.success && n.success()) : n.error && n.error()
  505. }
  506. } else n.error && n.error()
  507. }, this.I_StopRecord = function (e) {
  508. var t = {iWndIndex: u};
  509. N(e) ? f.extend(t, e) : B(e) || (t.iWndIndex = e);
  510. var n = this.findWndIndexByIndex(t.iWndIndex);
  511. if (-1 != n) {
  512. var r = p[n];
  513. if (r.bRecord) if (re()) {
  514. var s = f.browser();
  515. s.chrome ? c.JS_StopSave(t.iWndIndex).then(function () {
  516. r.bRecord = !1, t.success && t.success()
  517. }, function () {
  518. t.error && t.error()
  519. }) : t.error && t.error()
  520. } else {
  521. var o = c.HWP_StopSave(t.iWndIndex);
  522. 0 == o ? (r.bRecord = !1, t.success && t.success()) : t.error && t.error()
  523. } else t.error && t.error()
  524. } else t.error && t.error()
  525. }, this.I_StartVoiceTalk = function (e, t) {
  526. if (isNaN(parseInt(t, 10))) return -1;
  527. var n = this.findDeviceIndexByIP(e), r = -1;
  528. if (-1 != n) {
  529. var s = d[n];
  530. s.bVoiceTalk || (r = re() ? -1 : s.oProtocolInc.startVoiceTalk(s, t), 0 == r && (d[n].bVoiceTalk = !0))
  531. }
  532. return r
  533. }, this.I_StopVoiceTalk = function () {
  534. var e = -1;
  535. if (!re()) {
  536. e = c.HWP_StopVoiceTalk();
  537. for (var t = 0, n = d.length; n > t; t++) if (d[t].bVoiceTalk) {
  538. d[t].bVoiceTalk = !1;
  539. break
  540. }
  541. }
  542. return e
  543. }, this.I_PTZControl = function (e, t, n) {
  544. var r = {iWndIndex: u, iPTZIndex: e, iPTZSpeed: 4};
  545. f.extend(r, n), f.extend(r, {async: !1});
  546. var s = this.findWndIndexByIndex(r.iWndIndex);
  547. if (-1 != s) {
  548. var o = p[s];
  549. if (s = this.findDeviceIndexByIP(o.szIP), -1 != s) {
  550. var i = d[s];
  551. 9 == e ? i.oProtocolInc.ptzAutoControl(i, t, o, r) : i.oProtocolInc.ptzControl(i, t, o, r)
  552. }
  553. }
  554. }, this.I_EnableEZoom = function (e) {
  555. e = B(e) ? u : e;
  556. var t = this.findWndIndexByIndex(e), n = -1;
  557. if (-1 != t) {
  558. var r = p[t];
  559. r.bEZoom || (n = re() ? c.JS_EnableZoom(e) : c.HWP_EnableZoom(e, 0), 0 == n && (r.bEZoom = !0))
  560. }
  561. return n
  562. }, this.I_DisableEZoom = function (e) {
  563. e = B(e) ? u : e;
  564. var t = this.findWndIndexByIndex(e), n = -1;
  565. if (-1 != t) {
  566. var r = p[t];
  567. r.bEZoom && (re() ? n = c.JS_DisableZoom(e) : (c.HWP_DisableZoom(e), n = 0), 0 == n && (r.bEZoom = !1))
  568. }
  569. return n
  570. }, this.I_Enable3DZoom = function (e) {
  571. e = B(e) ? u : e;
  572. var t = this.findWndIndexByIndex(e), n = -1;
  573. if (-1 != t) {
  574. var r = p[t];
  575. r.b3DZoom || (n = re() ? -1 : c.HWP_EnableZoom(e, 1), 0 == n && (r.b3DZoom = !0))
  576. }
  577. return n
  578. }, this.I_Disable3DZoom = function (e) {
  579. e = B(e) ? u : e;
  580. var t = this.findWndIndexByIndex(e), n = -1;
  581. if (-1 != t) {
  582. var r = p[t];
  583. r.b3DZoom && (re() ? n = -1 : (c.HWP_DisableZoom(e), n = 0), 0 == n && (r.b3DZoom = !1))
  584. }
  585. return n
  586. }, this.I_FullScreen = function (e) {
  587. re() ? c.JS_FullScreenDisplay(e) : c.HWP_FullScreenDisplay(e)
  588. }, this.I_SetPreset = function (e, t) {
  589. var n = {iWndIndex: u, iPresetID: e};
  590. f.extend(n, t);
  591. var r = this.findWndIndexByIndex(n.iWndIndex);
  592. if (-1 != r) {
  593. var s = p[r];
  594. if (r = this.findDeviceIndexByIP(s.szIP), -1 != r) {
  595. var o = d[r];
  596. o.oProtocolInc.setPreset(o, s, n)
  597. }
  598. }
  599. }, this.I_GoPreset = function (e, t) {
  600. var n = {iWndIndex: u, iPresetID: e};
  601. f.extend(n, t);
  602. var r = this.findWndIndexByIndex(n.iWndIndex);
  603. if (-1 != r) {
  604. var s = p[r];
  605. if (r = this.findDeviceIndexByIP(s.szIP), -1 != r) {
  606. var o = d[r];
  607. o.oProtocolInc.goPreset(o, s, n)
  608. }
  609. }
  610. }, this.I_RecordSearch = function (e, t, n, r, s) {
  611. var o = this.findDeviceIndexByIP(e);
  612. if (-1 != o) {
  613. var i = d[o], a = {
  614. iChannelID: t,
  615. szStartTime: n,
  616. szEndTime: r,
  617. iSearchPos: 0,
  618. iStreamType: 1,
  619. success: null,
  620. error: null
  621. };
  622. f.extend(a, s), i.oProtocolInc.recordSearch(i, a)
  623. }
  624. }, this.I_StartPlayback = function (e, t) {
  625. var r = this.findDeviceIndexByIP(e), s = "", o = "", i = -1, a = 1, c = 0,
  626. l = f.dateFormat(new Date, "yyyy-MM-dd"), p = {
  627. iWndIndex: u,
  628. iStreamType: 1,
  629. iChannelID: 1,
  630. szStartTime: l + " 00:00:00",
  631. szEndTime: l + " 23:59:59"
  632. };
  633. if (f.extend(p, t), -1 != r) {
  634. te(d[r]);
  635. var P = d[r];
  636. if (re()) {
  637. if (!P.bSupportWebsocket) return void (t.error && t.error(403, oe()));
  638. if (!B(p.oTransCodeParam)) return void (t.error && t.error());
  639. s = P.oProtocolInc.CGI.startWsPlayback, o = "ws://", B(p.iWSPort) ? P.iWSPort = 7681 : P.iWSPort = p.iWSPort, i = P.iWSPort, c = p.iStreamType, a = p.iChannelID <= P.iAnalogChannelNum ? p.iChannelID : P.oStreamCapa.iIpChanBase + parseInt(p.iChannelID, 10) - P.iAnalogChannelNum - 1, a = 100 * a + c
  640. } else {
  641. var h = parseInt(n.$XML(C).find("ProtocolType").eq(0).text(), 10);
  642. h == W && P.oStreamCapa.bSupportShttpPlay ? (s = B(p.oTransCodeParam) ? P.oProtocolInc.CGI.startShttpPlayback : P.oProtocolInc.CGI.startTransCodePlayback, o = "http://", c = p.iStreamType - 1, a = p.iChannelID <= P.iAnalogChannelNum ? p.iChannelID : P.oStreamCapa.iIpChanBase + parseInt(p.iChannelID, 10) - P.iAnalogChannelNum - 1, P.bSupportSubStreamPlayback && (a = 100 * a + c), B(p.iPort) ? "https://" == P.szHttpProtocol ? (-1 == P.iHttpPort && (P.iHttpPort = J(P).iHttpPort), i = P.iHttpPort) : i = P.iCGIPort : (P.iHttpPort = p.iPort, i = p.iPort)) : (s = P.oProtocolInc.CGI.startPlayback, o = "rtsp://", c = p.iStreamType, a = 100 * p.iChannelID + c, B(p.iRtspPort) || (P.iRtspPort = p.iRtspPort), -1 == P.iRtspPort && (P.iRtspPort = J(P).iRtspPort), i = P.iRtspPort)
  643. }
  644. if (-1 == i) return _("获取端口号失败"), void (t.error && t.error());
  645. if (f.extend(p, {
  646. urlProtocol: o,
  647. cgi: s,
  648. iPort: i,
  649. iChannelID: a
  650. }), r = this.findWndIndexByIndex(p.iWndIndex), -1 == r) if (re()) p.szStartTime = p.szStartTime.replace(" ", "T") + "Z", p.szEndTime = p.szEndTime.replace(" ", "T") + "Z", P.oProtocolInc.startPlayback(P, p).then(function () {
  651. t.success && t.success()
  652. }, function () {
  653. t.error && t.error()
  654. }); else {
  655. p.szStartTime = p.szStartTime.replace(/[-:]/g, "").replace(" ", "T") + "Z", p.szEndTime = p.szEndTime.replace(/[-:]/g, "").replace(" ", "T") + "Z";
  656. var I = P.oProtocolInc.startPlayback(P, p);
  657. 0 == I ? t.success && t.success() : (P.iRtspPort = -1, t.error && t.error())
  658. }
  659. } else t.error && t.error()
  660. }, this.I_ReversePlayback = function (e, t) {
  661. var r = this.findDeviceIndexByIP(e), s = -1, o = "", i = "", a = -1, c = -1, l = 0,
  662. p = f.dateFormat(new Date, "yyyy-MM-dd"), P = {
  663. iWndIndex: u,
  664. iStreamType: 1,
  665. iChannelID: 1,
  666. szStartTime: p + " 00:00:00",
  667. szEndTime: p + " 23:59:59"
  668. };
  669. if (f.extend(P, t), -1 != r) {
  670. te(d[r]);
  671. var h = d[r];
  672. if (re()) return s;
  673. var I = parseInt(n.$XML(C).find("ProtocolType").eq(0).text(), 10);
  674. if (I == W && h.oStreamCapa.bSupportShttpPlay ? (o = h.oProtocolInc.CGI.startShttpReversePlayback, i = "http://", l = P.iStreamType - 1, c = P.iChannelID <= h.iAnalogChannelNum ? P.iChannelID : h.oStreamCapa.iIpChanBase + parseInt(P.iChannelID, 10) - h.iAnalogChannelNum - 1, c = 100 * c + l, B(P.iPort) ? "https://" == h.szHttpProtocol ? (-1 == h.iHttpPort && (h.iHttpPort = J(h).iHttpPort), a = h.iHttpPort) : a = h.iCGIPort : (h.iHttpPort = P.iPort, a = P.iPort)) : (o = h.oProtocolInc.CGI.startPlayback, i = "rtsp://", l = P.iStreamType, c = 100 * P.iChannelID + l, B(P.iRtspPort) || (h.iRtspPort = P.iRtspPort), -1 == h.iRtspPort && (h.iRtspPort = J(h).iRtspPort), a = h.iRtspPort), -1 == a) return _("获取端口号失败"), s;
  675. f.extend(P, {
  676. urlProtocol: i,
  677. cgi: o,
  678. iPort: a,
  679. iChannelID: c
  680. }), r = this.findWndIndexByIndex(P.iWndIndex), -1 == r && (P.szStartTime = P.szStartTime.replace(/[-:]/g, "").replace(" ", "T") + "Z", P.szEndTime = P.szEndTime.replace(/[-:]/g, "").replace(" ", "T") + "Z", s = h.oProtocolInc.reversePlayback(h, P))
  681. }
  682. return -1 == s && (h.iRtspPort = -1), s
  683. }, this.I_Frame = function (e) {
  684. var t = {iWndIndex: u};
  685. N(e) ? f.extend(t, e) : B(e) || (t.iWndIndex = e);
  686. var n = this.findWndIndexByIndex(t.iWndIndex);
  687. if (-1 != n) {
  688. var r = p[n], s = r.iPlayStatus;
  689. if (s == D || s == T) if (re()) c.JS_FrameForward(t.iWndIndex).then(function () {
  690. r.iPlayStatus = T, t.success && t.success()
  691. }, function () {
  692. t.error && t.error()
  693. }); else {
  694. var o = c.HWP_FrameForward(t.iWndIndex);
  695. 0 == o ? (r.iPlayStatus = T, t.success && t.success()) : t.error && t.error()
  696. } else t.error && t.error()
  697. } else t.error && t.error()
  698. }, this.I_Pause = function (e) {
  699. var t = {iWndIndex: u};
  700. N(e) ? f.extend(t, e) : B(e) || (t.iWndIndex = e);
  701. var n = this.findWndIndexByIndex(t.iWndIndex);
  702. if (-1 != n) {
  703. var r = p[n], s = r.iPlayStatus, o = -1;
  704. if (s == D) o = z; else {
  705. if (s != b) return void (t.error && t.error());
  706. o = A
  707. }
  708. if (re()) c.JS_Pause(t.iWndIndex).then(function () {
  709. r.iPlayStatus = o, t.success && t.success()
  710. }, function () {
  711. t.error && t.error()
  712. }); else {
  713. var i = c.HWP_Pause(t.iWndIndex);
  714. 0 == i ? (r.iPlayStatus = o, t.success && t.success()) : t.error && t.error()
  715. }
  716. } else t.error && t.error()
  717. }, this.I_Resume = function (e) {
  718. var t = {iWndIndex: u};
  719. N(e) ? f.extend(t, e) : B(e) || (t.iWndIndex = e);
  720. var n = this.findWndIndexByIndex(t.iWndIndex);
  721. if (-1 != n) {
  722. var r = p[n], s = r.iPlayStatus, o = -1;
  723. if (s == z || s == T) o = D; else {
  724. if (s != A) return void (t.error && t.error());
  725. o = b
  726. }
  727. if (re()) c.JS_Resume(t.iWndIndex).then(function () {
  728. r.iPlayStatus = o, t.success && t.success()
  729. }, function () {
  730. t.error && t.error()
  731. }); else {
  732. var i = c.HWP_Resume(t.iWndIndex);
  733. 0 == i ? (r.iPlayStatus = o, t.success && t.success()) : t.error && t.error()
  734. }
  735. } else t.error && t.error()
  736. }, this.I_PlaySlow = function (e) {
  737. var t = {iWndIndex: u};
  738. N(e) ? f.extend(t, e) : B(e) || (t.iWndIndex = e);
  739. var n = this.findWndIndexByIndex(t.iWndIndex);
  740. if (-1 != n) {
  741. var r = p[n];
  742. if (r.iPlayStatus == D) if (re()) {
  743. var s = c.JS_GetWndStatus(t.iWndIndex);
  744. s.iRate <= -4 ? t.error && t.error() : c.JS_Slow(t.iWndIndex).then(function () {
  745. t.success && t.success()
  746. }, function () {
  747. t.error && t.error()
  748. })
  749. } else {
  750. var o = c.HWP_Slow(t.iWndIndex);
  751. 0 == o ? t.success && t.success() : t.error && t.error()
  752. } else t.error && t.error()
  753. } else t.error && t.error()
  754. }, this.I_PlayFast = function (e) {
  755. var t = {iWndIndex: u};
  756. N(e) ? f.extend(t, e) : B(e) || (t.iWndIndex = e);
  757. var n = this.findWndIndexByIndex(t.iWndIndex);
  758. if (-1 != n) {
  759. var r = p[n];
  760. if (r.iPlayStatus == D) if (re()) {
  761. var s = c.JS_GetWndStatus(t.iWndIndex);
  762. s.iRate >= 4 ? t.error && t.error() : c.JS_Fast(t.iWndIndex).then(function () {
  763. t.success && t.success()
  764. }, function () {
  765. t.error && t.error()
  766. })
  767. } else {
  768. var o = c.HWP_Fast(t.iWndIndex);
  769. 0 == o ? t.success && t.success() : t.error && t.error()
  770. } else t.error && t.error()
  771. } else t.error && t.error()
  772. }, this.I_GetOSDTime = function (e) {
  773. var t = {iWndIndex: u};
  774. N(e) ? f.extend(t, e) : B(e) || (t.iWndIndex = e);
  775. var n = this.findWndIndexByIndex(t.iWndIndex);
  776. if (-1 != n) {
  777. if (re()) c.JS_GetOSDTime(t.iWndIndex).then(function (e) {
  778. if (t.success) {
  779. var n = f.dateFormat(new Date(1e3 * e), "yyyy-MM-dd hh:mm:ss");
  780. t.success(n)
  781. }
  782. }, function () {
  783. t.error && t.error()
  784. }); else if (t.success) {
  785. var r = c.HWP_GetOSDTime(t.iWndIndex),
  786. s = f.dateFormat(new Date(1e3 * r), "yyyy-MM-dd hh:mm:ss");
  787. t.success(s)
  788. }
  789. } else t.error && t.error()
  790. }, this.I_StartDownloadRecord = function (e, t, n, r) {
  791. var s = this.findDeviceIndexByIP(e), o = -1;
  792. if (-1 != s) {
  793. var i = d[s], a = {szPlaybackURI: t, szFileName: n, bDateDir: !0};
  794. B(r) || f.extend(a, r), o = i.oProtocolInc.startDownloadRecord(i, a)
  795. }
  796. return o
  797. }, this.I_GetDownloadStatus = function (e) {
  798. var t = -1;
  799. return re() ? t : (t = c.HWP_GetDownloadStatus(e), 1 == t && (t = -1), t)
  800. }, this.I_GetDownloadProgress = function (e) {
  801. return re() ? -1 : c.HWP_GetDownloadProgress(e);
  802. }, this.I_StopDownloadRecord = function (e) {
  803. return re() ? -1 : c.HWP_StopDownload(e)
  804. }, this.I_ExportDeviceConfig = function (e) {
  805. var t = this.findDeviceIndexByIP(e), n = -1;
  806. if (-1 != t) {
  807. var r = d[t];
  808. if (re()) return n;
  809. n = r.oProtocolInc.exportDeviceConfig(r)
  810. }
  811. return n
  812. }, this.I_ImportDeviceConfig = function (e, t) {
  813. var n = this.findDeviceIndexByIP(e), r = -1;
  814. if (-1 != n) {
  815. var s = d[n], o = {szFileName: t};
  816. if (re()) return r;
  817. r = s.oProtocolInc.importDeviceConfig(s, o)
  818. }
  819. return r
  820. }, this.I_RestoreDefault = function (e, t, n) {
  821. var r = {success: null, error: null};
  822. f.extend(r, n);
  823. var s = this.findDeviceIndexByIP(e);
  824. if (-1 != s) {
  825. var o = d[s];
  826. o.oProtocolInc.restore(o, t, r)
  827. }
  828. }, this.I_Restart = function (e, t) {
  829. var n = this.findDeviceIndexByIP(e), r = {success: null, error: null};
  830. if (f.extend(r, t), -1 != n) {
  831. var s = d[n];
  832. s.oProtocolInc.restart(s, r)
  833. }
  834. }, this.I_Reconnect = function (e, t) {
  835. var n = this.findDeviceIndexByIP(e), r = {success: null, error: null};
  836. if (f.extend(r, t), -1 != n) {
  837. var s = d[n];
  838. s.oProtocolInc.login(s.szIP, s.iCGIPort, s.szAuth, r)
  839. }
  840. }, this.I_StartUpgrade = function (e, t) {
  841. var n = this.findDeviceIndexByIP(e), r = -1;
  842. if (-1 != n) {
  843. var s = d[n], o = {szFileName: t};
  844. if (re()) return r;
  845. r = s.oProtocolInc.startUpgrade(s, o)
  846. }
  847. return r
  848. }, this.I_UpgradeStatus = function () {
  849. return re() ? -1 : c.HWP_UpgradeStatus()
  850. }, this.I_UpgradeProgress = function () {
  851. return re() ? -1 : c.HWP_UpgradeProgress()
  852. }, this.I_StopUpgrade = function () {
  853. return re() ? -1 : c.HWP_StopUpgrade()
  854. }, this.I_CheckPluginInstall = function () {
  855. var e = -1, t = f.browser();
  856. if (re()) e = 0; else if (t.msie) try {
  857. new ActiveXObject("WebVideoKitActiveX.WebVideoKitActiveXCtrl.1");
  858. e = 0
  859. } catch (n) {
  860. } else for (var r = 0, s = navigator.mimeTypes.length; s > r; r++) if ("application/webvideo-plugin-kit" == navigator.mimeTypes[r].type.toLowerCase()) {
  861. e = 0;
  862. break
  863. }
  864. return e
  865. }, this.I_CheckPluginVersion = function () {
  866. return re() ? 0 : c.HWP_CheckPluginUpdate(k) ? -1 : 0
  867. }, this.I_SendHTTPRequest = function (e, t, n) {
  868. var r = this.findDeviceIndexByIP(e);
  869. if (!(0 > r)) {
  870. var s = d[r], o = new ue, i = s.szHttpProtocol + s.szIP + ":" + s.iCGIPort + "/" + t,
  871. a = {type: "GET", url: i, auth: s.szAuth, success: null, error: null};
  872. f.extend(a, n), f.extend(a, {
  873. success: function (e) {
  874. n.success && n.success(e)
  875. }, error: function (e, t) {
  876. n.error && n.error(e, t)
  877. }
  878. }), o.setRequestParam(a), o.submitRequest()
  879. }
  880. }, this.I_RemoteConfig = function (e, t) {
  881. var n = this.findDeviceIndexByIP(e), r = -1, s = -1;
  882. if (re()) return r;
  883. var o = {iLan: 0, iDevicePort: -1, iType: 0};
  884. if (f.extend(o, t), -1 != n) {
  885. var i = d[n];
  886. if (-1 == o.iDevicePort) if (-1 == i.iDevicePort) {
  887. if (i.iDevicePort = J(i).iDevicePort, s = i.iDevicePort, -1 == s) return r
  888. } else s = i.iDevicePort; else s = o.iDevicePort;
  889. if (":" == f.Base64.decode(i.szAuth)[0]) var a = f.Base64.decode(i.szAuth).split(":")[1],
  890. u = f.Base64.decode(i.szAuth).split(":")[2]; else var a = f.Base64.decode(i.szAuth).split(":")[0],
  891. u = f.Base64.decode(i.szAuth).split(":")[1];
  892. var l = "<RemoteInfo><DeviceInfo><DeviceType>" + o.iType + "</DeviceType><LanType>" + o.iLan + "</LanType><IP>" + i.szIP + "</IP><Port>" + s + "</Port><UName>" + a + "</UName><PWD>" + f.Base64.encode(u) + "</PWD></DeviceInfo></RemoteInfo>";
  893. return c.HWP_ShowRemConfig(l)
  894. }
  895. return r
  896. }, this.I_ChangeWndNum = function (e) {
  897. return isNaN(parseInt(e, 10)) ? -1 : (re() ? c.JS_ArrangeWindow(e) : c.HWP_ArrangeWindow(e), 0)
  898. }, this.I_GetLastError = function () {
  899. return re() ? -1 : c.HWP_GetLastError()
  900. }, this.I_GetWindowStatus = function (e) {
  901. if (B(e)) {
  902. var t = [];
  903. return f.extend(t, p), t
  904. }
  905. var n = this.findWndIndexByIndex(e);
  906. if (-1 != n) {
  907. var t = {};
  908. return f.extend(t, p[n]), t
  909. }
  910. return null
  911. }, this.I_GetIPInfoByMode = function (e, t, n, r) {
  912. return re() ? "" : c.HWP_GetIpInfoByMode(e, t, n, r)
  913. }, this.I_SetPlayModeType = function (e) {
  914. return re() ? -1 : c.HWP_SetPlayModeType(e)
  915. }, this.I_SetSnapDrawMode = function (e, t) {
  916. return re() ? -1 : c.HWP_SetSnapDrawMode(e, t)
  917. }, this.I_SetSnapPolygonInfo = function (e, t) {
  918. if (re()) return -1;
  919. var r, s, o, i, a, u, l, d, p, P, h, I, m, C = c.HWP_GetSnapPolygonInfo(e);
  920. r = f.loadXML(C), s = n.$XML(r).find("SnapPolygon", !0);
  921. var S = s.length, v = [];
  922. for (o = 0, i = s.length; i > o; o++) a = s[o], v.push(n.$XML(a).find("id").eq(0).text());
  923. var y = v.join(",");
  924. if (y = "," + y + ",", r = f.loadXML(t), s = n.$XML(r).find("SnapPolygon", !0), S + s.length > 32) return -3;
  925. for (o = 0, i = s.length; i > o; o++) {
  926. if (a = s[o], u = n.$XML(a).find("id").eq(0).text(), !f.isInt(u)) return -2;
  927. if (l = parseInt(u, 10), 1 > l || l > 32) return -2;
  928. if (y.indexOf("," + u + ",") > -1) return -4;
  929. if (d = n.$XML(a).find("tips").eq(0).text(), d.length > 32) return -2;
  930. if (h = "true" === n.$XML(a).find("isClosed").eq(0).text(), !h) {
  931. if (p = n.$XML(a).find("MinClosed").eq(0).text(), !f.isInt(p)) return -2;
  932. if (P = parseInt(p, 10), 4 > P || P > 17) return -2;
  933. if (I = n.$XML(a).find("PointNumMax").eq(0).text(), !f.isInt(I)) return -2;
  934. if (m = parseInt(I, 10), P > m || m > 17) return -2
  935. }
  936. }
  937. return c.HWP_SetSnapPolygonInfo(e, t)
  938. }, this.I_GetSnapPolygonInfo = function (e) {
  939. return re() ? "" : c.HWP_GetSnapPolygonInfo(e)
  940. }, this.I_ClearSnapInfo = function (e) {
  941. return re() ? -1 : c.HWP_ClearSnapInfo(e, 1)
  942. }, this.I_DeviceCapturePic = function (e, t, n, r) {
  943. var s = this.findDeviceIndexByIP(e), o = -1;
  944. if (-1 != s) {
  945. var i = d[s], a = {bDateDir: !0};
  946. if (f.extend(a, r), !B(a.iResolutionWidth) && !f.isInt(a.iResolutionWidth)) return o;
  947. if (!B(a.iResolutionHeight) && !f.isInt(a.iResolutionHeight)) return o;
  948. o = i.oProtocolInc.deviceCapturePic(i, t, n, a)
  949. }
  950. return o
  951. }, this.I_SetPackageType = function (e) {
  952. return re() ? -1 : c.HWP_SetPackageType(e)
  953. }, this.I_GetDevicePort = function (e) {
  954. var t = this.findDeviceIndexByIP(e), n = null;
  955. if (-1 != t) {
  956. var r = d[t];
  957. n = J(r)
  958. }
  959. return n
  960. }, this.findDeviceIndexByIP = function (e) {
  961. if (e.indexOf("_") > -1) {
  962. for (var t = 0, n = d.length; n > t; t++) if (d[t].szDeviceIdentify == e) return t
  963. } else for (var t = 0, n = d.length; n > t; t++) if (d[t].szIP == e) return t;
  964. return -1
  965. }, this.findWndIndexByIndex = function (e) {
  966. for (var t = 0, n = p.length; n > t; t++) if (p[t].iIndex == e) return t;
  967. return -1
  968. };
  969. var ae = function () {
  970. this.szIP = "", this.szHostName = "", this.szAuth = "", this.szHttpProtocol = "http://", this.iCGIPort = 80, this.szDeviceIdentify = "", this.iDevicePort = -1, this.iHttpPort = -1, this.iHttpsPort = -1, this.iRtspPort = -1, this.iWSPort = -1, this.iAudioType = 1, this.m_iAudioBitRate = -1, this.m_iAudioSamplingRate = -1, this.iDeviceProtocol = S, this.oProtocolInc = null, this.iAnalogChannelNum = 0, this.szDeviceType = "", this.bVoiceTalk = !1, this.oStreamCapa = {
  971. bObtained: !1,
  972. bSupportShttpPlay: !1,
  973. bSupportShttpPlayback: !1,
  974. bSupportShttpsPlay: !1,
  975. bSupportShttpsPlayback: !1,
  976. bSupportShttpPlaybackTransCode: !1,
  977. bSupportShttpsPlaybackTransCode: !1,
  978. iIpChanBase: 1
  979. }
  980. }, ce = function () {
  981. this.iIndex = 0, this.szIP = "", this.iCGIPort = 80, this.szDeviceIdentify = "", this.iChannelID = "", this.iPlayStatus = g, this.bSound = !1, this.bRecord = !1, this.bPTZAuto = !1, this.bEZoom = !1, this.b3DZoom = !1
  982. }, ue = function () {
  983. this.options = {
  984. type: "GET",
  985. url: "",
  986. auth: "",
  987. timeout: 1e4,
  988. data: "",
  989. async: !0,
  990. success: null,
  991. error: null
  992. }, this.m_szHttpHead = "", this.m_szHttpContent = "", this.m_szHttpData = ""
  993. };
  994. ue.prototype.m_httpRequestSet = [], ue.prototype.setRequestParam = function (e) {
  995. f.extend(this.options, e)
  996. }, ue.prototype.submitRequest = function () {
  997. var t = null, n = this;
  998. if (re()) {
  999. this.options.auth ? f.cookie("WebSession", this.options.auth) : f.cookie("WebSession", null);
  1000. var r = se(this.options.url), s = new e.XMLHttpRequest;
  1001. s.open(this.options.type, r, this.options.async), s.setRequestHeader("X-Requested-With", "XMLHttpRequest"), s.setRequestHeader("If-Modified-Since", "0"), s.send(this.options.data || null);
  1002. var o = function () {
  1003. if (4 === s.readyState) {
  1004. t = {funSuccessCallback: n.options.success, funErrorCallback: n.options.error};
  1005. var e = s.status + s.responseText;
  1006. 0 === s.status && (e = ""), n.httpDataAnalyse(t, e)
  1007. }
  1008. };
  1009. this.options.async ? (s.timeout = this.options.timeout, s.onreadystatechange = function () {
  1010. o()
  1011. }) : o()
  1012. } else {
  1013. var i = this.getHttpMethod(this.options.type);
  1014. if (this.options.async) {
  1015. var a = c.HWP_SubmitHttpRequest(i, this.options.url, this.options.auth, this.options.data, this.options.timeout);
  1016. -1 != a && (t = {
  1017. iRequestID: a,
  1018. funSuccessCallback: this.options.success,
  1019. funErrorCallback: this.options.error
  1020. }, this.m_httpRequestSet.push(t))
  1021. } else {
  1022. var u = c.HWP_SendHttpSynRequest(i, this.options.url, this.options.auth, this.options.data, this.options.timeout);
  1023. t = {
  1024. funSuccessCallback: this.options.success,
  1025. funErrorCallback: this.options.error
  1026. }, this.httpDataAnalyse(t, u)
  1027. }
  1028. }
  1029. }, ue.prototype.getHttpMethod = function (e) {
  1030. var t = {GET: 1, POST: 2, PUT: 5, DELETE: 6}, n = t[e];
  1031. return n ? n : -1
  1032. }, ue.prototype.processCallback = function (e, t) {
  1033. for (var n = null, r = 0; r < this.m_httpRequestSet.length; r++) if (e == this.m_httpRequestSet[r].iRequestID) {
  1034. n = this.m_httpRequestSet[r], this.m_httpRequestSet.splice(r, 1);
  1035. break
  1036. }
  1037. null != n && (this.httpDataAnalyse(n, t), delete n)
  1038. }, ue.prototype.httpDataAnalyse = function (e, t) {
  1039. var n = "", r = 0;
  1040. "" == t || B(t) ? e.funErrorCallback() : (r = parseInt(t.substring(0, 3)), n = t.substring(3, t.length), isNaN(r) ? e.funErrorCallback() : y == r ? e.funSuccessCallback(f.loadXML(n)) : e.funErrorCallback(r, f.loadXML(n)))
  1041. };
  1042. var le = function () {
  1043. };
  1044. le.prototype.CGI = {
  1045. login: "%s%s:%s/ISAPI/Security/userCheck",
  1046. getAudioInfo: "%s%s:%s/ISAPI/System/TwoWayAudio/channels",
  1047. getDeviceInfo: "%s%s:%s/ISAPI/System/deviceInfo",
  1048. getAnalogChannelInfo: "%s%s:%s/ISAPI/System/Video/inputs/channels",
  1049. getDigitalChannel: "%s%s:%s/ISAPI/ContentMgmt/InputProxy/channels",
  1050. getDigitalChannelInfo: "%s%s:%s/ISAPI/ContentMgmt/InputProxy/channels/status",
  1051. getZeroChannelInfo: "%s%s:%s/ISAPI/ContentMgmt/ZeroVideo/channels",
  1052. getStreamChannels: {
  1053. analog: "%s%s:%s/ISAPI/Streaming/channels",
  1054. digital: "%s%s:%s/ISAPI/ContentMgmt/StreamingProxy/channels"
  1055. },
  1056. getStreamDynChannels: "%s%s:%s/PSIA/Custom/SelfExt/ContentMgmt/DynStreaming/channels",
  1057. startRealPlay: {
  1058. channels: "%s%s:%s/PSIA/streaming/channels/%s",
  1059. zeroChannels: "%s%s:%s/PSIA/Custom/SelfExt/ContentMgmt/ZeroStreaming/channels/%s"
  1060. },
  1061. startShttpRealPlay: {
  1062. channels: "%s%s:%s/SDK/play/%s/004",
  1063. zeroChannels: "%s%s:%s/SDK/play/100/004/ZeroStreaming"
  1064. },
  1065. startWsRealPlay: {channels: "%s%s:%s/%s", zeroChannels: "%s%s:%s/%s"},
  1066. startVoiceTalk: {
  1067. open: "%s%s:%s/ISAPI/System/TwoWayAudio/channels/%s/open",
  1068. close: "%s%s:%s/ISAPI/System/TwoWayAudio/channels/%s/close",
  1069. audioData: "%s%s:%s/ISAPI/System/TwoWayAudio/channels/%s/audioData"
  1070. },
  1071. ptzControl: {
  1072. analog: "%s%s:%s/ISAPI/PTZCtrl/channels/%s/continuous",
  1073. digital: "%s%s:%s/ISAPI/ContentMgmt/PTZCtrlProxy/channels/%s/continuous"
  1074. },
  1075. ptzAutoControl: {
  1076. ipdome: "%s%s:%s/ISAPI/PTZCtrl/channels/%s/presets/%s/goto",
  1077. analog: "%s%s:%s/ISAPI/PTZCtrl/channels/%s/autoPan",
  1078. digital: "%s%s:%s/ISAPI/ContentMgmt/PTZCtrlProxy/channels/%s/autoPan"
  1079. },
  1080. setPreset: {
  1081. analog: "%s%s:%s/ISAPI/PTZCtrl/channels/%s/presets/%s",
  1082. digital: "%s%s:%s/ISAPI/ContentMgmt/PTZCtrlProxy/channels/%s/presets/%s"
  1083. },
  1084. goPreset: {
  1085. analog: "%s%s:%s/ISAPI/PTZCtrl/channels/%s/presets/%s/goto",
  1086. digital: "%s%s:%s/ISAPI/ContentMgmt/PTZCtrlProxy/channels/%s/presets/%s/goto"
  1087. },
  1088. ptzFocus: {
  1089. analog: "%s%s:%s/ISAPI/Image/channels/%s/focus",
  1090. digital: "%s%s:%s/ISAPI/ContentMgmt/ImageProxy/channels/%s/focus",
  1091. ipc: "%s%s:%s/ISAPI/System/Video/inputs/channels/%s/focus"
  1092. },
  1093. ptzIris: {
  1094. analog: "%s%s:%s/ISAPI/Image/channels/%s/iris",
  1095. digital: "%s%s:%s/ISAPI/ContentMgmt/ImageProxy/channels/%s/iris",
  1096. ipc: "%s%s:%s/ISAPI/System/Video/inputs/channels/%s/iris"
  1097. },
  1098. getNetworkBond: "%s%s:%s/ISAPI/System/Network/Bond",
  1099. getNetworkInterface: "%s%s:%s/ISAPI/System/Network/interfaces",
  1100. getUPnPPortStatus: "%s%s:%s/ISAPI/System/Network/UPnP/ports/status",
  1101. getPPPoEStatus: "%s%s:%s/ISAPI/System/Network/PPPoE/1/status",
  1102. getPortInfo: "%s%s:%s/ISAPI/Security/adminAccesses",
  1103. recordSearch: "%s%s:%s/ISAPI/ContentMgmt/search",
  1104. startPlayback: "%s%s:%s/PSIA/streaming/tracks/%s?starttime=%s&endtime=%s",
  1105. startWsPlayback: "%s%s:%s/%s",
  1106. startShttpPlayback: "%s%s:%s/SDK/playback/%s",
  1107. startShttpReversePlayback: "%s%s:%s/SDK/playback/%s/reversePlay",
  1108. startTransCodePlayback: "%s%s:%s/SDK/playback/%s/transcoding",
  1109. startDownloadRecord: "%s%s:%s/ISAPI/ContentMgmt/download",
  1110. deviceConfig: "%s%s:%s/ISAPI/System/configurationData",
  1111. restart: "%s%s:%s/ISAPI/System/reboot",
  1112. restore: "%s%s:%s/ISAPI/System/factoryReset?mode=%s",
  1113. startUpgrade: {
  1114. upgrade: "%s%s:%s/ISAPI/System/updateFirmware",
  1115. status: "%s%s:%s/ISAPI/System/upgradeStatus"
  1116. },
  1117. set3DZoom: {
  1118. analog: "%s%s:%s/ISAPI/PTZCtrl/channels/%s/position3D",
  1119. digital: "%s%s:%s/ISAPI/ContentMgmt/PTZCtrlProxy/channels/%s/position3D"
  1120. },
  1121. SDKCapabilities: "%s%s:%s/SDK/capabilities",
  1122. deviceCapture: {channels: "%s%s:%s/ISAPI/Streaming/channels/%s/picture"},
  1123. sessionCap: "%s%s:%s/ISAPI/Security/sessionLogin/capabilities?username=%s",
  1124. sessionLogin: "%s%s:%s/ISAPI/Security/sessionLogin",
  1125. sessionHeartbeat: "%s%s:%s/ISAPI/Security/sessionHeartbeat",
  1126. sessionLogout: "%s%s:%s/ISAPI/Security/sessionLogout",
  1127. systemCapabilities: "%s%s:%s/ISAPI/System/capabilities"
  1128. }, le.prototype.login = function (e, t, r, s) {
  1129. var o = 2 == s.protocol ? "https://" : "http://", i = E(this.CGI.login, o, e, t), a = new ue,
  1130. c = {type: "GET", url: i, auth: r, success: null, error: null};
  1131. f.extend(c, s), f.extend(c, {
  1132. success: function (e) {
  1133. "200" == n.$XML(e).find("statusValue").eq(0).text() || "OK" == n.$XML(e).find("statusString").eq(0).text() ? s.success && s.success(e) : s.error && s.error(401, e)
  1134. }, error: function (e, t) {
  1135. s.error && s.error(e, t)
  1136. }
  1137. }), a.setRequestParam(c), a.submitRequest()
  1138. }, le.prototype.getAudioInfo = function (e, t) {
  1139. var n = E(this.CGI.getAudioInfo, e.szHttpProtocol, e.szIP, e.iCGIPort), r = new ue,
  1140. s = {type: "GET", url: n, auth: e.szAuth, success: null, error: null};
  1141. f.extend(s, t), f.extend(s, {
  1142. success: function (e) {
  1143. t.success && t.success(e)
  1144. }, error: function (e, n) {
  1145. t.error && t.error(e, n)
  1146. }
  1147. }), r.setRequestParam(s), r.submitRequest()
  1148. }, le.prototype.getDeviceInfo = function (e, t) {
  1149. var r = E(this.CGI.getDeviceInfo, e.szHttpProtocol, e.szIP, e.iCGIPort), s = new ue,
  1150. o = {type: "GET", url: r, auth: e.szAuth, success: null, error: null};
  1151. f.extend(o, t), f.extend(o, {
  1152. success: function (e) {
  1153. var r = [];
  1154. r.push("<DeviceInfo>"), r.push("<deviceName>" + f.escape(n.$XML(e).find("deviceName").eq(0).text()) + "</deviceName>"), r.push("<deviceID>" + n.$XML(e).find("deviceID").eq(0).text() + "</deviceID>"), r.push("<deviceType>" + n.$XML(e).find("deviceType").eq(0).text() + "</deviceType>"), r.push("<model>" + n.$XML(e).find("model").eq(0).text() + "</model>"), r.push("<serialNumber>" + n.$XML(e).find("serialNumber").eq(0).text() + "</serialNumber>"), r.push("<macAddress>" + n.$XML(e).find("macAddress").eq(0).text() + "</macAddress>"), r.push("<firmwareVersion>" + n.$XML(e).find("firmwareVersion").eq(0).text() + "</firmwareVersion>"), r.push("<firmwareReleasedDate>" + n.$XML(e).find("firmwareReleasedDate").eq(0).text() + "</firmwareReleasedDate>"), r.push("<encoderVersion>" + n.$XML(e).find("encoderVersion").eq(0).text() + "</encoderVersion>"), r.push("<encoderReleasedDate>" + n.$XML(e).find("encoderReleasedDate").eq(0).text() + "</encoderReleasedDate>"), r.push("</DeviceInfo>"), e = f.loadXML(r.join("")), t.success && t.success(e)
  1155. }, error: function (e, n) {
  1156. t.error && t.error(e, n)
  1157. }
  1158. }), s.setRequestParam(o), s.submitRequest()
  1159. }, le.prototype.getAnalogChannelInfo = function (e, t) {
  1160. var r = E(this.CGI.getAnalogChannelInfo, e.szHttpProtocol, e.szIP, e.iCGIPort), s = new ue,
  1161. o = {type: "GET", url: r, auth: e.szAuth, success: null, error: null};
  1162. f.extend(o, t), f.extend(o, {
  1163. success: function (e) {
  1164. var r = [];
  1165. r.push("<VideoInputChannelList>");
  1166. for (var s = n.$XML(e).find("VideoInputChannel", !0), o = 0, i = s.length; i > o; o++) {
  1167. var a = s[o];
  1168. r.push("<VideoInputChannel>"), r.push("<id>" + n.$XML(a).find("id").eq(0).text() + "</id>"), r.push("<inputPort>" + n.$XML(a).find("inputPort").eq(0).text() + "</inputPort>"), r.push("<name>" + f.escape(n.$XML(a).find("name").eq(0).text()) + "</name>"), r.push("<videoFormat>" + n.$XML(a).find("videoFormat").eq(0).text() + "</videoFormat>"), r.push("</VideoInputChannel>")
  1169. }
  1170. r.push("</VideoInputChannelList>"), e = f.loadXML(r.join("")), t.success && t.success(e)
  1171. }, error: function (e, n) {
  1172. t.error && t.error(e, n)
  1173. }
  1174. }), s.setRequestParam(o), s.submitRequest()
  1175. }, le.prototype.getDigitalChannel = function (e, t) {
  1176. var r = E(this.CGI.getDigitalChannel, e.szHttpProtocol, e.szIP, e.iCGIPort), s = new ue,
  1177. o = {type: "GET", url: r, auth: e.szAuth, success: null, error: null};
  1178. f.extend(o, t), f.extend(o, {
  1179. success: function (e) {
  1180. var r = [];
  1181. r.push("<InputProxyChannelList>");
  1182. for (var s = n.$XML(e).find("InputProxyChannel", !0), o = 0, i = s.length; i > o; o++) {
  1183. var a = s[o];
  1184. r.push("<InputProxyChannel>"), r.push("<id>" + n.$XML(a).find("id").eq(0).text() + "</id>"), r.push("<name>" + f.escape(n.$XML(a).find("name").eq(0).text()) + "</name>"), r.push("</InputProxyChannel>")
  1185. }
  1186. r.push("</InputProxyChannelList>"), e = f.loadXML(r.join("")), t.success && t.success(e)
  1187. }, error: function (e, n) {
  1188. t.error && t.error(e, n)
  1189. }
  1190. }), s.setRequestParam(o), s.submitRequest()
  1191. }, le.prototype.getDigitalChannelInfo = function (e, t) {
  1192. var r = null, s = {};
  1193. if (this.getDigitalChannel(e, {
  1194. async: !1, success: function (e) {
  1195. r = e;
  1196. for (var t = n.$XML(r).find("InputProxyChannel", !0), o = 0, i = t.length; i > o; o++) {
  1197. var a = t[o], c = n.$XML(a).find("id").eq(0).text(),
  1198. u = n.$XML(a).find("name").eq(0).text();
  1199. s[c] = u
  1200. }
  1201. }, error: function (e, n) {
  1202. t.error && t.error(e, n)
  1203. }
  1204. }), null !== r) {
  1205. var o = E(this.CGI.getDigitalChannelInfo, e.szHttpProtocol, e.szIP, e.iCGIPort), i = new ue,
  1206. a = {type: "GET", url: o, auth: e.szAuth, success: null, error: null};
  1207. f.extend(a, t), f.extend(a, {
  1208. success: function (e) {
  1209. var r = [];
  1210. r.push("<InputProxyChannelStatusList>");
  1211. for (var o = n.$XML(e).find("InputProxyChannelStatus", !0), i = 0, a = o.length; a > i; i++) {
  1212. var c = o[i], u = n.$XML(c).find("id").eq(0).text();
  1213. r.push("<InputProxyChannelStatus>"), r.push("<id>" + u + "</id>"), r.push("<sourceInputPortDescriptor>"), r.push("<proxyProtocol>" + n.$XML(c).find("proxyProtocol").eq(0).text() + "</proxyProtocol>"), r.push("<addressingFormatType>" + n.$XML(c).find("addressingFormatType").eq(0).text() + "</addressingFormatType>"), r.push("<ipAddress>" + n.$XML(c).find("ipAddress").eq(0).text() + "</ipAddress>"), r.push("<managePortNo>" + n.$XML(c).find("managePortNo").eq(0).text() + "</managePortNo>"), r.push("<srcInputPort>" + n.$XML(c).find("srcInputPort").eq(0).text() + "</srcInputPort>"), r.push("<userName>" + f.escape(n.$XML(c).find("userName").eq(0).text()) + "</userName>"), r.push("<streamType>" + n.$XML(c).find("streamType").eq(0).text() + "</streamType>"), r.push("<online>" + n.$XML(c).find("online").eq(0).text() + "</online>"), r.push("<name>" + f.escape(s[u]) + "</name>"), r.push("</sourceInputPortDescriptor>"), r.push("</InputProxyChannelStatus>")
  1214. }
  1215. r.push("</InputProxyChannelStatusList>"), e = f.loadXML(r.join("")), t.success && t.success(e)
  1216. }, error: function (e, n) {
  1217. t.error && t.error(e, n)
  1218. }
  1219. }), i.setRequestParam(a), i.submitRequest()
  1220. }
  1221. }, le.prototype.getZeroChannelInfo = function (e, t) {
  1222. var n = E(this.CGI.getZeroChannelInfo, e.szHttpProtocol, e.szIP, e.iCGIPort), r = new ue,
  1223. s = {type: "GET", url: n, auth: e.szAuth, success: null, error: null};
  1224. f.extend(s, t), f.extend(s, {
  1225. success: function (e) {
  1226. t.success && t.success(e)
  1227. }, error: function (e, n) {
  1228. t.error && t.error(e, n)
  1229. }
  1230. }), r.setRequestParam(s), r.submitRequest()
  1231. }, le.prototype.getStreamChannels = function (e, t) {
  1232. if (0 != e.iAnalogChannelNum) var n = E(this.CGI.getStreamChannels.analog, e.szHttpProtocol, e.szIP, e.iCGIPort); else var n = E(this.CGI.getStreamChannels.digital, e.szHttpProtocol, e.szIP, e.iCGIPort);
  1233. var r = new ue, s = {type: "GET", url: n, auth: e.szAuth, success: null, error: null};
  1234. f.extend(s, t), f.extend(s, {
  1235. success: function (e) {
  1236. t.success && t.success(e)
  1237. }, error: function (e, n) {
  1238. t.error && t.error(e, n)
  1239. }
  1240. }), r.setRequestParam(s), r.submitRequest()
  1241. }, le.prototype.getPPPoEStatus = function (e, t) {
  1242. var n = E(this.CGI.getPPPoEStatus, e.szHttpProtocol, e.szIP, e.iCGIPort), r = new ue,
  1243. s = {type: "GET", url: n, auth: e.szAuth, success: null, error: null};
  1244. f.extend(s, t), f.extend(s, {
  1245. success: function (e) {
  1246. t.success && t.success(e)
  1247. }, error: function (e, n) {
  1248. t.error && t.error(e, n)
  1249. }
  1250. }), r.setRequestParam(s), r.submitRequest()
  1251. }, le.prototype.getUPnPPortStatus = function (e, t) {
  1252. var n = E(this.CGI.getUPnPPortStatus, e.szHttpProtocol, e.szIP, e.iCGIPort), r = new ue,
  1253. s = {type: "GET", url: n, auth: e.szAuth, success: null, error: null};
  1254. f.extend(s, t), f.extend(s, {
  1255. success: function (e) {
  1256. t.success && t.success(e)
  1257. }, error: function (e, n) {
  1258. t.error && t.error(e, n)
  1259. }
  1260. }), r.setRequestParam(s), r.submitRequest()
  1261. }, le.prototype.getNetworkBond = function (e, t) {
  1262. var n = E(this.CGI.getNetworkBond, e.szHttpProtocol, e.szIP, e.iCGIPort), r = new ue,
  1263. s = {type: "GET", url: n, auth: e.szAuth, success: null, error: null};
  1264. f.extend(s, t), f.extend(s, {
  1265. success: function (e) {
  1266. t.success && t.success(e)
  1267. }, error: function (e, n) {
  1268. t.error && t.error(e, n)
  1269. }
  1270. }), r.setRequestParam(s), r.submitRequest()
  1271. }, le.prototype.getNetworkInterface = function (e, t) {
  1272. var n = E(this.CGI.getNetworkInterface, e.szHttpProtocol, e.szIP, e.iCGIPort), r = new ue,
  1273. s = {type: "GET", url: n, auth: e.szAuth, success: null, error: null};
  1274. f.extend(s, t), f.extend(s, {
  1275. success: function (e) {
  1276. t.success && t.success(e)
  1277. }, error: function (e, n) {
  1278. t.error && t.error(e, n)
  1279. }
  1280. }), r.setRequestParam(s), r.submitRequest()
  1281. }, le.prototype.getPortInfo = function (e, t) {
  1282. var n = E(this.CGI.getPortInfo, e.szHttpProtocol, e.szIP, e.iCGIPort), r = new ue,
  1283. s = {type: "GET", url: n, auth: e.szAuth, success: null, error: null};
  1284. f.extend(s, t), f.extend(s, {
  1285. success: function (e) {
  1286. t.success && t.success(e)
  1287. }, error: function (e, n) {
  1288. t.error && t.error(e, n)
  1289. }
  1290. }), r.setRequestParam(s), r.submitRequest()
  1291. }, le.prototype.startRealPlay = function (e, t) {
  1292. var n = 100 * t.iChannelID + t.iStreamType, r = "", s = -1, o = e.szIP;
  1293. "rtsp://" === t.urlProtocol && (o = Z(o)), t.bZeroChannel ? (re() && (n = 0), r = E(t.cgi.zeroChannels, t.urlProtocol, o, t.iPort, n)) : r = E(t.cgi.channels, t.urlProtocol, o, t.iPort, n);
  1294. var i = function () {
  1295. var n = new ce;
  1296. n.iIndex = t.iWndIndex, n.szIP = e.szIP, n.iCGIPort = e.iCGIPort, n.szDeviceIdentify = e.szDeviceIdentify, n.iChannelID = t.iChannelID, n.iPlayStatus = x, p.push(n)
  1297. };
  1298. if (re()) {
  1299. var a = new Promise(function (n, s) {
  1300. c.JS_Play(r, {session: e.szAuth}, t.iWndIndex).then(function () {
  1301. i(), n()
  1302. }, function () {
  1303. s()
  1304. })
  1305. });
  1306. return a
  1307. }
  1308. return s = c.HWP_Play(r, e.szAuth, t.iWndIndex, "", ""), 0 == s && i(), s
  1309. }, le.prototype.startVoiceTalk = function (e, t) {
  1310. var n = E(this.CGI.startVoiceTalk.open, e.szHttpProtocol, e.szIP, e.iCGIPort, t),
  1311. r = E(this.CGI.startVoiceTalk.close, e.szHttpProtocol, e.szIP, e.iCGIPort, t),
  1312. s = E(this.CGI.startVoiceTalk.audioData, e.szHttpProtocol, e.szIP, e.iCGIPort, t),
  1313. o = c.HWP_StartVoiceTalkEx(n, r, s, e.szAuth, e.iAudioType, e.m_iAudioBitRate, e.m_iAudioSamplingRate);
  1314. return o
  1315. }, le.prototype.ptzAutoControl = function (e, t, n, r) {
  1316. var s = n.iChannelID, o = "", i = "";
  1317. if (r.iPTZSpeed = r.iPTZSpeed < 7 ? 15 * r.iPTZSpeed : 100, t && (r.iPTZSpeed = 0), e.szDeviceType != w) o = s <= e.iAnalogChannelNum ? E(this.CGI.ptzAutoControl.analog, e.szHttpProtocol, e.szIP, e.iCGIPort, n.iChannelID) : n.bShttpIPChannel ? E(this.CGI.ptzAutoControl.digital, e.szHttpProtocol, e.szIP, e.iCGIPort, n.iChannelID - e.oStreamCapa.iIpChanBase + 1 + e.iAnalogChannelNum) : E(this.CGI.ptzAutoControl.digital, e.szHttpProtocol, e.szIP, e.iCGIPort, n.iChannelID), i = "<?xml version='1.0' encoding='UTF-8'?><autoPanData><autoPan>" + r.iPTZSpeed + "</autoPan></autoPanData>"; else {
  1318. var a = 99;
  1319. t && (a = 96), o = E(this.CGI.ptzAutoControl.ipdome, e.szHttpProtocol, e.szIP, e.iCGIPort, n.iChannelID, a)
  1320. }
  1321. var c = new ue,
  1322. u = {type: "PUT", url: o, async: !1, auth: e.szAuth, data: i, success: null, error: null}, l = this;
  1323. f.extend(u, r), f.extend(u, {
  1324. success: function (e) {
  1325. n.bPTZAuto = !n.bPTZAuto, r.success && r.success(e)
  1326. }, error: function (t, s) {
  1327. if (X == e.szDeviceType || H == e.szDeviceType) {
  1328. o = n.bShttpIPChannel ? E(l.CGI.ptzControl.analog, e.szHttpProtocol, e.szIP, e.iCGIPort, n.iChannelID - e.oStreamCapa.iIpChanBase + 1 + e.iAnalogChannelNum) : E(l.CGI.ptzControl.analog, e.szHttpProtocol, e.szIP, e.iCGIPort, n.iChannelID), i = "<?xml version='1.0' encoding='UTF-8'?><PTZData><pan>" + r.iPTZSpeed + "</pan><tilt>0</tilt></PTZData>";
  1329. var a = new ue, c = {
  1330. type: "PUT",
  1331. url: o,
  1332. async: !1,
  1333. auth: e.szAuth,
  1334. data: i,
  1335. success: null,
  1336. error: null
  1337. };
  1338. f.extend(c, r), a.setRequestParam(c), a.submitRequest()
  1339. } else r.error && r.error(t, s)
  1340. }
  1341. }), c.setRequestParam(u), c.submitRequest()
  1342. }, le.prototype.ptzControl = function (e, t, n, r) {
  1343. var s = n.iChannelID, o = "";
  1344. n.bPTZAuto && this.ptzAutoControl(e, !0, n, {iPTZSpeed: 0}), t ? r.iPTZSpeed = 0 : r.iPTZSpeed = r.iPTZSpeed < 7 ? 15 * r.iPTZSpeed : 100;
  1345. var i = [{}, {pan: 0, tilt: r.iPTZSpeed}, {pan: 0, tilt: -r.iPTZSpeed}, {
  1346. pan: -r.iPTZSpeed,
  1347. tilt: 0
  1348. }, {pan: r.iPTZSpeed, tilt: 0}, {pan: -r.iPTZSpeed, tilt: r.iPTZSpeed}, {
  1349. pan: -r.iPTZSpeed,
  1350. tilt: -r.iPTZSpeed
  1351. }, {pan: r.iPTZSpeed, tilt: r.iPTZSpeed}, {
  1352. pan: r.iPTZSpeed,
  1353. tilt: -r.iPTZSpeed
  1354. }, {}, {speed: r.iPTZSpeed}, {speed: -r.iPTZSpeed}, {speed: r.iPTZSpeed}, {speed: -r.iPTZSpeed}, {speed: r.iPTZSpeed}, {speed: -r.iPTZSpeed}],
  1355. a = "", c = {};
  1356. switch (r.iPTZIndex) {
  1357. case 1:
  1358. case 2:
  1359. case 3:
  1360. case 4:
  1361. case 5:
  1362. case 6:
  1363. case 7:
  1364. case 8:
  1365. c = this.CGI.ptzControl, a = "<?xml version='1.0' encoding='UTF-8'?><PTZData><pan>" + i[r.iPTZIndex].pan + "</pan><tilt>" + i[r.iPTZIndex].tilt + "</tilt></PTZData>";
  1366. break;
  1367. case 10:
  1368. case 11:
  1369. c = this.CGI.ptzControl, a = "<?xml version='1.0' encoding='UTF-8'?><PTZData><zoom>" + i[r.iPTZIndex].speed + "</zoom></PTZData>";
  1370. break;
  1371. case 12:
  1372. case 13:
  1373. c = this.CGI.ptzFocus, a = "<?xml version='1.0' encoding='UTF-8'?><FocusData><focus>" + i[r.iPTZIndex].speed + "</focus></FocusData>";
  1374. break;
  1375. case 14:
  1376. case 15:
  1377. c = this.CGI.ptzIris, a = "<?xml version='1.0' encoding='UTF-8'?><IrisData><iris>" + i[r.iPTZIndex].speed + "</iris></IrisData>";
  1378. break;
  1379. default:
  1380. return void (r.error && r.error())
  1381. }
  1382. o = c != this.CGI.ptzFocus && c != this.CGI.ptzIris || e.szDeviceType != X && e.szDeviceType != w && e.szDeviceType != H ? s <= e.iAnalogChannelNum ? E(c.analog, e.szHttpProtocol, e.szIP, e.iCGIPort, n.iChannelID) : n.bShttpIPChannel ? E(c.digital, e.szHttpProtocol, e.szIP, e.iCGIPort, n.iChannelID - e.oStreamCapa.iIpChanBase + 1 + e.iAnalogChannelNum) : E(c.digital, e.szHttpProtocol, e.szIP, e.iCGIPort, n.iChannelID) : E(c.ipc, e.szHttpProtocol, e.szIP, e.iCGIPort, n.iChannelID);
  1383. var u = new ue,
  1384. l = {type: "PUT", url: o, async: !1, auth: e.szAuth, data: a, success: null, error: null};
  1385. f.extend(l, r), f.extend(l, {
  1386. success: function (e) {
  1387. r.success && r.success(e)
  1388. }, error: function (e, t) {
  1389. r.error && r.error(e, t)
  1390. }
  1391. }), u.setRequestParam(l), u.submitRequest()
  1392. }, le.prototype.setPreset = function (e, t, n) {
  1393. var r = t.iChannelID, s = "", o = "";
  1394. s = r <= e.iAnalogChannelNum ? E(this.CGI.setPreset.analog, e.szHttpProtocol, e.szIP, e.iCGIPort, t.iChannelID, n.iPresetID) : t.bShttpIPChannel ? E(this.CGI.setPreset.digital, e.szHttpProtocol, e.szIP, e.iCGIPort, t.iChannelID - e.oStreamCapa.iIpChanBase + 1 + e.iAnalogChannelNum, n.iPresetID) : E(this.CGI.setPreset.digital, e.szHttpProtocol, e.szIP, e.iCGIPort, t.iChannelID, n.iPresetID), o = "<?xml version='1.0' encoding='UTF-8'?>", o += "<PTZPreset>", o += "<id>" + n.iPresetID + "</id>", e.szDeviceType != w && (o += "<presetName>Preset" + n.iPresetID + "</presetName>"), o += "</PTZPreset>";
  1395. var i = new ue, a = {type: "PUT", url: s, auth: e.szAuth, data: o, success: null, error: null};
  1396. f.extend(a, n), f.extend(a, {
  1397. success: function (e) {
  1398. n.success && n.success(e)
  1399. }, error: function (e, t) {
  1400. n.error && n.error(e, t)
  1401. }
  1402. }), i.setRequestParam(a), i.submitRequest()
  1403. }, le.prototype.goPreset = function (e, t, n) {
  1404. var r = t.iChannelID, s = "";
  1405. s = r <= e.iAnalogChannelNum ? E(this.CGI.goPreset.analog, e.szHttpProtocol, e.szIP, e.iCGIPort, t.iChannelID, n.iPresetID) : t.bShttpIPChannel ? E(this.CGI.goPreset.digital, e.szHttpProtocol, e.szIP, e.iCGIPort, t.iChannelID - e.oStreamCapa.iIpChanBase + 1 + e.iAnalogChannelNum, n.iPresetID) : E(this.CGI.goPreset.digital, e.szHttpProtocol, e.szIP, e.iCGIPort, t.iChannelID, n.iPresetID);
  1406. var o = new ue, i = {type: "PUT", url: s, auth: e.szAuth, success: null, error: null};
  1407. f.extend(i, n), f.extend(i, {
  1408. success: function (e) {
  1409. n.success && n.success(e)
  1410. }, error: function (e, t) {
  1411. n.error && n.error(e, t)
  1412. }
  1413. }), o.setRequestParam(i), o.submitRequest()
  1414. }, le.prototype.recordSearch = function (e, r) {
  1415. var s = "", o = "", i = r.iChannelID, a = r.iStreamType, c = r.szStartTime.replace(" ", "T") + "Z",
  1416. u = r.szEndTime.replace(" ", "T") + "Z";
  1417. s = E(this.CGI.recordSearch, e.szHttpProtocol, e.szIP, e.iCGIPort), o = "<?xml version='1.0' encoding='UTF-8'?><CMSearchDescription><searchID>" + new t + "</searchID><trackList><trackID>" + (100 * i + a) + "</trackID></trackList><timeSpanList><timeSpan><startTime>" + c + "</startTime><endTime>" + u + "</endTime></timeSpan></timeSpanList><maxResults>40</maxResults><searchResultPostion>" + r.iSearchPos + "</searchResultPostion><metadataList><metadataDescriptor>//metadata.ISAPI.org/VideoMotion</metadataDescriptor></metadataList></CMSearchDescription>";
  1418. var l = new ue, d = {type: "POST", url: s, auth: e.szAuth, data: o, success: null, error: null};
  1419. f.extend(d, r), f.extend(d, {
  1420. success: function (e) {
  1421. var t = [];
  1422. t.push("<CMSearchResult>"), t.push("<responseStatus>" + n.$XML(e).find("responseStatus").eq(0).text() + "</responseStatus>"), t.push("<responseStatusStrg>" + n.$XML(e).find("responseStatusStrg").eq(0).text() + "</responseStatusStrg>"), t.push("<numOfMatches>" + n.$XML(e).find("numOfMatches").eq(0).text() + "</numOfMatches>"), t.push("<matchList>");
  1423. for (var s = n.$XML(e).find("searchMatchItem", !0), o = 0, i = s.length; i > o; o++) {
  1424. var a = s[o];
  1425. t.push("<searchMatchItem>"), t.push("<trackID>" + n.$XML(a).find("trackID").eq(0).text() + "</trackID>"), t.push("<startTime>" + n.$XML(a).find("startTime").eq(0).text() + "</startTime>"), t.push("<endTime>" + n.$XML(a).find("endTime").eq(0).text() + "</endTime>"), t.push("<playbackURI>" + f.escape(n.$XML(a).find("playbackURI").eq(0).text()) + "</playbackURI>"), t.push("<metadataDescriptor>" + n.$XML(a).find("metadataDescriptor").eq(0).text().split("/")[1] + "</metadataDescriptor>"), t.push("</searchMatchItem>")
  1426. }
  1427. t.push("</matchList>"), t.push("</CMSearchResult>"), e = f.loadXML(t.join("")), r.success && r.success(e)
  1428. }, error: function (e, t) {
  1429. r.error && r.error(e, t)
  1430. }
  1431. }), l.setRequestParam(d), l.submitRequest()
  1432. }, le.prototype.startPlayback = function (e, t) {
  1433. var n = t.iWndIndex, r = "", s = t.szStartTime, o = t.szEndTime, i = e.szIP;
  1434. if ("rtsp://" === t.urlProtocol && (i = Z(i)), r = re() ? E(t.cgi, t.urlProtocol, i, t.iPort, t.iChannelID) : E(t.cgi, t.urlProtocol, i, t.iPort, t.iChannelID, s, o), !B(t.oTransCodeParam)) {
  1435. var a = ne(t.oTransCodeParam);
  1436. if ("" == a) return -1;
  1437. c.HWP_SetTrsPlayBackParam(n, a)
  1438. }
  1439. var u = function () {
  1440. var r = new ce;
  1441. r.iIndex = n, r.szIP = e.szIP, r.iCGIPort = e.iCGIPort, r.szDeviceIdentify = e.szDeviceIdentify, r.iChannelID = t.iChannelID, r.iPlayStatus = D, p.push(r)
  1442. };
  1443. if (re()) {
  1444. var l = new Promise(function (t, i) {
  1445. c.JS_Play(r, {session: e.szAuth}, n, s, o).then(function () {
  1446. u(), t()
  1447. }, function () {
  1448. i()
  1449. })
  1450. });
  1451. return l
  1452. }
  1453. var d = c.HWP_Play(r, e.szAuth, n, s, o);
  1454. return 0 == d && u(), d
  1455. }, le.prototype.reversePlayback = function (e, t) {
  1456. var n = t.iWndIndex, r = t.szStartTime, s = t.szEndTime, o = e.szIP;
  1457. "rtsp://" === t.urlProtocol && (o = Z(o));
  1458. var i = E(t.cgi, t.urlProtocol, o, t.iPort, t.iChannelID, r, s),
  1459. a = c.HWP_ReversePlay(i, e.szAuth, n, r, s);
  1460. if (0 == a) {
  1461. var u = new ce;
  1462. u.iIndex = n, u.szIP = e.szIP, u.iCGIPort = e.iCGIPort, u.szDeviceIdentify = e.szDeviceIdentify, u.iChannelID = t.iChannelID, u.iPlayStatus = b, p.push(u)
  1463. }
  1464. return a
  1465. }, le.prototype.startDownloadRecord = function (e, t) {
  1466. var n = -1, r = E(this.CGI.startDownloadRecord, e.szHttpProtocol, e.szIP, e.iCGIPort),
  1467. s = "<?xml version='1.0' encoding='UTF-8'?><downloadRequest><playbackURI> " + f.escape(t.szPlaybackURI) + "</playbackURI></downloadRequest>";
  1468. return re() ? (r = se(r), n = c.JS_StartDownload(r, e.szAuth, t.szFileName, s)) : n = c.HWP_StartDownload(r, e.szAuth, t.szFileName, s, t.bDateDir), n
  1469. }, le.prototype.exportDeviceConfig = function (e) {
  1470. var t = E(this.CGI.deviceConfig, e.szHttpProtocol, e.szIP, e.iCGIPort);
  1471. return c.HWP_ExportDeviceConfig(t, e.szAuth, "", 0)
  1472. }, le.prototype.importDeviceConfig = function (e, t) {
  1473. var n = E(this.CGI.deviceConfig, e.szHttpProtocol, e.szIP, e.iCGIPort);
  1474. return c.HWP_ImportDeviceConfig(n, e.szAuth, t.szFileName, 0)
  1475. }, le.prototype.restart = function (e, t) {
  1476. var n = E(this.CGI.restart, e.szHttpProtocol, e.szIP, e.iCGIPort), r = new ue,
  1477. s = {type: "PUT", url: n, auth: e.szAuth, success: null, error: null};
  1478. f.extend(s, t), f.extend(s, {
  1479. success: function (e) {
  1480. t.success && t.success(e)
  1481. }, error: function (e, n) {
  1482. t.error && t.error(e, n)
  1483. }
  1484. }), r.setRequestParam(s), r.submitRequest()
  1485. }, le.prototype.restore = function (e, t, n) {
  1486. var r = E(this.CGI.restore, e.szHttpProtocol, e.szIP, e.iCGIPort, t), s = new ue,
  1487. o = {type: "PUT", url: r, auth: e.szAuth, success: null, error: null};
  1488. f.extend(o, n), f.extend(o, {
  1489. success: function (e) {
  1490. n.success && n.success(e)
  1491. }, error: function (e, t) {
  1492. n.error && n.error(e, t)
  1493. }
  1494. }), s.setRequestParam(o), s.submitRequest()
  1495. }, le.prototype.startUpgrade = function (e, t) {
  1496. var n = E(this.CGI.startUpgrade.upgrade, e.szHttpProtocol, e.szIP, e.iCGIPort),
  1497. r = E(this.CGI.startUpgrade.status, e.szHttpProtocol, e.szIP, e.iCGIPort);
  1498. return c.HWP_StartUpgrade(n, r, e.szAuth, t.szFileName)
  1499. }, le.prototype.set3DZoom = function (e, t, r, s) {
  1500. var o = t.iChannelID, i = "";
  1501. i = o <= e.iAnalogChannelNum ? E(this.CGI.set3DZoom.analog, e.szHttpProtocol, e.szIP, e.iCGIPort, t.iChannelID) : t.bShttpIPChannel ? E(this.CGI.set3DZoom.digital, e.szHttpProtocol, e.szIP, e.iCGIPort, t.iChannelID - e.oStreamCapa.iIpChanBase + 1 + e.iAnalogChannelNum) : E(this.CGI.set3DZoom.digital, e.szHttpProtocol, e.szIP, e.iCGIPort, t.iChannelID);
  1502. var a = f.loadXML(r),
  1503. c = parseInt(n.$XML(a).find("StartPoint").eq(0).find("positionX").eq(0).text(), 10),
  1504. u = parseInt(n.$XML(a).find("StartPoint").eq(0).find("positionY").eq(0).text(), 10),
  1505. l = parseInt(n.$XML(a).find("EndPoint").eq(0).find("positionX").eq(0).text(), 10),
  1506. d = parseInt(n.$XML(a).find("EndPoint").eq(0).find("positionY").eq(0).text(), 10),
  1507. p = "<?xml version='1.0' encoding='UTF-8'?><Position3D><StartPoint><positionX>" + c + "</positionX><positionY>" + (255 - u) + "</positionY></StartPoint><EndPoint><positionX>" + l + "</positionX><positionY>" + (255 - d) + "</positionY></EndPoint></Position3D>",
  1508. P = new ue, h = {type: "PUT", url: i, data: p, auth: e.szAuth, success: null, error: null};
  1509. f.extend(h, s), f.extend(h, {
  1510. success: function (e) {
  1511. s.success && s.success(e)
  1512. }, error: function (e, t) {
  1513. s.error && s.error(e, t)
  1514. }
  1515. }), P.setRequestParam(h), P.submitRequest()
  1516. }, le.prototype.getSDKCapa = function (e, t) {
  1517. var n = E(this.CGI.SDKCapabilities, e.szHttpProtocol, e.szIP, e.iCGIPort), r = new ue,
  1518. s = {type: "GET", url: n, auth: e.szAuth, success: null, error: null};
  1519. f.extend(s, t), f.extend(s, {
  1520. success: function (e) {
  1521. t.success && t.success(e)
  1522. }, error: function (e, n) {
  1523. t.error && t.error(e, n)
  1524. }
  1525. }), r.setRequestParam(s), r.submitRequest()
  1526. }, le.prototype.deviceCapturePic = function (e, t, n, r) {
  1527. var t = 100 * t + 1, s = -1,
  1528. o = E(this.CGI.deviceCapture.channels, e.szHttpProtocol, e.szIP, e.iCGIPort, t), i = [];
  1529. if (f.isInt(r.iResolutionWidth) && i.push("videoResolutionWidth=" + r.iResolutionWidth), f.isInt(r.iResolutionHeight) && i.push("videoResolutionHeight=" + r.iResolutionHeight), i.length > 0 && (o += "?" + i.join("&")), re()) {
  1530. var a = function (e, t) {
  1531. var n = ".jpg";
  1532. return $("body").append('<a id="jsplugin_download_a" href="' + e + '" download=' + t + n + '><li id="jsplugin_download_li"></li></a>'), $("#jsplugin_download_li").trigger("click"), $("#jsplugin_download_a").remove(), 0
  1533. };
  1534. o = se(o), s = a(o, n)
  1535. } else s = c.HWP_DeviceCapturePic(o, e.szAuth, n, r.bDateDir);
  1536. return s
  1537. }, le.prototype.getSessionCap = function (e, t, n, r, s) {
  1538. var o = "";
  1539. o = 2 == t ? "https://" : "http://";
  1540. var i = E(this.CGI.sessionCap, o, e, n, encodeURIComponent(r)), a = new ue,
  1541. c = {type: "GET", url: i, auth: "", success: null, error: null};
  1542. f.extend(c, s), f.extend(c, {
  1543. success: function (e) {
  1544. s.success && s.success(e)
  1545. }, error: function (e, t) {
  1546. s.error && s.error(e, t)
  1547. }
  1548. }), a.setRequestParam(c), a.submitRequest()
  1549. }, le.prototype.sessionLogin = function (e, t, r, s, o, i, a) {
  1550. var c = "";
  1551. c = 2 == t ? "https://" : "http://";
  1552. var u = E(this.CGI.sessionLogin, c, e, r), l = n.$XML(i).find("sessionID").eq(0).text(),
  1553. d = n.$XML(i).find("challenge").eq(0).text(),
  1554. p = parseInt(n.$XML(i).find("iterations").eq(0).text(), 10), P = !1, h = "";
  1555. n.$XML(i).find("isIrreversible", !0).length > 0 && (P = "true" === n.$XML(i).find("isIrreversible").eq(0).text(), h = n.$XML(i).find("salt").eq(0).text());
  1556. var I = "";
  1557. if (P) {
  1558. I = f.sha256(s + h + o), I = f.sha256(I + d);
  1559. for (var m = 2; p > m; m++) I = f.sha256(I)
  1560. } else {
  1561. I = f.sha256(o) + d;
  1562. for (var m = 1; p > m; m++) I = f.sha256(I)
  1563. }
  1564. var C = "<SessionLogin>";
  1565. C += "<userName>" + f.escape(s) + "</userName>", C += "<password>" + I + "</password>", C += "<sessionID>" + l + "</sessionID>", C += "</SessionLogin>";
  1566. var S = new ue, v = {type: "POST", url: u, data: C, auth: "", success: null, error: null};
  1567. f.extend(v, a), f.extend(v, {
  1568. success: function (e) {
  1569. a.success && a.success(e)
  1570. }, error: function (e, t) {
  1571. a.error && a.error(e, t)
  1572. }
  1573. }), S.setRequestParam(v), S.submitRequest()
  1574. }, le.prototype.sessionHeartbeat = function (e, t) {
  1575. var n = E(this.CGI.sessionHeartbeat, e.szHttpProtocol, e.szIP, e.iCGIPort), r = new ue,
  1576. s = {type: "PUT", url: n, auth: e.szAuth, success: null, error: null};
  1577. f.extend(s, t), f.extend(s, {
  1578. success: function (e) {
  1579. t.success && t.success(e)
  1580. }, error: function (e, n) {
  1581. t.error && t.error(e, n)
  1582. }
  1583. }), r.setRequestParam(s), r.submitRequest()
  1584. }, le.prototype.sessionLogout = function (e, t) {
  1585. var n = E(this.CGI.sessionLogout, e.szHttpProtocol, e.szIP, e.iCGIPort), r = new ue,
  1586. s = {type: "PUT", url: n, auth: e.szAuth, success: null, error: null};
  1587. f.extend(s, t), f.extend(s, {
  1588. success: function (e) {
  1589. t.success && t.success(e)
  1590. }, error: function (e, n) {
  1591. t.error && t.error(e, n)
  1592. }
  1593. }), r.setRequestParam(s), r.submitRequest()
  1594. }, le.prototype.getSystemCapa = function (e, t) {
  1595. var n = E(this.CGI.systemCapabilities, e.szHttpProtocol, e.szIP, e.iCGIPort), r = new ue,
  1596. s = {type: "GET", url: n, auth: e.szAuth, success: null, error: null};
  1597. f.extend(s, t), f.extend(s, {
  1598. success: function (e) {
  1599. t.success && t.success(e)
  1600. }, error: function (e, n) {
  1601. t.error && t.error(e, n)
  1602. }
  1603. }), r.setRequestParam(s), r.submitRequest()
  1604. };
  1605. var de = function () {
  1606. };
  1607. de.prototype.CGI = {
  1608. login: "%s%s:%s/PSIA/Custom/SelfExt/userCheck",
  1609. getAudioInfo: "%s%s:%s/PSIA/Custom/SelfExt/TwoWayAudio/channels",
  1610. getDeviceInfo: "%s%s:%s/PSIA/System/deviceInfo",
  1611. getAnalogChannelInfo: "%s%s:%s/PSIA/System/Video/inputs/channels",
  1612. getDigitalChannel: "%s%s:%s/PSIA/Custom/SelfExt/ContentMgmt/DynVideo/inputs/channels",
  1613. getDigitalChannelInfo: "%s%s:%s/PSIA/Custom/SelfExt/ContentMgmt/DynVideo/inputs/channels/status",
  1614. getZeroChannelInfo: "%s%s:%s/PSIA/Custom/SelfExt/ContentMgmt/ZeroVideo/channels",
  1615. getStreamChannels: {
  1616. analog: "%s%s:%s/PSIA/Streaming/channels",
  1617. digital: "%s%s:%s/PSIA/Custom/SelfExt/ContentMgmt/DynStreaming/channels"
  1618. },
  1619. getStreamDynChannels: "%s%s:%s/PSIA/Custom/SelfExt/ContentMgmt/DynStreaming/channels",
  1620. startRealPlay: {
  1621. channels: "%s%s:%s/PSIA/streaming/channels/%s",
  1622. zeroChannels: "%s%s:%s/PSIA/Custom/SelfExt/ContentMgmt/ZeroStreaming/channels/%s"
  1623. },
  1624. startVoiceTalk: {
  1625. open: "%s%s:%s/PSIA/Custom/SelfExt/TwoWayAudio/channels/%s/open",
  1626. close: "%s%s:%s/PSIA/Custom/SelfExt/TwoWayAudio/channels/%s/close",
  1627. audioData: "%s%s:%s/PSIA/Custom/SelfExt/TwoWayAudio/channels/%s/audioData"
  1628. },
  1629. ptzControl: "%s%s:%s/PSIA/PTZ/channels/%s/continuous",
  1630. ptzAutoControl: "%s%s:%s/PSIA/Custom/SelfExt/PTZ/channels/%s/autoptz",
  1631. setPreset: "%s%s:%s/PSIA/PTZ/channels/%s/presets/%s",
  1632. goPreset: "%s%s:%s/PSIA/PTZ/channels/%s/presets/%s/goto",
  1633. ptzFocus: "%s%s:%s/PSIA/System/Video/inputs/channels/%s/focus",
  1634. ptzIris: "%s%s:%s/PSIA/System/Video/inputs/channels/%s/iris",
  1635. getNetworkBond: "%s%s:%s/PSIA/Custom/SelfExt/Bond",
  1636. getNetworkInterface: "%s%s:%s/PSIA/System/Network/interfaces",
  1637. getUPnPPortStatus: "%s%s:%s/PSIA/Custom/SelfExt/UPnP/ports/status",
  1638. getPPPoEStatus: "%s%s:%s/PSIA/Custom/SelfExt/PPPoE/1/status",
  1639. getPortInfo: "%s%s:%s/PSIA/Security/AAA/adminAccesses",
  1640. recordSearch: "%s%s:%s/PSIA/ContentMgmt/search",
  1641. startPlayback: "%s%s:%s/PSIA/streaming/tracks/%s?starttime=%s&endtime=%s",
  1642. startDownloadRecord: "%s%s:%s/PSIA/Custom/SelfExt/ContentMgmt/download",
  1643. deviceConfig: "%s%s:%s/PSIA/System/configurationData",
  1644. restart: "%s%s:%s/PSIA/System/reboot",
  1645. restore: "%s%s:%s/PSIA/System/factoryReset?mode=%s",
  1646. startUpgrade: {
  1647. upgrade: "%s%s:%s/PSIA/System/updateFirmware",
  1648. status: "%s%s:%s/PSIA/Custom/SelfExt/upgradeStatus"
  1649. },
  1650. set3DZoom: "%s%s:%s/PSIA/Custom/SelfExt/PTZ/channels/%s/Set3DZoom",
  1651. deviceCapture: {channels: "%s%s:%s/PSIA/Streaming/channels/%s/picture"},
  1652. systemCapabilities: "%s%s:%s/PSIA/System/capabilities"
  1653. }, de.prototype.login = function (e, t, r, s) {
  1654. var o = 2 == s.protocol ? "https://" : "http://", i = E(this.CGI.login, o, e, t), a = new ue,
  1655. c = {type: "GET", url: i, auth: r, success: null, error: null};
  1656. f.extend(c, s), f.extend(c, {
  1657. success: function (e) {
  1658. "200" == n.$XML(e).find("statusValue").eq(0).text() ? s.success && s.success(e) : s.error && s.error(401, e)
  1659. }, error: function (e, t) {
  1660. s.error && s.error(e, t)
  1661. }
  1662. }), a.setRequestParam(c), a.submitRequest()
  1663. }, de.prototype.getAudioInfo = function (e, t) {
  1664. var n = E(this.CGI.getAudioInfo, e.szHttpProtocol, e.szIP, e.iCGIPort), r = new ue,
  1665. s = {type: "GET", url: n, auth: e.szAuth, success: null, error: null};
  1666. f.extend(s, t), f.extend(s, {
  1667. success: function (e) {
  1668. t.success && t.success(e)
  1669. }, error: function (e, n) {
  1670. t.error && t.error(e, n)
  1671. }
  1672. }), r.setRequestParam(s), r.submitRequest()
  1673. }, de.prototype.getDeviceInfo = function (e, t) {
  1674. var r = E(this.CGI.getDeviceInfo, e.szHttpProtocol, e.szIP, e.iCGIPort), s = new ue,
  1675. o = {type: "GET", url: r, auth: e.szAuth, success: null, error: null};
  1676. f.extend(o, t), f.extend(o, {
  1677. success: function (e) {
  1678. var r = [];
  1679. r.push("<DeviceInfo>"), r.push("<deviceName>" + f.escape(n.$XML(e).find("deviceName").eq(0).text()) + "</deviceName>"), r.push("<deviceID>" + n.$XML(e).find("deviceID").eq(0).text() + "</deviceID>"), r.push("<deviceType>" + n.$XML(e).find("deviceDescription").eq(0).text() + "</deviceType>"), r.push("<model>" + n.$XML(e).find("model").eq(0).text() + "</model>"), r.push("<serialNumber>" + n.$XML(e).find("serialNumber").eq(0).text() + "</serialNumber>"), r.push("<macAddress>" + n.$XML(e).find("macAddress").eq(0).text() + "</macAddress>"), r.push("<firmwareVersion>" + n.$XML(e).find("firmwareVersion").eq(0).text() + "</firmwareVersion>"), r.push("<firmwareReleasedDate>" + n.$XML(e).find("firmwareReleasedDate").eq(0).text() + "</firmwareReleasedDate>"), r.push("<encoderVersion>" + n.$XML(e).find("logicVersion").eq(0).text() + "</encoderVersion>"), r.push("<encoderReleasedDate>" + n.$XML(e).find("logicReleasedDate").eq(0).text() + "</encoderReleasedDate>"), r.push("</DeviceInfo>"), e = f.loadXML(r.join("")), t.success && t.success(e)
  1680. }, error: function (e, n) {
  1681. t.error && t.error(e, n)
  1682. }
  1683. }), s.setRequestParam(o), s.submitRequest()
  1684. }, de.prototype.getSystemCapa = function (e, t) {
  1685. var n = E(this.CGI.systemCapabilities, e.szHttpProtocol, e.szIP, e.iCGIPort), r = new ue,
  1686. s = {type: "GET", url: n, auth: e.szAuth, success: null, error: null};
  1687. f.extend(s, t), f.extend(s, {
  1688. success: function (e) {
  1689. t.success && t.success(e)
  1690. }, error: function (e, n) {
  1691. t.error && t.error(e, n)
  1692. }
  1693. }), r.setRequestParam(s), r.submitRequest()
  1694. }, de.prototype.getAnalogChannelInfo = function (e, t) {
  1695. var r = E(this.CGI.getAnalogChannelInfo, e.szHttpProtocol, e.szIP, e.iCGIPort), s = new ue,
  1696. o = {type: "GET", url: r, auth: e.szAuth, success: null, error: null};
  1697. f.extend(o, t), f.extend(o, {
  1698. success: function (e) {
  1699. var r = [];
  1700. r.push("<VideoInputChannelList>");
  1701. for (var s = n.$XML(e).find("VideoInputChannel", !0), o = 0, i = s.length; i > o; o++) {
  1702. var a = s[o];
  1703. r.push("<VideoInputChannel>"), r.push("<id>" + n.$XML(a).find("id").eq(0).text() + "</id>"), r.push("<inputPort>" + n.$XML(a).find("inputPort").eq(0).text() + "</inputPort>"), r.push("<name>" + f.escape(n.$XML(a).find("name").eq(0).text()) + "</name>"), r.push("<videoFormat>" + n.$XML(a).find("videoFormat").eq(0).text() + "</videoFormat>"), r.push("</VideoInputChannel>")
  1704. }
  1705. r.push("</VideoInputChannelList>"), e = f.loadXML(r.join("")), t.success && t.success(e)
  1706. }, error: function (e, n) {
  1707. t.error && t.error(e, n)
  1708. }
  1709. }), s.setRequestParam(o), s.submitRequest()
  1710. }, de.prototype.getDigitalChannel = function (e, t) {
  1711. var r = E(this.CGI.getDigitalChannel, e.szHttpProtocol, e.szIP, e.iCGIPort), s = new ue,
  1712. o = {type: "GET", url: r, auth: e.szAuth, success: null, error: null};
  1713. f.extend(o, t), f.extend(o, {
  1714. success: function (e) {
  1715. var r = [];
  1716. r.push("<InputProxyChannelList>");
  1717. for (var s = n.$XML(e).find("DynVideoInputChannel", !0), o = 0, i = s.length; i > o; o++) {
  1718. var a = s[o];
  1719. r.push("<InputProxyChannel>"), r.push("<id>" + n.$XML(a).find("id").eq(0).text() + "</id>"), r.push("<name>" + f.escape(n.$XML(a).find("name").eq(0).text()) + "</name>"), r.push("</InputProxyChannel>")
  1720. }
  1721. r.push("</InputProxyChannelList>"), e = f.loadXML(r.join("")), t.success && t.success(e)
  1722. }, error: function (e, n) {
  1723. t.error && t.error(e, n)
  1724. }
  1725. }), s.setRequestParam(o), s.submitRequest()
  1726. }, de.prototype.getDigitalChannelInfo = function (e, t) {
  1727. var r = null, s = {};
  1728. if (this.getDigitalChannel(e, {
  1729. async: !1, success: function (e) {
  1730. r = e;
  1731. for (var t = n.$XML(r).find("InputProxyChannel", !0), o = 0, i = t.length; i > o; o++) {
  1732. var a = t[o], c = n.$XML(a).find("id").eq(0).text(),
  1733. u = n.$XML(a).find("name").eq(0).text();
  1734. s[c] = u
  1735. }
  1736. }, error: function (e, n) {
  1737. t.error && t.error(e, n)
  1738. }
  1739. }), null !== r) {
  1740. var o = E(this.CGI.getDigitalChannelInfo, e.szHttpProtocol, e.szIP, e.iCGIPort), i = new ue,
  1741. a = {type: "GET", url: o, auth: e.szAuth, success: null, error: null};
  1742. f.extend(a, t), f.extend(a, {
  1743. success: function (e) {
  1744. var r = [];
  1745. r.push("<InputProxyChannelStatusList>");
  1746. for (var o = n.$XML(e).find("DynVideoInputChannelStatus", !0), i = 0, a = o.length; a > i; i++) {
  1747. var c = o[i], u = n.$XML(c).find("id").eq(0).text();
  1748. r.push("<InputProxyChannelStatus>"), r.push("<id>" + u + "</id>"), r.push("<sourceInputPortDescriptor>"), r.push("<proxyProtocol>" + n.$XML(c).find("adminProtocol").eq(0).text() + "</proxyProtocol>"), r.push("<addressingFormatType>" + n.$XML(c).find("addressingFormatType").eq(0).text() + "</addressingFormatType>"), r.push("<ipAddress>" + n.$XML(c).find("ipAddress").eq(0).text() + "</ipAddress>"), r.push("<managePortNo>" + n.$XML(c).find("adminPortNo").eq(0).text() + "</managePortNo>"), r.push("<srcInputPort>" + n.$XML(c).find("srcInputPort").eq(0).text() + "</srcInputPort>"), r.push("<userName>" + f.escape(n.$XML(c).find("userName").eq(0).text()) + "</userName>"), r.push("<streamType>" + n.$XML(c).find("streamType").eq(0).text() + "</streamType>"), r.push("<online>" + n.$XML(c).find("online").eq(0).text() + "</online>"), r.push("<name>" + f.escape(s[u]) + "</name>"), r.push("</sourceInputPortDescriptor>"), r.push("</InputProxyChannelStatus>")
  1749. }
  1750. r.push("</InputProxyChannelStatusList>"), e = f.loadXML(r.join("")), t.success && t.success(e)
  1751. }, error: function (e, n) {
  1752. t.error && t.error(e, n)
  1753. }
  1754. }), i.setRequestParam(a), i.submitRequest()
  1755. }
  1756. }, de.prototype.getZeroChannelInfo = function (e, t) {
  1757. var n = E(this.CGI.getZeroChannelInfo, e.szHttpProtocol, e.szIP, e.iCGIPort), r = new ue,
  1758. s = {type: "GET", url: n, auth: e.szAuth, success: null, error: null};
  1759. f.extend(s, t), f.extend(s, {
  1760. success: function (e) {
  1761. t.success && t.success(e)
  1762. }, error: function (e, n) {
  1763. t.error && t.error(e, n)
  1764. }
  1765. }), r.setRequestParam(s), r.submitRequest()
  1766. }, de.prototype.getPPPoEStatus = function (e, t) {
  1767. var n = E(this.CGI.getPPPoEStatus, e.szHttpProtocol, e.szIP, e.iCGIPort), r = new ue,
  1768. s = {type: "GET", url: n, auth: e.szAuth, success: null, error: null};
  1769. f.extend(s, t), f.extend(s, {
  1770. success: function (e) {
  1771. t.success && t.success(e)
  1772. }, error: function (e, n) {
  1773. t.error && t.error(e, n)
  1774. }
  1775. }), r.setRequestParam(s), r.submitRequest()
  1776. }, de.prototype.getUPnPPortStatus = function (e, t) {
  1777. var n = E(this.CGI.getUPnPPortStatus, e.szHttpProtocol, e.szIP, e.iCGIPort), r = new ue,
  1778. s = {type: "GET", url: n, auth: e.szAuth, success: null, error: null};
  1779. f.extend(s, t), f.extend(s, {
  1780. success: function (e) {
  1781. t.success && t.success(e)
  1782. }, error: function (e, n) {
  1783. t.error && t.error(e, n)
  1784. }
  1785. }), r.setRequestParam(s), r.submitRequest()
  1786. }, de.prototype.getNetworkBond = function (e, t) {
  1787. var n = E(this.CGI.getNetworkBond, e.szHttpProtocol, e.szIP, e.iCGIPort), r = new ue,
  1788. s = {type: "GET", url: n, auth: e.szAuth, success: null, error: null};
  1789. f.extend(s, t), f.extend(s, {
  1790. success: function (e) {
  1791. t.success && t.success(e)
  1792. }, error: function (e, n) {
  1793. t.error && t.error(e, n)
  1794. }
  1795. }), r.setRequestParam(s), r.submitRequest()
  1796. }, de.prototype.getNetworkInterface = function (e, t) {
  1797. var n = E(this.CGI.getNetworkInterface, e.szHttpProtocol, e.szIP, e.iCGIPort), r = new ue,
  1798. s = {type: "GET", url: n, auth: e.szAuth, success: null, error: null};
  1799. f.extend(s, t), f.extend(s, {
  1800. success: function (e) {
  1801. t.success && t.success(e)
  1802. }, error: function (e, n) {
  1803. t.error && t.error(e, n)
  1804. }
  1805. }), r.setRequestParam(s), r.submitRequest()
  1806. }, de.prototype.getPortInfo = function (e, t) {
  1807. var r = E(this.CGI.getPortInfo, e.szHttpProtocol, e.szIP, e.iCGIPort), s = new ue,
  1808. o = {type: "GET", url: r, auth: e.szAuth, success: null, error: null};
  1809. f.extend(o, t), f.extend(o, {
  1810. success: function (r) {
  1811. var s = [];
  1812. s.push("<AdminAccessProtocolList>");
  1813. for (var o = n.$XML(r).find("AdminAccessProtocol", !0), i = 0, a = o.length; a > i; i++) {
  1814. o[i];
  1815. s.push("<AdminAccessProtocol>"), s.push("<id>" + n.$XML(r).find("id").eq(0).text() + "</id>"), s.push("<enabled>" + n.$XML(r).find("enabled").eq(0).text() + "</enabled>"), s.push("<protocol>" + n.$XML(r).find("protocol").eq(0).text().toUpperCase() + "</protocol>"), s.push("<portNo>" + n.$XML(r).find("portNo").eq(0).text() + "</portNo>"), s.push("</AdminAccessProtocol>")
  1816. }
  1817. I.getStreamChannels(e, {
  1818. async: !1, success: function (r) {
  1819. if (n.$XML(r).find("rtspPortNo", !0).length > 0) {
  1820. var o = parseInt(n.$XML(r).find("rtspPortNo").eq(0).text(), 10);
  1821. s.push("<AdminAccessProtocol>"), s.push("<id>4</id>"), s.push("<enabled>true</enabled>"), s.push("<protocol>RTSP</protocol>"), s.push("<portNo>" + o + "</portNo>"), s.push("</AdminAccessProtocol>"), s.push("</AdminAccessProtocolList>");
  1822. var i = f.loadXML(s.join(""));
  1823. t.success && t.success(i)
  1824. } else I.getStreamDynChannels(e, {
  1825. async: !1, success: function (e) {
  1826. if (n.$XML(e).find("rtspPortNo", !0).length > 0) {
  1827. var r = parseInt(n.$XML(e).find("rtspPortNo").eq(0).text(), 10);
  1828. s.push("<AdminAccessProtocol>"), s.push("<id>4</id>"), s.push("<enabled>true</enabled>"), s.push("<protocol>RTSP</protocol>"), s.push("<portNo>" + r + "</portNo>"), s.push("</AdminAccessProtocol>"), s.push("</AdminAccessProtocolList>");
  1829. var o = f.loadXML(s.join(""));
  1830. t.success && t.success(o)
  1831. }
  1832. }, error: function () {
  1833. t.error && t.error()
  1834. }
  1835. })
  1836. }, error: function () {
  1837. t.error && t.error()
  1838. }
  1839. })
  1840. }, error: function () {
  1841. var r = [];
  1842. r.push("<AdminAccessProtocolList>"), I.getStreamChannels(e, {
  1843. async: !1, success: function (s) {
  1844. if (n.$XML(s).find("rtspPortNo", !0).length > 0) {
  1845. var o = parseInt(n.$XML(s).find("rtspPortNo").eq(0).text(), 10);
  1846. r.push("<AdminAccessProtocol>"), r.push("<id>4</id>"), r.push("<enabled>true</enabled>"), r.push("<protocol>RTSP</protocol>"), r.push("<portNo>" + o + "</portNo>"), r.push("</AdminAccessProtocol>"), r.push("</AdminAccessProtocolList>");
  1847. var i = f.loadXML(r.join(""));
  1848. t.success && t.success(i)
  1849. } else I.getStreamDynChannels(e, {
  1850. async: !1, success: function (e) {
  1851. if (n.$XML(e).find("rtspPortNo", !0).length > 0) {
  1852. var s = parseInt(n.$XML(e).find("rtspPortNo").eq(0).text(), 10);
  1853. r.push("<AdminAccessProtocol>"), r.push("<id>4</id>"), r.push("<enabled>true</enabled>"), r.push("<protocol>RTSP</protocol>"), r.push("<portNo>" + s + "</portNo>"), r.push("</AdminAccessProtocol>"), r.push("</AdminAccessProtocolList>");
  1854. var o = f.loadXML(r.join(""));
  1855. t.success && t.success(o)
  1856. }
  1857. }, error: function () {
  1858. t.error && t.error()
  1859. }
  1860. })
  1861. }, error: function () {
  1862. t.error && t.error()
  1863. }
  1864. })
  1865. }
  1866. }), s.setRequestParam(o), s.submitRequest()
  1867. }, de.prototype.getStreamChannels = function (e, t) {
  1868. if (0 != e.iAnalogChannelNum) var n = E(this.CGI.getStreamChannels.analog, e.szHttpProtocol, e.szIP, e.iCGIPort); else var n = E(this.CGI.getStreamChannels.digital, e.szHttpProtocol, e.szIP, e.iCGIPort);
  1869. var r = new ue, s = {type: "GET", url: n, auth: e.szAuth, success: null, error: null};
  1870. f.extend(s, t), f.extend(s, {
  1871. success: function (e) {
  1872. t.success && t.success(e)
  1873. }, error: function (e, n) {
  1874. t.error && t.error(e, n)
  1875. }
  1876. }), r.setRequestParam(s), r.submitRequest()
  1877. }, de.prototype.getStreamDynChannels = function (e, t) {
  1878. var n = E(this.CGI.getStreamDynChannels, e.szHttpProtocol, e.szIP, e.iCGIPort), r = new ue,
  1879. s = {type: "GET", url: n, auth: e.szAuth, success: null, error: null};
  1880. f.extend(s, t), f.extend(s, {
  1881. success: function (e) {
  1882. t.success && t.success(e)
  1883. }, error: function (e, n) {
  1884. t.error && t.error(e, n)
  1885. }
  1886. }), r.setRequestParam(s), r.submitRequest()
  1887. }, de.prototype.startRealPlay = function (e, t) {
  1888. var n = 100 * t.iChannelID + t.iStreamType, r = "", s = e.szIP;
  1889. "rtsp://" === t.urlProtocol && (s = Z(s)), r = t.bZeroChannel ? E(t.cgi.zeroChannels, t.urlProtocol, s, t.iPort, n) : E(t.cgi.channels, t.urlProtocol, s, t.iPort, n);
  1890. var o = c.HWP_Play(r, e.szAuth, t.iWndIndex, "", "");
  1891. if (0 == o) {
  1892. var i = new ce;
  1893. i.iIndex = t.iWndIndex, i.szIP = e.szIP, i.iCGIPort = e.iCGIPort, i.szDeviceIdentify = e.szDeviceIdentify, i.iChannelID = t.iChannelID, i.iPlayStatus = x, p.push(i)
  1894. }
  1895. return o
  1896. }, de.prototype.startVoiceTalk = function (e, t) {
  1897. var n = E(this.CGI.startVoiceTalk.open, e.szHttpProtocol, e.szIP, e.iCGIPort, t),
  1898. r = E(this.CGI.startVoiceTalk.close, e.szHttpProtocol, e.szIP, e.iCGIPort, t),
  1899. s = E(this.CGI.startVoiceTalk.audioData, e.szHttpProtocol, e.szIP, e.iCGIPort, t),
  1900. o = c.HWP_StartVoiceTalkEx(n, r, s, e.szAuth, e.iAudioTypeoDeviceInfo.m_iAudioBitRate, e.m_iAudioSamplingRate);
  1901. return o
  1902. }, de.prototype.ptzAutoControl = function (e, t, n, r) {
  1903. var s = n.iChannelID, o = "", i = "";
  1904. if (r.iPTZSpeed = r.iPTZSpeed < 7 ? 15 * r.iPTZSpeed : 100, t && (r.iPTZSpeed = 0), e.szDeviceType != w) o = E(this.CGI.ptzAutoControl, e.szHttpProtocol, e.szIP, e.iCGIPort, s), i = "<?xml version='1.0' encoding='UTF-8'?><PTZData><pan>" + r.iPTZSpeed + "</pan><tilt>0</tilt></PTZData>"; else {
  1905. var a = 99;
  1906. t && (a = 96), o = E(this.CGI.goPreset, e.szHttpProtocol, e.szIP, e.iCGIPort, s, a)
  1907. }
  1908. var c = new ue,
  1909. u = {type: "PUT", url: o, async: !1, auth: e.szAuth, data: i, success: null, error: null}, l = this;
  1910. f.extend(u, r), f.extend(u, {
  1911. success: function (e) {
  1912. n.bPTZAuto = !n.bPTZAuto, r.success && r.success(e)
  1913. }, error: function (t, s) {
  1914. if (e.szDeviceType != w) {
  1915. o = E(l.CGI.ptzControl, e.szHttpProtocol, e.szIP, e.iCGIPort, n.iChannelID);
  1916. var a = new ue, c = {
  1917. type: "PUT",
  1918. url: o,
  1919. async: !1,
  1920. auth: e.szAuth,
  1921. data: i,
  1922. success: null,
  1923. error: null
  1924. };
  1925. f.extend(c, r), a.setRequestParam(c), a.submitRequest()
  1926. } else r.error && r.error(t, s)
  1927. }
  1928. }), c.setRequestParam(u), c.submitRequest()
  1929. }, de.prototype.ptzControl = function (e, t, n, r) {
  1930. var s = (n.iChannelID, "");
  1931. n.bPTZAuto && this.ptzAutoControl(e, !0, n, {iPTZSpeed: 0}), t ? r.iPTZSpeed = 0 : r.iPTZSpeed = r.iPTZSpeed < 7 ? 15 * r.iPTZSpeed : 100;
  1932. var o = [{}, {pan: 0, tilt: r.iPTZSpeed}, {pan: 0, tilt: -r.iPTZSpeed}, {
  1933. pan: -r.iPTZSpeed,
  1934. tilt: 0
  1935. }, {pan: r.iPTZSpeed, tilt: 0}, {pan: -r.iPTZSpeed, tilt: r.iPTZSpeed}, {
  1936. pan: -r.iPTZSpeed,
  1937. tilt: -r.iPTZSpeed
  1938. }, {pan: r.iPTZSpeed, tilt: r.iPTZSpeed}, {
  1939. pan: r.iPTZSpeed,
  1940. tilt: -r.iPTZSpeed
  1941. }, {}, {speed: r.iPTZSpeed}, {speed: -r.iPTZSpeed}, {speed: r.iPTZSpeed}, {speed: -r.iPTZSpeed}, {speed: r.iPTZSpeed}, {speed: -r.iPTZSpeed}],
  1942. i = "", a = {};
  1943. switch (r.iPTZIndex) {
  1944. case 1:
  1945. case 2:
  1946. case 3:
  1947. case 4:
  1948. case 5:
  1949. case 6:
  1950. case 7:
  1951. case 8:
  1952. a = this.CGI.ptzControl, i = "<?xml version='1.0' encoding='UTF-8'?><PTZData><pan>" + o[r.iPTZIndex].pan + "</pan><tilt>" + o[r.iPTZIndex].tilt + "</tilt></PTZData>";
  1953. break;
  1954. case 10:
  1955. case 11:
  1956. a = this.CGI.ptzControl, i = "<?xml version='1.0' encoding='UTF-8'?><PTZData><zoom>" + o[r.iPTZIndex].speed + "</zoom></PTZData>";
  1957. break;
  1958. case 12:
  1959. case 13:
  1960. a = this.CGI.ptzFocus, i = "<?xml version='1.0' encoding='UTF-8'?><FocusData><focus>" + o[r.iPTZIndex].speed + "</focus></FocusData>";
  1961. break;
  1962. case 14:
  1963. case 15:
  1964. a = this.CGI.ptzIris, i = "<?xml version='1.0' encoding='UTF-8'?><IrisData><iris>" + o[r.iPTZIndex].speed + "</iris></IrisData>";
  1965. break;
  1966. default:
  1967. return void (r.error && r.error())
  1968. }
  1969. s = E(a, e.szHttpProtocol, e.szIP, e.iCGIPort, n.iChannelID);
  1970. var c = new ue,
  1971. u = {type: "PUT", url: s, async: !1, auth: e.szAuth, data: i, success: null, error: null};
  1972. f.extend(u, r), f.extend(u, {
  1973. success: function (e) {
  1974. r.success && r.success(e)
  1975. }, error: function (e, t) {
  1976. r.error && r.error(e, t)
  1977. }
  1978. }), c.setRequestParam(u), c.submitRequest()
  1979. }, de.prototype.setPreset = function (e, t, n) {
  1980. var r = (t.iChannelID, ""), s = "";
  1981. r = E(this.CGI.setPreset, e.szHttpProtocol, e.szIP, e.iCGIPort, t.iChannelID, n.iPresetID), s = "<?xml version='1.0' encoding='UTF-8'?>", s += "<PTZPreset>", s += "<id>" + n.iPresetID + "</id>", e.szDeviceType != w && (s += "<presetName>Preset" + n.iPresetID + "</presetName>"), s += "</PTZPreset>";
  1982. var o = new ue, i = {type: "PUT", url: r, auth: e.szAuth, data: s, success: null, error: null};
  1983. f.extend(i, n), f.extend(i, {
  1984. success: function (e) {
  1985. n.success && n.success(e)
  1986. }, error: function (e, t) {
  1987. n.error && n.error(e, t)
  1988. }
  1989. }), o.setRequestParam(i), o.submitRequest()
  1990. }, de.prototype.goPreset = function (e, t, n) {
  1991. var r = (t.iChannelID, "");
  1992. r = E(this.CGI.goPreset, e.szHttpProtocol, e.szIP, e.iCGIPort, t.iChannelID, n.iPresetID);
  1993. var s = new ue, o = {type: "PUT", url: r, auth: e.szAuth, success: null, error: null};
  1994. f.extend(o, n), f.extend(o, {
  1995. success: function (e) {
  1996. n.success && n.success(e)
  1997. }, error: function (e, t) {
  1998. n.error && n.error(e, t)
  1999. }
  2000. }), s.setRequestParam(o), s.submitRequest()
  2001. }, de.prototype.recordSearch = function (e, r) {
  2002. var s = "", o = "", i = r.iChannelID, a = r.iStreamType, c = r.szStartTime.replace(" ", "T") + "Z",
  2003. u = r.szEndTime.replace(" ", "T") + "Z";
  2004. s = E(this.CGI.recordSearch, e.szHttpProtocol, e.szIP, e.iCGIPort), o = "<?xml version='1.0' encoding='UTF-8'?><CMSearchDescription><searchID>" + new t + "</searchID><trackList><trackID>" + (100 * i + a) + "</trackID></trackList><timeSpanList><timeSpan><startTime>" + c + "</startTime><endTime>" + u + "</endTime></timeSpan></timeSpanList><maxResults>40</maxResults><searchResultPostion>" + r.iSearchPos + "</searchResultPostion><metadataList><metadataDescriptor>//metadata.psia.org/VideoMotion</metadataDescriptor></metadataList></CMSearchDescription>";
  2005. var l = new ue, d = {type: "POST", url: s, auth: e.szAuth, data: o, success: null, error: null};
  2006. f.extend(d, r), f.extend(d, {
  2007. success: function (e) {
  2008. var t = [];
  2009. t.push("<CMSearchResult>"), t.push("<responseStatus>" + n.$XML(e).find("responseStatus").eq(0).text() + "</responseStatus>"), t.push("<responseStatusStrg>" + n.$XML(e).find("responseStatusStrg").eq(0).text() + "</responseStatusStrg>"), t.push("<numOfMatches>" + n.$XML(e).find("numOfMatches").eq(0).text() + "</numOfMatches>"), t.push("<matchList>");
  2010. for (var s = n.$XML(e).find("searchMatchItem", !0), o = 0, i = s.length; i > o; o++) {
  2011. var a = s[o];
  2012. t.push("<searchMatchItem>"), t.push("<trackID>" + n.$XML(a).find("trackID").eq(0).text() + "</trackID>"), t.push("<startTime>" + n.$XML(a).find("startTime").eq(0).text() + "</startTime>"), t.push("<endTime>" + n.$XML(a).find("endTime").eq(0).text() + "</endTime>"), t.push("<playbackURI>" + f.escape(n.$XML(a).find("playbackURI").eq(0).text()) + "</playbackURI>"), t.push("<metadataDescriptor>" + n.$XML(a).find("metadataDescriptor").eq(0).text().split("/")[1] + "</metadataDescriptor>"), t.push("</searchMatchItem>")
  2013. }
  2014. t.push("</matchList>"), t.push("</CMSearchResult>"), e = f.loadXML(t.join("")), r.success && r.success(e)
  2015. }, error: function (e, t) {
  2016. r.error && r.error(e, t)
  2017. }
  2018. }), l.setRequestParam(d), l.submitRequest()
  2019. }, de.prototype.startPlayback = function (e, t) {
  2020. var n = t.iWndIndex, r = t.szStartTime, s = t.szEndTime, o = e.szIP;
  2021. "rtsp://" === t.urlProtocol && (o = Z(o));
  2022. var i = E(t.cgi, t.urlProtocol, o, t.iPort, t.iChannelID, r, s), a = c.HWP_Play(i, e.szAuth, n, r, s);
  2023. if (0 == a) {
  2024. var u = new ce;
  2025. u.iIndex = n, u.szIP = e.szIP, u.iCGIPort = e.iCGIPort, u.szDeviceIdentify = e.szDeviceIdentify, u.iChannelID = t.iChannelID, u.iPlayStatus = D, p.push(u)
  2026. }
  2027. return a
  2028. }, de.prototype.reversePlayback = function (e, t) {
  2029. var n = t.iWndIndex, r = t.szStartTime, s = t.szEndTime, o = e.szIP;
  2030. "rtsp://" === t.urlProtocol && (o = Z(o));
  2031. var i = E(t.cgi, t.urlProtocol, o, t.iPort, t.iChannelID, r, s),
  2032. a = c.HWP_ReversePlay(i, e.szAuth, n, r, s);
  2033. if (0 == a) {
  2034. var u = new ce;
  2035. u.iIndex = n, u.szIP = e.szIP, u.iCGIPort = e.iCGIPort, u.szDeviceIdentify = e.szDeviceIdentify, u.iChannelID = t.iChannelID, u.iPlayStatus = b, p.push(u)
  2036. }
  2037. return a
  2038. }, de.prototype.startDownloadRecord = function (e, t) {
  2039. var n = E(this.CGI.startDownloadRecord, e.szHttpProtocol, e.szIP, e.iCGIPort),
  2040. r = "<?xml version='1.0' encoding='UTF-8'?><downloadRequest><playbackURI> " + f.escape(t.szPlaybackURI) + "</playbackURI></downloadRequest>";
  2041. return c.HWP_StartDownload(n, e.szAuth, t.szFileName, r, t.bDateDir)
  2042. }, de.prototype.exportDeviceConfig = function (e) {
  2043. var t = E(this.CGI.deviceConfig, e.szHttpProtocol, e.szIP, e.iCGIPort);
  2044. return c.HWP_ExportDeviceConfig(t, e.szAuth, "", 0)
  2045. }, de.prototype.importDeviceConfig = function (e, t) {
  2046. var n = E(this.CGI.deviceConfig, e.szHttpProtocol, e.szIP, e.iCGIPort);
  2047. return c.HWP_ImportDeviceConfig(n, e.szAuth, t.szFileName, 0)
  2048. }, de.prototype.restart = function (e, t) {
  2049. var n = E(this.CGI.restart, e.szHttpProtocol, e.szIP, e.iCGIPort), r = new ue,
  2050. s = {type: "PUT", url: n, auth: e.szAuth, success: null, error: null};
  2051. f.extend(s, t), f.extend(s, {
  2052. success: function (e) {
  2053. t.success && t.success(e)
  2054. }, error: function (e, n) {
  2055. t.error && t.error(e, n)
  2056. }
  2057. }), r.setRequestParam(s), r.submitRequest()
  2058. }, de.prototype.restore = function (e, t, n) {
  2059. var r = E(this.CGI.restore, e.szHttpProtocol, e.szIP, e.iCGIPort, t), s = new ue,
  2060. o = {type: "PUT", url: r, auth: e.szAuth, success: null, error: null};
  2061. f.extend(o, n), f.extend(o, {
  2062. success: function (e) {
  2063. n.success && n.success(e)
  2064. }, error: function (e, t) {
  2065. n.error && n.error(e, t)
  2066. }
  2067. }), s.setRequestParam(o), s.submitRequest()
  2068. }, de.prototype.startUpgrade = function (e, t) {
  2069. var n = E(this.CGI.startUpgrade.upgrade, e.szHttpProtocol, e.szIP, e.iCGIPort),
  2070. r = E(this.CGI.startUpgrade.status, e.szHttpProtocol, e.szIP, e.iCGIPort);
  2071. return c.HWP_StartUpgrade(n, r, e.szAuth, t.szFileName)
  2072. }, de.prototype.set3DZoom = function (e, t, n, r) {
  2073. var s = E(this.CGI.set3DZoom, e.szHttpProtocol, e.szIP, e.iCGIPort, t.iChannelID), o = new ue,
  2074. i = {type: "PUT", url: s, data: n, auth: e.szAuth, success: null, error: null};
  2075. f.extend(i, r), f.extend(i, {
  2076. success: function (e) {
  2077. r.success && r.success(e)
  2078. }, error: function (e, t) {
  2079. r.error && r.error(e, t)
  2080. }
  2081. }), o.setRequestParam(i), o.submitRequest()
  2082. }, de.prototype.deviceCapturePic = function (e, t, n, r) {
  2083. var t = 100 * t + 1, s = E(this.CGI.deviceCapture.channels, e.szHttpProtocol, e.szIP, e.iCGIPort, t),
  2084. o = [];
  2085. return f.isInt(r.iResolutionWidth) && o.push("videoResolutionWidth=" + r.iResolutionWidth), f.isInt(r.iResolutionHeight) && o.push("videoResolutionHeight=" + r.iResolutionHeight), o.length > 0 && (s += "?" + o.join("&")), c.HWP_DeviceCapturePic(s, e.szAuth, n, r.bDateDir)
  2086. };
  2087. var pe = function () {
  2088. };
  2089. pe.prototype._alert = function (e) {
  2090. a.bDebugMode && console.log(e)
  2091. }, function (t) {
  2092. var n = function (e) {
  2093. this.elems = [], this.length = 0, this.length = this.elems.push(e)
  2094. };
  2095. n.prototype.find = function (e, t) {
  2096. var n = this.elems[this.length - 1].getElementsByTagName(e);
  2097. return this.length = this.elems.push(n), t ? n : this
  2098. }, n.prototype.eq = function (e, t) {
  2099. var n = this.elems[this.length - 1].length, r = null;
  2100. return n > 0 && n > e && (r = this.elems[this.length - 1][e]), this.length = this.elems.push(r), t ? r : this
  2101. }, n.prototype.text = function (t) {
  2102. return this.elems[this.length - 1] ? t ? void (e.DOMParser ? this.elems[this.length - 1].textContent = t : this.elems[this.length - 1].text = t) : e.DOMParser ? this.elems[this.length - 1].textContent : this.elems[this.length - 1].text : ""
  2103. }, n.prototype.attr = function (e) {
  2104. if (this.elems[this.length - 1]) {
  2105. var t = this.elems[this.length - 1].attributes.getNamedItem(e);
  2106. return t ? t.value : ""
  2107. }
  2108. }, t.$XML = function (e) {
  2109. return new n(e)
  2110. }
  2111. }(this);
  2112. var Pe = function () {
  2113. };
  2114. Pe.prototype.extend = function () {
  2115. for (var e, t = arguments[0] || {}, n = 1, r = arguments.length; r > n; n++) if (null != (e = arguments[n])) for (var s in e) {
  2116. var o = (t[s], e[s]);
  2117. t !== o && ("object" == typeof o ? t[s] = this.extend({}, o) : void 0 !== o && (t[s] = o))
  2118. }
  2119. return t
  2120. }, Pe.prototype.browser = function () {
  2121. var e = /(chrome)[ \/]([\w.]+)/, t = /(safari)[ \/]([\w.]+)/, n = /(opera)(?:.*version)?[ \/]([\w.]+)/,
  2122. r = /(msie) ([\w.]+)/, s = /(trident.*rv:)([\w.]+)/, o = /(mozilla)(?:.*? rv:([\w.]+))?/,
  2123. i = navigator.userAgent.toLowerCase(),
  2124. a = e.exec(i) || t.exec(i) || n.exec(i) || r.exec(i) || s.exec(i) || i.indexOf("compatible") < 0 && o.exec(i) || ["unknow", "0"];
  2125. a.length > 0 && a[1].indexOf("trident") > -1 && (a[1] = "msie");
  2126. var c = {};
  2127. return c[a[1]] = !0, c.version = a[2], c
  2128. }, Pe.prototype.loadXML = function (t) {
  2129. if (null == t || "" == t) return null;
  2130. var n = null;
  2131. if (e.DOMParser) {
  2132. var r = new DOMParser;
  2133. n = r.parseFromString(t, "text/xml")
  2134. } else n = new ActiveXObject("Microsoft.XMLDOM"), n.async = !1, n.loadXML(t);
  2135. return n
  2136. }, Pe.prototype.toXMLStr = function (e) {
  2137. var t = "";
  2138. try {
  2139. var n = new XMLSerializer;
  2140. t = n.serializeToString(e)
  2141. } catch (r) {
  2142. try {
  2143. t = e.xml
  2144. } catch (r) {
  2145. return ""
  2146. }
  2147. }
  2148. return -1 == t.indexOf("<?xml") && (t = "<?xml version='1.0' encoding='utf-8'?>" + t), t
  2149. }, Pe.prototype.escape = function (e) {
  2150. return e.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;")
  2151. }, Pe.prototype.dateFormat = function (e, t) {
  2152. var n = {
  2153. "M+": e.getMonth() + 1,
  2154. "d+": e.getDate(),
  2155. "h+": e.getHours(),
  2156. "m+": e.getMinutes(),
  2157. "s+": e.getSeconds(),
  2158. "q+": Math.floor((e.getMonth() + 3) / 3),
  2159. S: e.getMilliseconds()
  2160. };
  2161. /(y+)/.test(t) && (t = t.replace(RegExp.$1, (e.getFullYear() + "").substr(4 - RegExp.$1.length)));
  2162. for (var r in n) new RegExp("(" + r + ")").test(t) && (t = t.replace(RegExp.$1, 1 == RegExp.$1.length ? n[r] : ("00" + n[r]).substr(("" + n[r]).length)));
  2163. return t
  2164. }, Pe.prototype.Base64 = {
  2165. _keyStr: "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=", encode: function (e) {
  2166. var t, n, r, s, o, i, a, c = "", u = 0;
  2167. for (e = Pe.prototype.Base64._utf8_encode(e); u < e.length;) t = e.charCodeAt(u++), n = e.charCodeAt(u++), r = e.charCodeAt(u++), s = t >> 2, o = (3 & t) << 4 | n >> 4, i = (15 & n) << 2 | r >> 6, a = 63 & r, isNaN(n) ? i = a = 64 : isNaN(r) && (a = 64), c = c + this._keyStr.charAt(s) + this._keyStr.charAt(o) + this._keyStr.charAt(i) + this._keyStr.charAt(a);
  2168. return c
  2169. }, decode: function (e) {
  2170. var t, n, r, s, o, i, a, c = "", u = 0;
  2171. for (e = e.replace(/[^A-Za-z0-9\+\/\=]/g, ""); u < e.length;) s = this._keyStr.indexOf(e.charAt(u++)), o = this._keyStr.indexOf(e.charAt(u++)), i = this._keyStr.indexOf(e.charAt(u++)), a = this._keyStr.indexOf(e.charAt(u++)), t = s << 2 | o >> 4, n = (15 & o) << 4 | i >> 2, r = (3 & i) << 6 | a, c += String.fromCharCode(t), 64 != i && (c += String.fromCharCode(n)), 64 != a && (c += String.fromCharCode(r));
  2172. return c = Pe.prototype.Base64._utf8_decode(c)
  2173. }, _utf8_encode: function (e) {
  2174. e = e.replace(/\r\n/g, "\n");
  2175. for (var t = "", n = 0; n < e.length; n++) {
  2176. var r = e.charCodeAt(n);
  2177. 128 > r ? t += String.fromCharCode(r) : r > 127 && 2048 > r ? (t += String.fromCharCode(r >> 6 | 192), t += String.fromCharCode(63 & r | 128)) : (t += String.fromCharCode(r >> 12 | 224), t += String.fromCharCode(r >> 6 & 63 | 128), t += String.fromCharCode(63 & r | 128))
  2178. }
  2179. return t
  2180. }, _utf8_decode: function (e) {
  2181. for (var t = "", n = 0, r = c1 = c2 = 0; n < e.length;) r = e.charCodeAt(n), 128 > r ? (t += String.fromCharCode(r), n++) : r > 191 && 224 > r ? (c2 = e.charCodeAt(n + 1), t += String.fromCharCode((31 & r) << 6 | 63 & c2), n += 2) : (c2 = e.charCodeAt(n + 1), c3 = e.charCodeAt(n + 2), t += String.fromCharCode((15 & r) << 12 | (63 & c2) << 6 | 63 & c3), n += 3);
  2182. return t
  2183. }
  2184. }, Pe.prototype.createEventScript = function (e, t, n) {
  2185. var r = document.createElement("script");
  2186. r.htmlFor = e, r.event = t, r.innerHTML = n, document.body.parentNode.appendChild(r)
  2187. }, Pe.prototype.isInt = function (e) {
  2188. return /^\d+$/.test(e)
  2189. }, Pe.prototype.getDirName = function () {
  2190. var e = "";
  2191. if ("" !== a.szBasePath) e = a.szBasePath; else {
  2192. var t = /[^?#]*\//, n = document.getElementById("videonode");
  2193. if (n) e = n.src.match(t)[0]; else {
  2194. for (var r = document.scripts, s = 0, o = r.length; o > s; s++) if (r[s].src.indexOf("webVideoCtrl.js") > -1) {
  2195. n = r[s];
  2196. break
  2197. }
  2198. n && (e = n.src.match(t)[0])
  2199. }
  2200. }
  2201. return e
  2202. }, Pe.prototype.loadScript = function (e, t) {
  2203. var n = document.createElement("script");
  2204. n.type = "text/javascript", n.onload = function () {
  2205. t()
  2206. }, n.src = e, document.getElementsByTagName("head")[0].appendChild(n)
  2207. }, Pe.prototype.sha256 = function (e) {
  2208. function t(e, t) {
  2209. var n = (65535 & e) + (65535 & t);
  2210. return (e >> 16) + (t >> 16) + (n >> 16) << 16 | 65535 & n
  2211. }
  2212. function n(e, t) {
  2213. return e >>> t | e << 32 - t
  2214. }
  2215. return e = function (e) {
  2216. for (var e = e.replace(/\r\n/g, "\n"), t = "", n = 0; n < e.length; n++) {
  2217. var r = e.charCodeAt(n);
  2218. 128 > r ? t += String.fromCharCode(r) : (r > 127 && 2048 > r ? t += String.fromCharCode(r >> 6 | 192) : (t += String.fromCharCode(r >> 12 | 224), t += String.fromCharCode(r >> 6 & 63 | 128)), t += String.fromCharCode(63 & r | 128))
  2219. }
  2220. return t
  2221. }(e), function (e) {
  2222. for (var t = "", n = 0; n < 4 * e.length; n++) t += "0123456789abcdef".charAt(e[n >> 2] >> 8 * (3 - n % 4) + 4 & 15) + "0123456789abcdef".charAt(e[n >> 2] >> 8 * (3 - n % 4) & 15);
  2223. return t
  2224. }(function (e, r) {
  2225. var s, o, i, a, c, u, l, d, p, P, h, I,
  2226. f = [1116352408, 1899447441, 3049323471, 3921009573, 961987163, 1508970993, 2453635748, 2870763221, 3624381080, 310598401, 607225278, 1426881987, 1925078388, 2162078206, 2614888103, 3248222580, 3835390401, 4022224774, 264347078, 604807628, 770255983, 1249150122, 1555081692, 1996064986, 2554220882, 2821834349, 2952996808, 3210313671, 3336571891, 3584528711, 113926993, 338241895, 666307205, 773529912, 1294757372, 1396182291, 1695183700, 1986661051, 2177026350, 2456956037, 2730485921, 2820302411, 3259730800, 3345764771, 3516065817, 3600352804, 4094571909, 275423344, 430227734, 506948616, 659060556, 883997877, 958139571, 1322822218, 1537002063, 1747873779, 1955562222, 2024104815, 2227730452, 2361852424, 2428436474, 2756734187, 3204031479, 3329325298],
  2227. m = [1779033703, 3144134277, 1013904242, 2773480762, 1359893119, 2600822924, 528734635, 1541459225],
  2228. C = Array(64);
  2229. for (e[r >> 5] |= 128 << 24 - r % 32, e[(r + 64 >> 9 << 4) + 15] = r, p = 0; p < e.length; p += 16) {
  2230. for (s = m[0], o = m[1], i = m[2], a = m[3], c = m[4], u = m[5], l = m[6], d = m[7], P = 0; 64 > P; P++) C[P] = 16 > P ? e[P + p] : t(t(t(n(C[P - 2], 17) ^ n(C[P - 2], 19) ^ C[P - 2] >>> 10, C[P - 7]), n(C[P - 15], 7) ^ n(C[P - 15], 18) ^ C[P - 15] >>> 3), C[P - 16]),
  2231. h = t(t(t(t(d, n(c, 6) ^ n(c, 11) ^ n(c, 25)), c & u ^ ~c & l), f[P]), C[P]), I = t(n(s, 2) ^ n(s, 13) ^ n(s, 22), s & o ^ s & i ^ o & i), d = l, l = u, u = c, c = t(a, h), a = i, i = o, o = s, s = t(h, I);
  2232. m[0] = t(s, m[0]), m[1] = t(o, m[1]), m[2] = t(i, m[2]), m[3] = t(a, m[3]), m[4] = t(c, m[4]), m[5] = t(u, m[5]), m[6] = t(l, m[6]), m[7] = t(d, m[7])
  2233. }
  2234. return m
  2235. }(function (e) {
  2236. for (var t = [], n = 0; n < 8 * e.length; n += 8) t[n >> 5] |= (255 & e.charCodeAt(n / 8)) << 24 - n % 32;
  2237. return t
  2238. }(e), 8 * e.length))
  2239. }, Pe.prototype.cookie = function (e, t, n) {
  2240. if (arguments.length > 1 && (null === t || "object" != typeof t)) {
  2241. if (n = this.extend({}, n), null === t && (n.expires = -1), "number" == typeof n.expires) {
  2242. var r = n.expires, s = n.expires = new Date;
  2243. s.setDate(s.getDate() + r)
  2244. }
  2245. return document.cookie = [encodeURIComponent(e), "=", n.raw ? String(t) : encodeURIComponent(String(t)), n.expires ? "; expires=" + n.expires.toUTCString() : "", n.path ? "; path=" + n.path : "; path=/", n.domain ? "; domain=" + n.domain : "", n.secure ? "; secure" : ""].join("")
  2246. }
  2247. n = t || {};
  2248. var o, i = n.raw ? function (e) {
  2249. return e
  2250. } : decodeURIComponent;
  2251. return (o = new RegExp("(?:^|; )" + encodeURIComponent(e) + "=([^;]*)").exec(document.cookie)) ? i(o[1]) : null
  2252. }, t.prototype.valueOf = function () {
  2253. return this.id
  2254. }, t.prototype.toString = function () {
  2255. return this.id
  2256. }, t.prototype.createUUID = function () {
  2257. var e = new Date(1582, 10, 15, 0, 0, 0, 0), n = new Date, r = n.getTime() - e.getTime(), s = "-",
  2258. o = t.getIntegerBits(r, 0, 31), i = t.getIntegerBits(r, 32, 47),
  2259. a = t.getIntegerBits(r, 48, 59) + "1", c = t.getIntegerBits(t.rand(4095), 0, 7),
  2260. u = t.getIntegerBits(t.rand(4095), 0, 7),
  2261. l = t.getIntegerBits(t.rand(8191), 0, 7) + t.getIntegerBits(t.rand(8191), 8, 15) + t.getIntegerBits(t.rand(8191), 0, 7) + t.getIntegerBits(t.rand(8191), 8, 15) + t.getIntegerBits(t.rand(8191), 0, 15);
  2262. return o + s + i + s + a + s + c + u + s + l
  2263. }, t.getIntegerBits = function (e, n, r) {
  2264. var s = t.returnBase(e, 16), o = new Array, i = "", a = 0;
  2265. for (a = 0; a < s.length; a++) o.push(s.substring(a, a + 1));
  2266. for (a = Math.floor(n / 4); a <= Math.floor(r / 4); a++) i += o[a] && "" != o[a] ? o[a] : "0";
  2267. return i
  2268. }, t.returnBase = function (e, t) {
  2269. var n = ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z"];
  2270. if (t > e) var r = n[e]; else {
  2271. var s = "" + Math.floor(e / t), o = e - s * t;
  2272. if (s >= t) var r = this.returnBase(s, t) + n[o]; else var r = n[s] + n[o]
  2273. }
  2274. return r
  2275. }, t.rand = function (e) {
  2276. return Math.floor(Math.random() * e)
  2277. }, h = new le, I = new de, P = new pe, f = new Pe;
  2278. var he = f.dateFormat(new Date, "yyyyMMddhhmmss");
  2279. return o = "webVideoCtrl" + he, i = "webVideoCtrl" + he, "object" != typeof e.attachEvent && f.browser().msie && (f.createEventScript(o, "GetSelectWndInfo(SelectWndInfo)", "GetSelectWndInfo(SelectWndInfo);"), f.createEventScript(o, "ZoomInfoCallback(szZoomInfo)", "ZoomInfoCallback(szZoomInfo);"), f.createEventScript(o, "GetHttpInfo(lID, lpInfo, lReverse)", "GetHttpInfo(lID, lpInfo, lReverse);"), f.createEventScript(o, "PluginEventHandler(iEventType, iParam1, iParam2)", "PluginEventHandler(iEventType, iParam1, iParam2);"), f.createEventScript(o, "RemoteConfigInfo(lID)", "RemoteConfigInfo(lID);"), f.createEventScript(o, "KeyBoardEventInfo(iKeyCode)", "KeyBoardEventInfo(iKeyCode);")), this
  2280. }(), n = e.WebVideoCtrl = t;
  2281. n.version = "1.1.0"
  2282. }
  2283. }(this), "object" == typeof exports && "undefined" != typeof module || ("function" == typeof define && define.amd ? define(function () {
  2284. return WebVideoCtrl
  2285. }) : "function" == typeof define && define.cmd && define(function (e, t, n) {
  2286. n.exports = WebVideoCtrl
  2287. }));