homeurl.vue 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. <template>
  2. <div>
  3. <div id="divPlugin" class="plugin"></div>
  4. </div>
  5. </template>
  6. <script>
  7. export default {
  8. name: "videojs",
  9. components:{},
  10. data(){
  11. return{
  12. g_iWndIndex:0,
  13. }
  14. },
  15. mounted() {
  16. var that=this;
  17. setTimeout(()=>{
  18. this.initVideoPlay('192.168.101.64', '80', 'admin', 'zxy123456','divPlugin')
  19. },2000)
  20. },
  21. beforeDestroy() {
  22. },
  23. methods:{
  24. initVideoPlay(ip, port, username, password,id){
  25. console.log(2)
  26. // 初始化插件参数及插入插件
  27. WebVideoCtrl.I_InitPlugin(500, 300, {
  28. bWndFull: true, //是否支持单窗口双击全屏,默认支持 true:支持 false:不支持
  29. iPackageType: 2,
  30. //szColorProperty:"plugin-background:0000ff; sub-background:0000ff; sub-border:00ffff; sub-border-select:0000ff", //2:PS 11:MP4
  31. iWndowType: 1,
  32. cbSelWnd: function (xmlDoc) {
  33. // g_iWndIndex = parseInt($(xmlDoc).find("SelectWnd").eq(0).text(), 10);
  34. // var szInfo = "当前选择的窗口编号:" + g_iWndIndex;
  35. // showCBInfo(szInfo);
  36. },
  37. cbDoubleClickWnd: function (iWndIndex, bFullScreen) {
  38. // var szInfo = "当前放大的窗口编号:" + iWndIndex;
  39. // if (!bFullScreen) {
  40. // szInfo = "当前还原的窗口编号:" + iWndIndex;
  41. // }
  42. // showCBInfo(szInfo);
  43. },
  44. cbEvent: function (iEventType, iParam1, iParam2) {
  45. // if (2 == iEventType) {// 回放正常结束
  46. // showCBInfo("窗口" + iParam1 + "回放结束!");
  47. // } else if (-1 == iEventType) {
  48. // showCBInfo("设备" + iParam1 + "网络错误!");
  49. // } else if (3001 == iEventType) {
  50. // clickStopRecord(g_szRecordType, iParam1);
  51. // }
  52. },
  53. cbRemoteConfig: function () {
  54. // showCBInfo("关闭远程配置库!");
  55. },
  56. cbInitPluginComplete: function () {
  57. WebVideoCtrl.I_InsertOBJECTPlugin("divPlugin").then(
  58. ()=>{
  59. }
  60. );
  61. console.log(222)
  62. // 检查插件是否最新
  63. // if (-1 == WebVideoCtrl.I_CheckPluginVersion()) {
  64. // alert("检测到新的插件版本,双击开发包目录里的WebComponentsKit.exe升级!");
  65. // return;
  66. // }
  67. }
  68. });
  69. }
  70. }
  71. }
  72. </script>