monitorHK.vue 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702
  1. <template class="divPlugin0">
  2. <!-- <div id="divPlugin" class="video-player">-->
  3. <div id="divPluginMonitorScreen" class="divPlugin"></div>
  4. <!-- </div>-->
  5. </template>
  6. <script>
  7. import {isInteger} from "lodash";
  8. export default {
  9. name: "monitorHK",
  10. props: {//从父组件传来的数据,IP、用户名、密码、端口号
  11. companyVideoData: {
  12. type: Array,
  13. },
  14. num:Number,
  15. bofang:Number,
  16. //分屏
  17. videoType: Number,
  18. chooseData:{},
  19. chooseWindow:Number,
  20. dangqianchuangkou:Number,
  21. },
  22. data() {
  23. return {
  24. currentnum:0,
  25. plugin: true,
  26. iWidth: "100%",
  27. iHeight: "100%",
  28. webVideo: {},
  29. iStreamType: 1,
  30. iProtocol: 1,
  31. bZeroChannel: false,
  32. xmlDocData: {},
  33. g_iWndIndex: 0, //可以不用设置这个变量,有窗口参数的接口中,不用传值,开发包会默认使用当前选择窗口
  34. videoNum: "",
  35. videoData:[],
  36. iWndowType:1,
  37. zoom: window.devicePixelRatio,
  38. };
  39. },
  40. created() {},
  41. beforeUnmount() {
  42. window.removeEventListener('resize', this.handleResize);
  43. },
  44. mounted() {
  45. // if(this.num!=this.currentnum){
  46. // console.log("00000000: ",this.num,this.currentnum)
  47. // this.videoInitPlugin();
  48. // }
  49. //浏览器界面大小
  50. console.log("1: ",document.body.clientWidth ,document.body.clientHeight)
  51. console.log("2: ",window.screen.height , window.devicePixelRatio,window.screen.height * window.devicePixelRatio)
  52. console.log("3: ",window.screen.width , window.devicePixelRatio,window.screen.width * window.devicePixelRatio)
  53. this.videoInitPlugin();
  54. },
  55. destroyed() {
  56. this.$router.go(0);
  57. },
  58. methods: {
  59. handleResize() {
  60. this.zoom = window.devicePixelRatio;
  61. let h
  62. let w
  63. if (document.body.clientWidth >= (document.body.clientHeight * (2200 / 1080))) {
  64. h = document.body.clientHeight
  65. w = document.body.clientHeight * (2200 / 1080)
  66. } else {
  67. h = document.body.clientWidth / (2200 / 1080)
  68. w = document.body.clientWidth
  69. }
  70. setTimeout(() => {
  71. WebVideoCtrl.I_Resize(
  72. w/1.3,
  73. h/1.23
  74. );
  75. }, 1000);
  76. },
  77. videoInitPlugin() {
  78. var iRet = WebVideoCtrl.I_CheckPluginInstall();
  79. if (iRet === -1) {
  80. alert("您还未安装过插件,请安装WebComponentsKit.exe插件!");
  81. return;
  82. }
  83. this.initPlugin();
  84. },
  85. //插件初始化
  86. initPlugin() {
  87. // console.log("窗口信息", I_GetWindowStatus(0))
  88. this.currentnum = this.num
  89. console.log(1)
  90. console.log(this.num)
  91. console.log("isInteger11", isInteger(this.num))
  92. console.log("isInteger22", isInteger(parseInt(this.num)))
  93. this.iWndowType = Math.sqrt(this.num);
  94. // let videoNum = this.videoData.length;
  95. // if(videoNum == 0){
  96. // return;
  97. // }
  98. // else if(videoNum ==1){
  99. // this.iWndowType = 1;
  100. // }
  101. // else if(videoNum>1&&videoNum<5){
  102. // this.iWndowType = 2;
  103. // }
  104. // else if(videoNum>=5&&videoNum<10){
  105. // this.iWndowType = 3;
  106. // }
  107. // else if(videoNum>=10&&videoNum<=16){
  108. // this.iWndowType = 4;
  109. // }
  110. // else{
  111. // return;
  112. // }
  113. // console.log('videoNum :>> ', videoNum);
  114. console.log('this.iWndowType :>> ', this.iWndowType);
  115. var that = this;
  116. console.log("🚀 开始初始化插件 >> ", that.g_iWndIndex);
  117. WebVideoCtrl.I_InitPlugin({
  118. bWndFull: true, //是否支持单窗口双击全屏,默I_CheckPluginInstall
  119. iWndowType: this.iWndowType,
  120. bDebugMode: true,
  121. cbSelWnd: function (xmlDoc) {//获取当前窗口
  122. that.g_iWndIndex = parseInt($(xmlDoc).find("SelectWnd").eq(0).text(), 10);
  123. var szInfo = "当前选择的窗口编号:" + that.g_iWndIndex;
  124. this.dangqianchuangkou = that.g_iWndIndex
  125. // console.log("窗口:",this.dangqianchuangkou)
  126. // this.$emit('change1', this.dangqianchuangkou);
  127. // console.log(szInfo)
  128. },
  129. cbDoubleClickWnd: function (iWndIndex, bFullScreen) {
  130. var szInfo = "当前放大的窗口编号:" + that.iWndIndex;
  131. if (!bFullScreen) {
  132. szInfo = "当前还原的窗口编号:" + that.iWndIndex;
  133. }
  134. console.log(szInfo)
  135. },
  136. });
  137. // console.log("窗口change:",this.dangqianchuangkou)
  138. // this.$emit('change', this.dangqianchuangkou);
  139. // this.$emit('child',this.msg2)
  140. console.log("🚀 初始化插件完成 >> ", that.g_iWndIndex);
  141. console.log("🚀 插入插件");
  142. let h
  143. let w
  144. console.log("0: ", document.body.clientWidth, document.body.clientHeight)
  145. if (document.body.clientWidth >= (document.body.clientHeight *(2200 / 1080))) {
  146. h = document.body.clientHeight
  147. w = document.body.clientHeight * (2200 / 1080)
  148. } else {
  149. h = document.body.clientWidth / (2200 / 1080)
  150. w = document.body.clientWidth
  151. }
  152. console.log("1: ", w, h)
  153. console.log("2: ", w / 2.43, h / 3.05)
  154. // 检查插件是否最新
  155. // if (-1 == WebVideoCtrl.I_CheckPluginVersion()) {
  156. // alert("检测到新的插件版本,请双击WebComponents.exe插件,进行升级!");
  157. // // return;
  158. // }
  159. WebVideoCtrl.I_InsertOBJECTPlugin("divPluginMonitorScreen").then(() => {
  160. WebVideoCtrl.I_Resize(
  161. w / 1.3,
  162. h / 1.23
  163. ).then(() => {
  164. console.log("🚀 data >> ", that.companyVideoData);
  165. this.getLoginParams().then((res) => {
  166. console.log("🚀 解析完 >> ", res);
  167. // this.login(res);
  168. });
  169. })
  170. window.addEventListener("resize", that.handleResize);
  171. });
  172. console.log("🚀 插入完成");
  173. // WebVideoCtrl.I_InsertOBJECTPlugin("divPluginMonitorScreen");
  174. // setTimeout(() => {
  175. // WebVideoCtrl.I_Resize(
  176. //
  177. // // 1135/(this.zoom/1.25),
  178. // // 590/(this.zoom/1.25)
  179. // // w/2.43,
  180. // // h/3.05
  181. // w/5,
  182. // h/6
  183. //
  184. // );
  185. // }, 100);
  186. // window.addEventListener('resize', this.handleResize);
  187. // this.clickLogin();
  188. },
  189. async getLoginParams() {
  190. var loginParams = {};
  191. var that = this;
  192. for (const item of that.companyVideoData) {
  193. if (item !== undefined) {
  194. let loginParam = {}
  195. const key = JSON.stringify(item);
  196. if (!loginParams.hasOwnProperty(key)) {
  197. loginParams[key] = item;
  198. }
  199. }
  200. }
  201. return loginParams;
  202. },
  203. async login(loginParams) {
  204. var that = this;
  205. // for (const loginParam of Object.values(loginParams)) {
  206. // await that.doLogin(loginParam)
  207. // }
  208. await Promise.all(
  209. Object.values(loginParams).map(async (loginParam) => {
  210. await that.doLogin(loginParam);
  211. })
  212. )
  213. },
  214. async doLogin(loginParam) {
  215. console.log("🚀 loginPara >> ", loginParam);
  216. var that = this;
  217. WebVideoCtrl.I_Login(
  218. loginParam.ip,
  219. 1,
  220. loginParam.Port,
  221. loginParam.Username,
  222. loginParam.Password,
  223. {
  224. timeout: 1000,
  225. success: function (xmlDoc) {
  226. console.log("🚀 登录成功 >> ", loginParam.ip, loginParam.Port);
  227. that.doGetChannelInfo(loginParam.ip).then((channels) => {
  228. var s = JSON.stringify(channels);
  229. console.log("tezt", JSON.stringify(channels), channels.length, channels[0], channels[0].channelId, channels[0]["channelId"])
  230. // console.log("🚀 通道列表 >> ", loginParam.ip, channels, channels.length, s[0]["channelName"]);
  231. var channelId = that.getChannelIdByName(loginParam.channelName, channels);
  232. console.log("🚀 获得id >> ", channelId);
  233. if (channelId !== null) {
  234. console.log("🚀 获得id >> ", channelId);
  235. that.startPlay(loginParam.ip, channelId);
  236. } else
  237. console.log("🚀 通道号无效 >> ", loginParam.ip, loginParam.channelName);
  238. })
  239. },
  240. error: function () {
  241. console.log("login error");
  242. },
  243. }
  244. ).catch(error => {
  245. // 捕获错误并获取错误代码
  246. const errorCode = error.errorCode;
  247. console.log(errorCode);
  248. if (errorCode == 2001) {//继续播放
  249. that.doGetChannelInfo(loginParam.ip).then((channels) => {
  250. var s = JSON.stringify(channels);
  251. console.log("tezt", JSON.stringify(channels), channels.length, channels[0], channels[0].channelId, channels[0]["channelId"])
  252. // console.log("🚀 通道列表 >> ", loginParam.ip, channels, channels.length, s[0]["channelName"]);
  253. var channelId = that.getChannelIdByName(loginParam.channelName, channels);
  254. console.log("🚀 获得id >> ", channelId);
  255. if (channelId !== null) {
  256. console.log("🚀 获得id >> ", channelId);
  257. that.startPlay(loginParam.ip, channelId);
  258. } else
  259. console.log("🚀 通道号无效 >> ", loginParam.ip, loginParam.channelName);
  260. })
  261. }
  262. });
  263. ;
  264. },
  265. getChannelIdByName(channelName, channels) {
  266. const channel = channels.find((channel) => {
  267. if (channel["channelName"] == channelName) {
  268. return channel;
  269. }
  270. });
  271. if (channel) {
  272. return channel.channelId;
  273. } else {
  274. return null;
  275. }
  276. },
  277. doGetChannelInfo(ip) {
  278. return new Promise((resolve, reject) => {
  279. var getAnalogChannelInfo = new Promise((resolve, reject) => {
  280. WebVideoCtrl.I_GetAnalogChannelInfo(ip, {
  281. success: function (xmlDoc) {
  282. let channels = [];
  283. var oChannels = $(xmlDoc).find("VideoInputChannel");
  284. $.each(oChannels, function (i) {
  285. var id = $(this).find("id").eq(0).text(),
  286. name = $(this).find("name").eq(0).text();
  287. if ("" == name) {
  288. name = "Camera " + (i < 9 ? "0" + (i + 1) : (i + 1));
  289. }
  290. channels.push({
  291. channelId: id,
  292. channelName: name,
  293. })
  294. });
  295. console.log("🚀 获取模拟通道成功 >> ", channels);
  296. resolve(channels);
  297. },
  298. error: function (oError) {
  299. console.log("🚀 获取模拟通道失败 >> ", ip, oError.errorCode, oError.errorMsg);
  300. },
  301. })
  302. });
  303. var getDigitalChannelInfo = new Promise((resolve, reject) => {
  304. WebVideoCtrl.I_GetDigitalChannelInfo(ip, {
  305. success: function (xmlDoc) {
  306. let channels = [];
  307. var oChannels = $(xmlDoc).find("InputProxyChannelStatus");
  308. $.each(oChannels, function (i) {
  309. var id = $(this).find("id").eq(0).text(),
  310. name = $(this).find("name").eq(0).text(),
  311. online = $(this).find("online").eq(0).text();
  312. if ("false" == online) {// 过滤禁用的数字通道
  313. return true;
  314. }
  315. if ("" == name) {
  316. name = "IPCamera " + (i < 9 ? "0" + (i + 1) : (i + 1));
  317. }
  318. channels.push({
  319. channelId: id,
  320. channelName: name,
  321. })
  322. });
  323. console.log("🚀 获取数字通道成功 >> ", channels);
  324. resolve(channels);
  325. },
  326. error: function (oError) {
  327. console.log("🚀 获取数字通道失败 >> ", ip, oError.errorCode, oError.errorMsg);
  328. resolve([]);
  329. }
  330. });
  331. });
  332. var getZeroChannelInfo = new Promise((resolve, reject) => {
  333. WebVideoCtrl.I_GetZeroChannelInfo(ip, {
  334. success: function (xmlDoc) {
  335. let channels = [];
  336. var oChannels = $(xmlDoc).find("ZeroVideoChannel");
  337. $.each(oChannels, function (i) {
  338. var id = $(this).find("id").eq(0).text(),
  339. name = $(this).find("name").eq(0).text();
  340. if ("" == name) {
  341. name = "Zero Channel " + (i < 9 ? "0" + (i + 1) : (i + 1));
  342. }
  343. if ("true" == $(this).find("enabled").eq(0).text()) {// 过滤禁用的零通道
  344. channels.push({
  345. channelId: id,
  346. channelName: name,
  347. })
  348. }
  349. });
  350. console.log("🚀 获取零通道成功 >> ", channels);
  351. resolve(channels);
  352. },
  353. error: function (oError) {
  354. console.log("🚀 获取零通道失败 >> ", ip, oError.errorCode, oError.errorMsg);
  355. resolve([]);
  356. }
  357. });
  358. });
  359. Promise.allSettled([getAnalogChannelInfo, getDigitalChannelInfo, getZeroChannelInfo])
  360. .then((resList) => {
  361. console.log("🚀 res >> ", resList);
  362. const fulfilledValues = resList.reduce((list, result) => {
  363. if (result.status === 'fulfilled' && result.value.length !== 0) {
  364. const value = result.value;
  365. list.push(value);
  366. }
  367. return list;
  368. }, []);
  369. resolve(fulfilledValues.flat());
  370. })
  371. .catch((error) => {
  372. console.log("🚀 获取通道失败 >> ", ip);
  373. });
  374. })
  375. },
  376. startPlay(ip, channelId) {
  377. console.log("🚀 开始播放 >> ", ip, channelId);
  378. WebVideoCtrl.I_StartRealPlay(ip, {
  379. iStreamType: 1,
  380. iChannelID: channelId,
  381. iWndIndex: this.dangqianchuangkou,
  382. }).then(() => {
  383. this.$emit("init", true);
  384. console.log("🚀 采集卡麒麟 >> ",);
  385. }).catch(error => {
  386. // 捕获错误并获取错误代码
  387. const errorCode = error.errorCode;
  388. console.log("errorCode",errorCode);
  389. if (errorCode == 1000) {//继续播放
  390. }
  391. })
  392. },
  393. clickLogin() {
  394. return new Promise((resolve) => {
  395. const uniqueArr = [];
  396. const uniqueSet = new Set();
  397. this.companyVideoData.forEach((obj) => {
  398. if (obj !== undefined) {
  399. const key = JSON.stringify(obj);
  400. if (!uniqueSet.has(key)) {
  401. uniqueSet.add(key);
  402. uniqueArr.push(obj);
  403. }
  404. }
  405. });
  406. console.log(uniqueArr);
  407. for (let index = 0; index < uniqueArr.length; index++) {
  408. this.singleLogin(uniqueArr[index], index);
  409. }
  410. // 完成登录操作后调用resolve
  411. resolve();
  412. });
  413. },
  414. singleLogin(Data, index) {
  415. setTimeout(() => {
  416. var that = this;
  417. WebVideoCtrl.I_Login(
  418. Data.ip,
  419. 1,
  420. Data.Port,
  421. Data.Username,
  422. Data.Password,
  423. {
  424. timeout: 1000,
  425. async: false,
  426. success: function (xmlDoc) {
  427. console.log("开始预览"); //不能删除
  428. let oChannels = that.getChannelInfo();
  429. that.initPlay(Data, index, oChannels);
  430. },
  431. error: function () {
  432. console.log("login error");
  433. },
  434. }
  435. );
  436. }, 100);
  437. },
  438. //获取通道
  439. getChannelInfo() {
  440. var that = this;
  441. // 模拟通道
  442. WebVideoCtrl.I_GetAnalogChannelInfo(this.szIP, {
  443. async: false,
  444. success: function (xmlDoc) {
  445. var oChannels = $(xmlDoc).find("VideoInputChannel");
  446. nAnalogChannel = oChannels.length;
  447. console.log("获取模拟通道成功!");
  448. return oChannels
  449. },
  450. error: function () {
  451. console.log("获取模拟通道失败!" + WebVideoCtrl.I_GetLastError());
  452. },
  453. });
  454. // 数字通道
  455. WebVideoCtrl.I_GetDigitalChannelInfo(that.companyVideoData.ip, {
  456. async: false,
  457. success: function (xmlDoc) {
  458. var oChannels = $(xmlDoc).find("InputProxyChannelStatus");
  459. return oChannels
  460. },
  461. error: function () {
  462. WebVideoCtrl.I_GetLastError();
  463. console.log("获取数字通道失败!" + WebVideoCtrl.I_GetLastError());
  464. },
  465. });
  466. // 零通道
  467. WebVideoCtrl.I_GetZeroChannelInfo(this.szIP, {
  468. async: false,
  469. success: function (xmlDoc) {
  470. var oChannels = $(xmlDoc).find("ZeroVideoChannel");
  471. return oChannels
  472. },
  473. error: function () {
  474. console.log("获取零通道失败!" + WebVideoCtrl.I_GetLastError());
  475. },
  476. });
  477. },
  478. //初始化视频,为了让用户进来就可以看到视频播放
  479. initPlay(data, index, oChannels) {
  480. let szIP = data.ip; //ip地址
  481. //循环16次是因为插件分屏最大为4x4(可以根据情况而定)
  482. WebVideoCtrl.I_StartRealPlay(szIP, {
  483. iStreamType: 1,
  484. iChannelID: oChannels.id,//按格式修改
  485. iWndIndex: index,
  486. });
  487. },
  488. // 点击查看具体哪个监控
  489. startRealPlay(oChannels) {
  490. let that = this;
  491. let szIP = this.companyVideoData.ip; //ip地址
  492. let iChannelID = oChannels; //播放通道号
  493. var iStreamType = 1;
  494. var oWndInfo = WebVideoCtrl.I_GetWindowStatus(that.g_iWndIndex);
  495. if (oWndInfo != null) {
  496. // 已经在播放了,先停止
  497. WebVideoCtrl.I_Stop();
  498. }
  499. WebVideoCtrl.I_StartRealPlay(szIP, {
  500. iStreamType: iStreamType,
  501. iChannelID: iChannelID,
  502. });
  503. },
  504. stopPlayVideo() {
  505. WebVideoCtrl.I_Stop({
  506. iWndIndex: this.dangqianchuangkou,
  507. });
  508. },
  509. stopallPlayVideo(a) {
  510. // parseInt(myString)
  511. console.log("里边的a为:",a)
  512. a.forEach(function(element) {
  513. console.log(element);
  514. console.log(parseInt(element));
  515. WebVideoCtrl.I_Stop({
  516. iWndIndex: parseInt(element),
  517. });
  518. });
  519. // WebVideoCtrl.I_Stop({
  520. // iWndIndex: this.dangqianchuangkou,
  521. // });
  522. // this.I_StopAllPlay = function () {
  523. // let oPromise = new Promise(async function (resolve, reject) {
  524. // m_pluginOBJECT.JS_StopRealPlayAll().then(() => {
  525. // m_wndSet.length = 0;
  526. // resolve()
  527. // }, () => {
  528. // reject(_oUnKnownError)
  529. // })
  530. // });
  531. // return oPromise
  532. // };
  533. },
  534. pausePlayVideo(){
  535. WebVideoCtrl.I_Pause( {
  536. // iWndIndex: this.dangqianchuangkou,
  537. iWndIndex: [0,1],
  538. });
  539. }
  540. },
  541. //因为项目中需求,总公司要查看所有子公司的监控,所以做了个监听来切换查看各个子公司的监控
  542. watch: {
  543. currentnum:{
  544. handler(val, oldval) {
  545. console.log("watchnum11:",this.currentnum, this.num)
  546. console.log("watchnum12:",val, oldval)
  547. }
  548. },
  549. bofang: {
  550. handler(val, oldval) {
  551. console.log("chooseData666:", this.chooseData)
  552. console.log("chooseData6662:", val, oldval)
  553. },
  554. },
  555. chooseData: {
  556. handler(val, oldval) {
  557. console.log("chooseData666:", this.chooseData)
  558. console.log("chooseData6662:", val, oldval)
  559. },
  560. },
  561. num:{
  562. handler(val, oldval) {
  563. console.log("watchnum21:", this.currentnum, this.num)
  564. console.log("watchnum22:", val, oldval)
  565. // this.initPlugin()
  566. WebVideoCtrl.I_ChangeWndNum(Math.sqrt(this.num))
  567. let that = this;
  568. WebVideoCtrl.I_InitPlugin({
  569. bWndFull: true, //是否支持单窗口双击全屏,默I_CheckPluginInstall
  570. iWndowType: this.iWndowType,
  571. bDebugMode: true,
  572. cbSelWnd: function (xmlDoc) {//获取当前窗口
  573. that.g_iWndIndex = parseInt($(xmlDoc).find("SelectWnd").eq(0).text(), 10);
  574. // var szInfo = "当前选择的窗口编号:" + that.g_iWndIndex;
  575. this.dangqianchuangkou = that.g_iWndIndex
  576. that.$emit('change-window', this.dangqianchuangkou);
  577. // console.log(szInfo)
  578. },
  579. })
  580. }
  581. },
  582. companyVideoData: {
  583. handler(val, oldval) {
  584. console.log("watchnum121:",this.currentnum, this.num)
  585. console.log("watchnum122:",val, oldval)
  586. console.log("watchnum123:",val.length, oldval)
  587. if(val.length==1){
  588. this.num=1
  589. // this.$emit('button-updated', this.num);
  590. WebVideoCtrl.I_ChangeWndNum(1)
  591. }else if(val.length<=4){
  592. this.num=4
  593. WebVideoCtrl.I_ChangeWndNum(2)
  594. }else if(val.length<=9){
  595. this.num=9
  596. WebVideoCtrl.I_ChangeWndNum(3)
  597. }else if(val.length<=16){
  598. this.num=16
  599. WebVideoCtrl.I_ChangeWndNum(4)
  600. }else{
  601. this.num=16
  602. WebVideoCtrl.I_ChangeWndNum(4)
  603. }
  604. this.$emit('button-value', this.num);
  605. // WebVideoCtrl.I_ChangeWndNum(Math.sqrt(this.num))
  606. // if (oldval) {
  607. // for (let i = 0; i < 16; i++) {
  608. // WebVideoCtrl.I_Stop(i); //停止正在播放的页面
  609. // }
  610. // this.$emit("func", "");
  611. // WebVideoCtrl.I_Logout(oldval.ip);
  612. // this.clickLogin(this.companyVideoData);
  613. // }
  614. },
  615. // immediate: true, //关键
  616. // deep: true,
  617. },
  618. videoType: {
  619. handler(val, oldval) {
  620. if (oldval) {
  621. WebVideoCtrl.I_ChangeWndNum(this.videoType); //分屏
  622. this.initPlay();
  623. }
  624. },
  625. immediate: true, //关键
  626. deep: true,
  627. },
  628. },
  629. };
  630. </script>
  631. <style scoped>
  632. .video-player {
  633. width: 120%;
  634. height: 120%;
  635. }
  636. .divPlugin0 {
  637. pointer-events: none;
  638. }
  639. .divPlugin {
  640. width: 100%;
  641. height: 100%;
  642. color: red;
  643. /* display: flex; */
  644. justify-content: center;
  645. align-items: center;
  646. font-size: 18px;
  647. position: fixed;
  648. /* top: 680px; */
  649. /* top: 0px; */
  650. /* right: 0px; */
  651. overflow: hidden;
  652. }
  653. .down {
  654. width: 100%;
  655. height: 100%;
  656. color: red;
  657. display: flex;
  658. justify-content: center;
  659. align-items: center;
  660. font-size: 18px;
  661. }
  662. .down a {
  663. color: red;
  664. }
  665. </style>