@vtx/player 0.0.15 → 0.0.16

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (212) hide show
  1. package/lib/controls/style/css.js +10 -0
  2. package/lib/controls/style/css.js.map +1 -1
  3. package/lib/controls/style/index.d.ts +5 -0
  4. package/lib/controls/style/index.js +10 -0
  5. package/lib/controls/style/index.js.map +1 -1
  6. package/lib/history-control/index.d.ts +1 -1
  7. package/lib/history-control/index.js +2 -2
  8. package/lib/history-control/index.js.map +1 -1
  9. package/lib/history-control/style/css.js +8 -0
  10. package/lib/history-control/style/css.js.map +1 -1
  11. package/lib/history-control/style/index.d.ts +4 -0
  12. package/lib/history-control/style/index.js +8 -0
  13. package/lib/history-control/style/index.js.map +1 -1
  14. package/lib/history-player/style/css.js +4 -0
  15. package/lib/history-player/style/css.js.map +1 -1
  16. package/lib/history-player/style/index.d.ts +2 -0
  17. package/lib/history-player/style/index.js +4 -0
  18. package/lib/history-player/style/index.js.map +1 -1
  19. package/lib/live-control/style/css.js +4 -0
  20. package/lib/live-control/style/css.js.map +1 -1
  21. package/lib/live-control/style/index.d.ts +3 -0
  22. package/lib/live-control/style/index.js +4 -0
  23. package/lib/live-control/style/index.js.map +1 -1
  24. package/lib/live-player/demo/src/components/lib/vtx-color-picker/style/index.css +12 -0
  25. package/lib/live-player/demo/src/components/lib/vtx-color-picker/style/index.less +12 -0
  26. package/lib/live-player/demo/src/components/lib/vtx-combogrid/style/index.css +24 -0
  27. package/lib/live-player/demo/src/components/lib/vtx-combogrid/style/index.less +29 -0
  28. package/lib/live-player/demo/src/components/lib/vtx-datagrid/style/index.css +136 -0
  29. package/lib/live-player/demo/src/components/lib/vtx-datagrid/style/index.less +166 -0
  30. package/lib/live-player/demo/src/components/lib/vtx-date-picker/style/index.css +29 -0
  31. package/lib/live-player/demo/src/components/lib/vtx-date-picker/style/index.less +39 -0
  32. package/lib/live-player/demo/src/components/lib/vtx-editor/style/index.css +6 -0
  33. package/lib/live-player/demo/src/components/lib/vtx-editor/style/index.less +8 -0
  34. package/lib/live-player/demo/src/components/lib/vtx-ellipsis-text/style/index.css +13 -0
  35. package/lib/live-player/demo/src/components/lib/vtx-ellipsis-text/style/index.less +13 -0
  36. package/lib/live-player/demo/src/components/lib/vtx-export/style/index.css +8 -0
  37. package/lib/live-player/demo/src/components/lib/vtx-export/style/index.less +6 -0
  38. package/lib/live-player/demo/src/components/lib/vtx-form-layout/demo/Modal.css +42 -0
  39. package/lib/live-player/demo/src/components/lib/vtx-form-layout/demo/Modal.less +43 -0
  40. package/lib/live-player/demo/src/components/lib/vtx-form-layout/style/index.css +224 -0
  41. package/lib/live-player/demo/src/components/lib/vtx-form-layout/style/index.less +211 -0
  42. package/lib/live-player/demo/src/components/lib/vtx-image/style/index.css +46 -0
  43. package/lib/live-player/demo/src/components/lib/vtx-image/style/index.less +63 -0
  44. package/lib/live-player/demo/src/components/lib/vtx-import/style/index.css +3 -0
  45. package/lib/live-player/demo/src/components/lib/vtx-import/style/index.less +8 -0
  46. package/lib/live-player/demo/src/components/lib/vtx-input/style/index.css +22 -0
  47. package/lib/live-player/demo/src/components/lib/vtx-input/style/index.less +24 -0
  48. package/lib/live-player/demo/src/components/lib/vtx-modal/style/index.css +80 -0
  49. package/lib/live-player/demo/src/components/lib/vtx-modal/style/index.less +95 -0
  50. package/lib/live-player/demo/src/components/lib/vtx-page-layout/style/index.css +115 -0
  51. package/lib/live-player/demo/src/components/lib/vtx-page-layout/style/index.less +138 -0
  52. package/lib/live-player/demo/src/components/lib/vtx-rps-frame/style/index.css +8 -0
  53. package/lib/live-player/demo/src/components/lib/vtx-rps-frame/style/index.less +8 -0
  54. package/lib/live-player/demo/src/components/lib/vtx-scrollable-row/style/index.css +111 -0
  55. package/lib/live-player/demo/src/components/lib/vtx-scrollable-row/style/index.less +113 -0
  56. package/lib/live-player/demo/src/components/lib/vtx-search/style/index.css +84 -0
  57. package/lib/live-player/demo/src/components/lib/vtx-search/style/index.less +83 -0
  58. package/lib/live-player/demo/src/components/lib/vtx-select/style/index.css +68 -0
  59. package/lib/live-player/demo/src/components/lib/vtx-select/style/index.less +68 -0
  60. package/lib/live-player/demo/src/components/lib/vtx-signature/style/index.css +35 -0
  61. package/lib/live-player/demo/src/components/lib/vtx-signature/style/index.less +33 -0
  62. package/lib/live-player/demo/src/components/lib/vtx-split-pane/style/index.css +59 -0
  63. package/lib/live-player/demo/src/components/lib/vtx-split-pane/style/index.less +60 -0
  64. package/lib/live-player/demo/src/components/lib/vtx-statistics-column/style/index.css +55 -0
  65. package/lib/live-player/demo/src/components/lib/vtx-statistics-column/style/index.less +59 -0
  66. package/lib/live-player/demo/src/components/lib/vtx-upload/style/index.css +54 -0
  67. package/lib/live-player/demo/src/components/lib/vtx-upload/style/index.less +61 -0
  68. package/lib/live-player/demo/src/components/lib/vtx-ztree/style/index.css +29 -0
  69. package/lib/live-player/demo/src/components/lib/vtx-ztree/style/index.less +30 -0
  70. package/lib/live-player/demo/src/components/lib/vtx-ztree-select/style/index.css +66 -0
  71. package/lib/live-player/demo/src/components/lib/vtx-ztree-select/style/index.less +74 -0
  72. package/lib/live-player/demo/src/components/vtxModals/lib/be-input/style/index.css +13 -0
  73. package/lib/live-player/demo/src/components/vtxModals/lib/be-input/style/index.less +16 -0
  74. package/lib/live-player/demo/src/components/vtxModals/lib/theme/dark.css +17 -0
  75. package/lib/live-player/demo/src/components/vtxModals/lib/theme/dark.less +19 -0
  76. package/lib/live-player/demo/src/components/vtxModals/lib/theme/default.css +16 -0
  77. package/lib/live-player/demo/src/components/vtxModals/lib/theme/default.less +16 -0
  78. package/lib/live-player/demo/src/components/vtxModals/lib/theme/global.css +18 -0
  79. package/lib/live-player/demo/src/components/vtxModals/lib/theme/global.less +61 -0
  80. package/lib/live-player/demo/src/components/vtxModals/lib/vm-car-history/style/index.css +3 -0
  81. package/lib/live-player/demo/src/components/vtxModals/lib/vm-car-history/style/index.less +5 -0
  82. package/lib/live-player/demo/src/components/vtxModals/lib/vm-chart/style/index.css +9 -0
  83. package/lib/live-player/demo/src/components/vtxModals/lib/vm-chart/style/index.less +10 -0
  84. package/lib/live-player/demo/src/components/vtxModals/lib/vm-filter/style/index.css +109 -0
  85. package/lib/live-player/demo/src/components/vtxModals/lib/vm-filter/style/index.less +142 -0
  86. package/lib/live-player/demo/src/components/vtxModals/lib/vm-info-collection/style/index.css +22 -0
  87. package/lib/live-player/demo/src/components/vtxModals/lib/vm-info-collection/style/index.less +18 -0
  88. package/lib/live-player/demo/src/components/vtxModals/lib/vm-stat-collection/style/index.css +37 -0
  89. package/lib/live-player/demo/src/components/vtxModals/lib/vm-stat-collection/style/index.less +41 -0
  90. package/lib/live-player/demo/src/components/vtxModals/lib/vm-sub-tabs/style/index.css +42 -0
  91. package/lib/live-player/demo/src/components/vtxModals/lib/vm-sub-tabs/style/index.less +50 -0
  92. package/lib/live-player/demo/src/components/vtxModals/lib/vm-table/style/index.css +150 -0
  93. package/lib/live-player/demo/src/components/vtxModals/lib/vm-table/style/index.less +187 -0
  94. package/lib/live-player/demo/src/components/vtxModals/lib/vtx-base-modal/style/index.css +412 -0
  95. package/lib/live-player/demo/src/components/vtxModals/lib/vtx-base-modal/style/index.less +469 -0
  96. package/lib/live-player/demo/src/components/vtxModals/lib/vtx-community-modal/style/index.css +52 -0
  97. package/lib/live-player/demo/src/components/vtxModals/lib/vtx-community-modal/style/index.less +43 -0
  98. package/lib/live-player/demo/src/components/vtxModals/lib/vtx-construction-site-modal/style/index.css +108 -0
  99. package/lib/live-player/demo/src/components/vtxModals/lib/vtx-construction-site-modal/style/index.less +95 -0
  100. package/lib/live-player/demo/src/components/vtxModals/lib/vtx-full-screen-base-modal/style/index.css +81 -0
  101. package/lib/live-player/demo/src/components/vtxModals/lib/vtx-full-screen-base-modal/style/index.less +96 -0
  102. package/lib/live-player/demo/src/components/vtxModals/lib/vtx-gas-cylinder-file-modal/style/index.css +3 -0
  103. package/lib/live-player/demo/src/components/vtxModals/lib/vtx-gas-cylinder-file-modal/style/index.less +7 -0
  104. package/lib/live-player/demo/src/components/vtxModals/lib/vtx-gas-cylinder-file-modal/style/lastProcessFlow.css +67 -0
  105. package/lib/live-player/demo/src/components/vtxModals/lib/vtx-gas-cylinder-file-modal/style/lastProcessFlow.less +69 -0
  106. package/lib/live-player/demo/src/components/vtxModals/lib/vtx-gas-enterprise-modal/style/index.css +6 -0
  107. package/lib/live-player/demo/src/components/vtxModals/lib/vtx-gas-enterprise-modal/style/index.less +7 -0
  108. package/lib/live-player/demo/src/components/vtxModals/lib/vtx-gas-filling-station-modal/style/index.css +6 -0
  109. package/lib/live-player/demo/src/components/vtxModals/lib/vtx-gas-filling-station-modal/style/index.less +7 -0
  110. package/lib/live-player/demo/src/components/vtxModals/lib/vtx-gas-security-check-modal/style/index.css +0 -0
  111. package/lib/live-player/demo/src/components/vtxModals/lib/vtx-gas-security-check-modal/style/index.less +1 -0
  112. package/lib/live-player/demo/src/components/vtxModals/lib/vtx-gas-staff-modal/style/index.css +9 -0
  113. package/lib/live-player/demo/src/components/vtxModals/lib/vtx-gas-staff-modal/style/index.less +13 -0
  114. package/lib/live-player/demo/src/components/vtxModals/lib/vtx-gas-supply-station-modal/style/index.css +6 -0
  115. package/lib/live-player/demo/src/components/vtxModals/lib/vtx-gas-supply-station-modal/style/index.less +7 -0
  116. package/lib/live-player/demo/src/components/vtxModals/lib/vtx-gas-user-modal/style/index.css +0 -0
  117. package/lib/live-player/demo/src/components/vtxModals/lib/vtx-gas-user-modal/style/index.less +1 -0
  118. package/lib/live-player/demo/src/components/vtxModals/lib/vtx-vehicle-modal/style/index.css +245 -0
  119. package/lib/live-player/demo/src/components/vtxModals/lib/vtx-vehicle-modal/style/index.less +218 -0
  120. package/lib/live-player/demo/src/global.css +6 -0
  121. package/lib/live-player/demo/src/global.less +6 -0
  122. package/lib/live-player/demo/src/layouts/menu/index.css +31 -0
  123. package/lib/live-player/demo/src/layouts/menu/index.less +30 -0
  124. package/lib/live-player/demo/src/pages/carHistory/components/Cover/index.css +370 -0
  125. package/lib/live-player/demo/src/pages/carHistory/components/Cover/index.less +235 -0
  126. package/lib/live-player/demo/src/pages/carHistory/components/Earth/images/map2.jpg +0 -0
  127. package/lib/live-player/demo/src/pages/carHistory/components/Earth/images/map_inverted.png +0 -0
  128. package/lib/live-player/demo/src/pages/carHistory/components/Earth/images/radial_layers_medium2.jpg +0 -0
  129. package/lib/live-player/demo/src/pages/carHistory/components/Earth/images/universe4.jpg +0 -0
  130. package/lib/live-player/demo/src/pages/carHistory/components/Earth/index.css +10 -0
  131. package/lib/live-player/demo/src/pages/carHistory/components/Earth/index.less +10 -0
  132. package/lib/live-player/demo/src/pages/carHistory/components/video/index.d.ts +221 -0
  133. package/lib/live-player/demo/src/pages/carHistory/components/video/types/api/fetch.d.ts +12 -0
  134. package/lib/live-player/demo/src/pages/carHistory/components/video/types/api/index.d.ts +15 -0
  135. package/lib/live-player/demo/src/pages/carHistory/components/video/types/api/types.d.ts +107 -0
  136. package/lib/live-player/demo/src/pages/carHistory/components/video/types/components/bill-player/index.d.ts +21 -0
  137. package/lib/live-player/demo/src/pages/carHistory/components/video/types/components/controls/index.d.ts +52 -0
  138. package/lib/live-player/demo/src/pages/carHistory/components/video/types/components/history-control/index.d.ts +39 -0
  139. package/lib/live-player/demo/src/pages/carHistory/components/video/types/components/history-player/index.d.ts +31 -0
  140. package/lib/live-player/demo/src/pages/carHistory/components/video/types/components/live-channel-player/index.d.ts +16 -0
  141. package/lib/live-player/demo/src/pages/carHistory/components/video/types/components/live-control/index.d.ts +35 -0
  142. package/lib/live-player/demo/src/pages/carHistory/components/video/types/components/live-player/index.d.ts +22 -0
  143. package/lib/live-player/demo/src/pages/carHistory/components/video/types/components/player/index.d.ts +84 -0
  144. package/lib/live-player/demo/src/pages/carHistory/components/video/types/context/index.d.ts +8 -0
  145. package/lib/live-player/demo/src/pages/carHistory/components/video/types/hooks/useSettings.d.ts +9 -0
  146. package/lib/live-player/demo/src/pages/carHistory/components/video/types/icons/index.d.ts +54 -0
  147. package/lib/live-player/demo/src/pages/carHistory/components/video/types/main.d.ts +8 -0
  148. package/lib/live-player/demo/src/pages/carHistory/components/video/types/utils/index.d.ts +60 -0
  149. package/lib/live-player/demo/src/pages/carHistory/index.css +13 -0
  150. package/lib/live-player/demo/src/pages/carHistory/index.less +13 -0
  151. package/lib/live-player/demo/src/pages/demo/index.css +0 -0
  152. package/lib/live-player/demo/src/pages/demo/index.less +0 -0
  153. package/lib/live-player/demo/src/pages/test/components/map/VtxMap/AMap/AMap.css +27 -0
  154. package/lib/live-player/demo/src/pages/test/components/map/VtxMap/AMap/AMap.less +27 -0
  155. package/lib/live-player/demo/src/pages/test/components/map/VtxMap/BMap/Map.css +26 -0
  156. package/lib/live-player/demo/src/pages/test/components/map/VtxMap/BMap/Map.less +28 -0
  157. package/lib/live-player/demo/src/pages/test/components/map/VtxMap/GMap/Map.css +88 -0
  158. package/lib/live-player/demo/src/pages/test/components/map/VtxMap/GMap/Map.less +87 -0
  159. package/lib/live-player/demo/src/pages/test/components/map/VtxMap/Map.css +7 -0
  160. package/lib/live-player/demo/src/pages/test/components/map/VtxMap/Map.less +9 -0
  161. package/lib/live-player/demo/src/pages/test/components/map/VtxMap/OMap/Map.css +76 -0
  162. package/lib/live-player/demo/src/pages/test/components/map/VtxMap/OMap/Map.less +70 -0
  163. package/lib/live-player/demo/src/pages/test/components/map/VtxMap/OlMap/Map.css +169 -0
  164. package/lib/live-player/demo/src/pages/test/components/map/VtxMap/OlMap/Map.less +165 -0
  165. package/lib/live-player/demo/src/pages/test/components/map/VtxMap/TMap/TMap.css +31 -0
  166. package/lib/live-player/demo/src/pages/test/components/map/VtxMap/TMap/TMap.less +37 -0
  167. package/lib/live-player/demo/src/pages/test/components/map/VtxMap/images/defaultMarker.png +0 -0
  168. package/lib/live-player/demo/src/pages/test/components/map/VtxMap/images/defaultMarker_selected.png +0 -0
  169. package/lib/live-player/demo/src/pages/test/components/map/VtxModal/VtxModal.css +62 -0
  170. package/lib/live-player/demo/src/pages/test/components/map/VtxModal/VtxModal.less +67 -0
  171. package/lib/live-player/demo/src/pages/test/components/map/VtxModal/VtxModalAntd3.css +62 -0
  172. package/lib/live-player/demo/src/pages/test/components/map/VtxModal/VtxModalAntd3.less +67 -0
  173. package/lib/live-player/demo/src/pages/test/components/map/VtxSearchMap/VtxSearchMap.css +171 -0
  174. package/lib/live-player/demo/src/pages/test/components/map/VtxSearchMap/VtxSearchMap.less +171 -0
  175. package/lib/live-player/demo/src/pages/test/components/map/VtxSearchMap/VtxSearchMapAntd3.css +0 -0
  176. package/lib/live-player/demo/src/pages/test/components/map/VtxSearchMap/VtxSearchMapAntd3.less +1 -0
  177. package/lib/live-player/demo/src/pages/test/lib/be-input/style/index.css +13 -0
  178. package/lib/live-player/demo/src/pages/test/lib/be-input/style/index.less +16 -0
  179. package/lib/live-player/demo/src/pages/test/lib/theme/dark.css +16 -0
  180. package/lib/live-player/demo/src/pages/test/lib/theme/dark.less +18 -0
  181. package/lib/live-player/demo/src/pages/test/lib/theme/default.css +16 -0
  182. package/lib/live-player/demo/src/pages/test/lib/theme/default.less +16 -0
  183. package/lib/live-player/demo/src/pages/test/lib/theme/global.css +18 -0
  184. package/lib/live-player/demo/src/pages/test/lib/theme/global.less +61 -0
  185. package/lib/live-player/demo/src/pages/test/lib/vm-car-history/style/index.css +3 -0
  186. package/lib/live-player/demo/src/pages/test/lib/vm-car-history/style/index.less +5 -0
  187. package/lib/live-player/demo/src/pages/test/lib/vm-chart/style/index.css +9 -0
  188. package/lib/live-player/demo/src/pages/test/lib/vm-chart/style/index.less +10 -0
  189. package/lib/live-player/demo/src/pages/test/lib/vm-filter/style/index.css +112 -0
  190. package/lib/live-player/demo/src/pages/test/lib/vm-filter/style/index.less +146 -0
  191. package/lib/live-player/demo/src/pages/test/lib/vm-info-collection/style/index.css +17 -0
  192. package/lib/live-player/demo/src/pages/test/lib/vm-info-collection/style/index.less +17 -0
  193. package/lib/live-player/demo/src/pages/test/lib/vm-stat-collection/style/index.css +38 -0
  194. package/lib/live-player/demo/src/pages/test/lib/vm-stat-collection/style/index.less +41 -0
  195. package/lib/live-player/demo/src/pages/test/lib/vm-sub-tabs/style/index.css +42 -0
  196. package/lib/live-player/demo/src/pages/test/lib/vm-sub-tabs/style/index.less +50 -0
  197. package/lib/live-player/demo/src/pages/test/lib/vm-table/style/index.css +150 -0
  198. package/lib/live-player/demo/src/pages/test/lib/vm-table/style/index.less +187 -0
  199. package/lib/live-player/demo/src/pages/test/lib/vtx-base-modal/style/index.css +122 -0
  200. package/lib/live-player/demo/src/pages/test/lib/vtx-base-modal/style/index.less +123 -0
  201. package/lib/live-player/demo/src/pages/test/lib/vtx-community-modal/style/index.css +47 -0
  202. package/lib/live-player/demo/src/pages/test/lib/vtx-community-modal/style/index.less +41 -0
  203. package/lib/live-player/demo/src/pages/test/lib/vtx-construction-site-modal/style/index.css +100 -0
  204. package/lib/live-player/demo/src/pages/test/lib/vtx-construction-site-modal/style/index.less +90 -0
  205. package/lib/live-player/demo/src/pages/test/lib/vtx-vehicle-modal/style/index.css +228 -0
  206. package/lib/live-player/demo/src/pages/test/lib/vtx-vehicle-modal/style/index.less +201 -0
  207. package/lib/live-player/style/css.js +2 -0
  208. package/lib/live-player/style/css.js.map +1 -1
  209. package/lib/live-player/style/index.d.ts +1 -0
  210. package/lib/live-player/style/index.js +2 -0
  211. package/lib/live-player/style/index.js.map +1 -1
  212. package/package.json +1 -1
@@ -0,0 +1,221 @@
1
+ /// <reference types="react" />
2
+ import moment from 'moment';
3
+ import { CloudControlPanelProps } from '@/components/controls';
4
+ import { VideoType as VideoType$1 } from '@/components/player';
5
+ import * as react from 'react';
6
+ import { GetHistoryUrlParams, LoadVideoInfoParams } from '@/api/types';
7
+
8
+ /** 视频流格式 */
9
+ declare type VideoType = 'flv' | 'hls' | 'hk_ws';
10
+ interface ConstructorParams {
11
+ url: string;
12
+ /** 渲染容器 */
13
+ container: HTMLDivElement;
14
+ /** 是否直播,flv.js需要 */
15
+ live?: boolean;
16
+ /** 视频流格式 */
17
+ type?: VideoType;
18
+ /** 开始时间,历史回放需要 */
19
+ startTime?: moment.MomentInput;
20
+ /** 结束时间,历史回放需要 */
21
+ endTime?: moment.MomentInput;
22
+ }
23
+ /**
24
+ * 视频播放核心类
25
+ */
26
+ declare class Player {
27
+ /** 视频地址 */
28
+ url: string;
29
+ /** 视频流格式 */
30
+ type: VideoType;
31
+ private player;
32
+ private video;
33
+ /** 开始时间,历史回放需要 */
34
+ private startTime?;
35
+ /** 结束时间,历史回放需要 */
36
+ private endTime?;
37
+ /** 跳转时间,用于处理进度条位置 */
38
+ private seekTime?;
39
+ /** 之前的视频播放速度,用于处理海康音量控制 */
40
+ private preSpeed;
41
+ constructor(params: ConstructorParams);
42
+ /** 播放 */
43
+ play(): Promise<void>;
44
+ /** 回放 */
45
+ playBack(): Promise<void>;
46
+ /** 销毁 */
47
+ destroy(): void;
48
+ /** 截图 */
49
+ capture(captureName?: string, time?: boolean): void;
50
+ /** 尺寸重置 */
51
+ resize(): void;
52
+ /**
53
+ * 设置音量
54
+ * @param value
55
+ */
56
+ setVolume(value: number): void;
57
+ /**
58
+ * 设置播放速度
59
+ * @param speed
60
+ */
61
+ setSpeed(speed: 0.5 | 1 | 2 | 4 | 8): void;
62
+ /**
63
+ * 时间更新事件
64
+ * @param callback 回调函数
65
+ */
66
+ onTimeUpdate(callback: (currentTime: number, speed: number) => void): void;
67
+ /** 跳转到 */
68
+ seekTo(time: number): Promise<void>;
69
+ /**
70
+ * 暂停播放
71
+ * @param callback 回调函数
72
+ */
73
+ pause(callback?: () => void): void;
74
+ /**
75
+ * 恢复播放
76
+ * @param callback 回调函数
77
+ */
78
+ resume(callback?: () => void): void;
79
+ /**
80
+ * 开始对讲
81
+ * @param url 对讲地址
82
+ */
83
+ startTalk(url: string): Promise<void>;
84
+ /**
85
+ * 开始对讲
86
+ * @param state 状态
87
+ */
88
+ stopTalk(): Promise<void>;
89
+ }
90
+
91
+ interface VtxPlayerProps$1 {
92
+ /** 视频流地址 */
93
+ url: string;
94
+ /** 宽度 */
95
+ width?: number;
96
+ /** 高度 */
97
+ height?: number;
98
+ /** 视频流格式,如果为空则根据url自行判断 */
99
+ type?: VideoType$1;
100
+ /** 截图文件名 */
101
+ captureName?: string;
102
+ /** 对讲地址 */
103
+ talkUrl?: string;
104
+ /** 云台控制 */
105
+ cloudParams?: CloudControlPanelProps;
106
+ }
107
+ declare const LivePlayer: (props: VtxPlayerProps$1) => JSX.Element;
108
+
109
+ declare type HistoryPlayerHandle = {
110
+ /**
111
+ * 跳转,目前仅支持海康视频跳转
112
+ */
113
+ seekTo: (time: string) => Promise<void>;
114
+ };
115
+ interface VtxPlayerProps {
116
+ /** 视频流地址 */
117
+ url: string;
118
+ /** 视频流格式,如果为空则根据url自行判断 */
119
+ type?: VideoType$1;
120
+ /** 开始时间,格式为:YYYY-MM-DD HH:mm:ss */
121
+ startTime: string;
122
+ /** 结束时间,格式为:YYYY-MM-DD HH:mm:ss */
123
+ endTime: string;
124
+ /** 宽度 */
125
+ width?: number;
126
+ /** 高度 */
127
+ height?: number;
128
+ /** 截图文件名 */
129
+ captureName?: string;
130
+ /** 控制条bottom */
131
+ controlBottom?: number;
132
+ /** 播放器进度回调,time:YYYY-MM-DD HH:mm:ss speed:播放速率 */
133
+ onTimeChange?: (time: string, speed: number) => void;
134
+ }
135
+ declare const HistoryPlayer: react.ForwardRefExoticComponent<VtxPlayerProps & react.RefAttributes<HistoryPlayerHandle>>;
136
+
137
+ declare type LiveControlHandle = {
138
+ /** 加载视频 */
139
+ load: (channel: ChannelType) => void;
140
+ /** 卸载视频,参数为通道编号 */
141
+ unLoad: (channelNum: string) => void;
142
+ /** 一次加载多个视频,适用于初始化 */
143
+ multiLoad: (channels: ChannelType[]) => void;
144
+ };
145
+ interface LiveControlProps {
146
+ /** 展开/收缩按钮回调 */
147
+ onExpandChange?: (expand: boolean) => void;
148
+ /** 视频关闭回调,参数为通道编号数组 */
149
+ onChannelChange?: (channelSNum: string[]) => void;
150
+ /** 宽度 */
151
+ width?: number | string;
152
+ /** 高度 */
153
+ height?: number | string;
154
+ /** 轮询频率 */
155
+ polling?: number | undefined;
156
+ }
157
+ declare type ChannelType = {
158
+ /** 通道号 */
159
+ channelNum: string;
160
+ /** 设备ID */
161
+ deviceId?: string;
162
+ /** 协议 */
163
+ protocol?: string;
164
+ };
165
+ /**
166
+ * 实时分屏组件
167
+ */
168
+ declare const LiveControl: react.ForwardRefExoticComponent<LiveControlProps & react.RefAttributes<LiveControlHandle>>;
169
+
170
+ declare type HistoryControlHandle = {
171
+ load: (channel: GetHistoryUrlParams) => void;
172
+ };
173
+ interface HistoryControlProps {
174
+ /** 宽度 */
175
+ width?: number;
176
+ /** 高度 */
177
+ height?: number;
178
+ /** 展开/收缩按钮回调 */
179
+ onExpandChange?: (expand: boolean) => void;
180
+ /** 播放器进度回调,time:YYYY-MM-DD HH:mm:ss */
181
+ onTimeChange?: (time: string) => void;
182
+ }
183
+ /**
184
+ * 历史视频控制器
185
+ */
186
+ declare const HistoryControl: react.ForwardRefExoticComponent<HistoryControlProps & react.RefAttributes<HistoryControlHandle>>;
187
+
188
+ interface BillPlayerProps {
189
+ /** 参数 */
190
+ params: LoadVideoInfoParams;
191
+ /** 宽度 */
192
+ width?: string | number;
193
+ /** 高度 */
194
+ height?: string | number;
195
+ /** 是否显示实时视频,默认为true */
196
+ live?: boolean;
197
+ /** 是否显示历史视频,默认为true */
198
+ history?: boolean;
199
+ /** 实时默认播放 */
200
+ defaultLivePlay?: boolean;
201
+ /** 历史默认播放 */
202
+ defaultHistoryPlay?: boolean;
203
+ }
204
+ declare const BillPlayer: (props: BillPlayerProps) => JSX.Element;
205
+
206
+ interface LiveChannelPlayerProps {
207
+ /** 通道ID */
208
+ channelId: string;
209
+ /** 宽度 */
210
+ width?: number;
211
+ /** 高度 */
212
+ height?: number;
213
+ }
214
+ /**
215
+ * 基于通道ID的实时播放器
216
+ * @param props
217
+ * @returns
218
+ */
219
+ declare const LiveChannelPlayer: (props: LiveChannelPlayerProps) => JSX.Element | undefined;
220
+
221
+ export { BillPlayer, HistoryControl, HistoryPlayer, LiveChannelPlayer, LiveControl, LivePlayer, Player };
@@ -0,0 +1,12 @@
1
+ interface VMFetchProps {
2
+ /** 请求体 */
3
+ data?: any;
4
+ /** 请求头 */
5
+ headersEx?: object;
6
+ }
7
+ /**
8
+ * 数据fetch总入口
9
+ * @param props
10
+ */
11
+ declare const Fetch: <T>(url: string, type?: 'GET' | 'POST', params?: VMFetchProps) => Promise<T>;
12
+ export default Fetch;
@@ -0,0 +1,15 @@
1
+ import * as Types from './types';
2
+ /** 获取预览地址 */
3
+ export declare const getPreviewUrl: (data: Types.GetPreviewUrlParams) => Promise<Types.GetPreviewUrlResp>;
4
+ /** 获取历史地址 */
5
+ export declare const getHistoryUrl: (data: Types.GetHistoryUrlParams) => Promise<Types.GetHistoryUrlResp>;
6
+ /** 获取视频信息 */
7
+ export declare const loadVideoInfo: (data: Types.LoadVideoInfoParams) => Promise<Types.LoadVideoInfoResp>;
8
+ /** 云台控制 */
9
+ export declare const cloudControl: (data: Types.CloudControlParams) => Promise<unknown>;
10
+ /**
11
+ * 获取通道信息
12
+ * @param channelId 通道ID
13
+ * @returns
14
+ */
15
+ export declare const loadVideoChannel: (channelId: string) => Promise<Types.LoadVideoChannelResp>;
@@ -0,0 +1,107 @@
1
+ /** 获取预览地址Resp */
2
+ export interface GetPreviewUrlResp {
3
+ /** 对讲地址 */
4
+ apiUrl: string;
5
+ /** 地址 */
6
+ url: string;
7
+ /** 设备名称 */
8
+ deviceName: string;
9
+ /** 设备ID */
10
+ deviceId: string;
11
+ /** 通道名称 */
12
+ channelName: string;
13
+ /** 通道编号 */
14
+ channelNum: string;
15
+ /** 播放器 */
16
+ player: string | null;
17
+ /** 是否可以对讲,1为可以,0为不可以 */
18
+ beenHasVideo?: 1 | 0;
19
+ /** 云台类型,1全功能,2不能转动,3不能变焦,4无功能 */
20
+ ptzType?: 1 | 2 | 3 | 4;
21
+ }
22
+ /** 获取预览地址Params */
23
+ export interface GetPreviewUrlParams {
24
+ /** 频道号 */
25
+ channelNum: string;
26
+ /** 设备ID */
27
+ deviceId: string;
28
+ /** 协议 */
29
+ protocol?: string;
30
+ }
31
+ /** 历史地址子项 */
32
+ export interface HistoryUrlItem {
33
+ /** 开始时间 */
34
+ beginTime: string;
35
+ /** 结束时间 */
36
+ endTime: string;
37
+ /** 回放地址 */
38
+ playbackUrl: string | null;
39
+ /** 大小 */
40
+ size: number;
41
+ }
42
+ /** 获取历史地址Resp */
43
+ export interface GetHistoryUrlResp {
44
+ /** 设备名称 */
45
+ deviceName: string;
46
+ /** 通道名称 */
47
+ channelName: string;
48
+ /** url列表 */
49
+ list: HistoryUrlItem[];
50
+ /** 播放器 */
51
+ player: string | null;
52
+ /** 全时播放地址 */
53
+ totalTimeUrl: string;
54
+ /** 地址 */
55
+ url: string;
56
+ }
57
+ /** 获取历史地址Params */
58
+ export interface GetHistoryUrlParams {
59
+ /** 频道号 */
60
+ channelNum: string;
61
+ /** 设备ID */
62
+ deviceId: string;
63
+ /** 协议 */
64
+ protocol?: string;
65
+ /** 开始时间,格式:2022-06-01 00:00:00 */
66
+ beginTime: string;
67
+ /** 结束时间,格式:2022-06-01 23:59:59 */
68
+ endTime: string;
69
+ }
70
+ /** 获取视频信息Params */
71
+ export interface LoadVideoInfoParams {
72
+ /** 业务ID */
73
+ billId: string;
74
+ }
75
+ export interface LoadVideoInfo {
76
+ /** 频道号 */
77
+ channelNum: string;
78
+ /** 设备ID */
79
+ videoDeviceId: string;
80
+ /** 通道名称 */
81
+ channelName: string;
82
+ }
83
+ /** 获取视频信息Resp */
84
+ export declare type LoadVideoInfoResp = LoadVideoInfo[];
85
+ /** 云台控制Params */
86
+ export declare type CloudControlParams = {
87
+ /** 频道号 */
88
+ channelNum: string;
89
+ /** 设备ID */
90
+ deviceId: string;
91
+ /** 操作:1为按下,0为放开 */
92
+ action: 1 | 0;
93
+ /** 命令 */
94
+ command: CloudControlCommandType;
95
+ };
96
+ /** 云台控制命令 */
97
+ export declare type CloudControlCommandType = 'LEFT' | 'RIGHT' | 'UP' | 'DOWN' | 'LEFT_UP' | 'LEFT_DOWN' | 'RIGHT_UP' | 'RIGHT_DOWN' | 'ZOOM_IN' | 'ZOOM_OUT' | 'FOCUS_NEAR' | 'FOCUS_FAR' | 'IRIS_ENLARGE' | 'IRIS_REDUCE';
98
+ export declare type LoadVideoChannelParams = {
99
+ /** 通道ID */
100
+ videoChannelId: string;
101
+ };
102
+ export declare type LoadVideoChannelResp = {
103
+ /** 通道号 */
104
+ channelNum: string;
105
+ /** 设备ID */
106
+ videoDeviceId: string;
107
+ };
@@ -0,0 +1,21 @@
1
+ /// <reference types="react" />
2
+ import './index.less';
3
+ import { LoadVideoInfoParams } from '@/api/types';
4
+ interface BillPlayerProps {
5
+ /** 参数 */
6
+ params: LoadVideoInfoParams;
7
+ /** 宽度 */
8
+ width?: string | number;
9
+ /** 高度 */
10
+ height?: string | number;
11
+ /** 是否显示实时视频,默认为true */
12
+ live?: boolean;
13
+ /** 是否显示历史视频,默认为true */
14
+ history?: boolean;
15
+ /** 实时默认播放 */
16
+ defaultLivePlay?: boolean;
17
+ /** 历史默认播放 */
18
+ defaultHistoryPlay?: boolean;
19
+ }
20
+ export declare const BillPlayer: (props: BillPlayerProps) => JSX.Element;
21
+ export default BillPlayer;
@@ -0,0 +1,52 @@
1
+ /// <reference types="react" />
2
+ import './index.less';
3
+ import Player from '../player';
4
+ import { CloudControlParams } from '@/api/types';
5
+ interface VolumeControlProps {
6
+ container: HTMLDivElement | null;
7
+ player?: Player;
8
+ defaultValue?: number;
9
+ }
10
+ /** 音量控制 */
11
+ export declare const VolumeControl: (props: VolumeControlProps) => JSX.Element;
12
+ declare type SpeedValue = 0.5 | 1 | 2 | 4 | 8;
13
+ interface SpeedControlProps {
14
+ container: HTMLDivElement | null;
15
+ player?: Player;
16
+ defaultValue?: SpeedValue;
17
+ }
18
+ /** 速度控制 */
19
+ export declare const SpeedControl: (props: SpeedControlProps) => JSX.Element;
20
+ interface ErrorStateProps {
21
+ /** 重试回调 */
22
+ onClick?: () => void;
23
+ }
24
+ export declare const ErrorState: (props: ErrorStateProps) => JSX.Element;
25
+ export declare const LoadingState: () => JSX.Element;
26
+ interface PlayerHeaderProps {
27
+ /** 名称 */
28
+ name: string;
29
+ /** 关闭回调 */
30
+ onClose: () => void;
31
+ }
32
+ /** 播放器头部 */
33
+ export declare const PlayerHeader: (props: PlayerHeaderProps) => JSX.Element;
34
+ interface TalkControlProps {
35
+ /** 播放器 */
36
+ player?: Player;
37
+ /** 对讲url */
38
+ url: string;
39
+ }
40
+ /**
41
+ * 对讲控制器
42
+ * @returns
43
+ */
44
+ export declare const TalkControl: (props: TalkControlProps) => JSX.Element;
45
+ export declare type CloudControlType = 'all' | 'onlyFocus' | 'onlyRotate' | 'none';
46
+ export declare type CloudControlPanelProps = {
47
+ query: Omit<CloudControlParams, 'action' | 'command'>;
48
+ type: CloudControlType;
49
+ };
50
+ /** 云台控制面板 */
51
+ export declare const CloudControlPanel: (props: CloudControlPanelProps) => JSX.Element;
52
+ export {};
@@ -0,0 +1,39 @@
1
+ /// <reference types="react" />
2
+ import './index.less';
3
+ import { GetHistoryUrlParams } from '@/api/types';
4
+ export declare type HistoryControlHandle = {
5
+ load: (channel: GetHistoryUrlParams) => void;
6
+ };
7
+ interface HistoryControlProps {
8
+ /** 宽度 */
9
+ width?: number;
10
+ /** 高度 */
11
+ height?: number;
12
+ /** 展开/收缩按钮回调 */
13
+ onExpandChange?: (expand: boolean) => void;
14
+ /** 播放器进度回调,time:YYYY-MM-DD HH:mm:ss */
15
+ onTimeChange?: (time: string) => void;
16
+ }
17
+ /**
18
+ * 历史视频控制器
19
+ */
20
+ export declare const HistoryControl: import("react").ForwardRefExoticComponent<HistoryControlProps & import("react").RefAttributes<HistoryControlHandle>>;
21
+ export declare type UrlsTableItemType = {
22
+ /** 序号 */
23
+ index: number;
24
+ /** 设备名称 */
25
+ deviceName: string;
26
+ /** 通道名称 */
27
+ channelName: string;
28
+ /** 开始时间 */
29
+ beginTime: string;
30
+ /** 结束时间 */
31
+ endTime: string;
32
+ /** 视频时长 */
33
+ duration: string;
34
+ /** 视频大小 */
35
+ size: string;
36
+ /** 地址 */
37
+ url: string;
38
+ };
39
+ export default HistoryControl;
@@ -0,0 +1,31 @@
1
+ /// <reference types="react" />
2
+ import './index.less';
3
+ import { VideoType } from '@/components/player';
4
+ export declare type HistoryPlayerHandle = {
5
+ /**
6
+ * 跳转,目前仅支持海康视频跳转
7
+ */
8
+ seekTo: (time: string) => Promise<void>;
9
+ };
10
+ interface VtxPlayerProps {
11
+ /** 视频流地址 */
12
+ url: string;
13
+ /** 视频流格式,如果为空则根据url自行判断 */
14
+ type?: VideoType;
15
+ /** 开始时间,格式为:YYYY-MM-DD HH:mm:ss */
16
+ startTime: string;
17
+ /** 结束时间,格式为:YYYY-MM-DD HH:mm:ss */
18
+ endTime: string;
19
+ /** 宽度 */
20
+ width?: number;
21
+ /** 高度 */
22
+ height?: number;
23
+ /** 截图文件名 */
24
+ captureName?: string;
25
+ /** 控制条bottom */
26
+ controlBottom?: number;
27
+ /** 播放器进度回调,time:YYYY-MM-DD HH:mm:ss speed:播放速率 */
28
+ onTimeChange?: (time: string, speed: number) => void;
29
+ }
30
+ export declare const HistoryPlayer: import("react").ForwardRefExoticComponent<VtxPlayerProps & import("react").RefAttributes<HistoryPlayerHandle>>;
31
+ export default HistoryPlayer;
@@ -0,0 +1,16 @@
1
+ /// <reference types="react" />
2
+ interface LiveChannelPlayerProps {
3
+ /** 通道ID */
4
+ channelId: string;
5
+ /** 宽度 */
6
+ width?: number;
7
+ /** 高度 */
8
+ height?: number;
9
+ }
10
+ /**
11
+ * 基于通道ID的实时播放器
12
+ * @param props
13
+ * @returns
14
+ */
15
+ export declare const LiveChannelPlayer: (props: LiveChannelPlayerProps) => JSX.Element | undefined;
16
+ export default LiveChannelPlayer;
@@ -0,0 +1,35 @@
1
+ /// <reference types="react" />
2
+ import './index.less';
3
+ export declare type LiveControlHandle = {
4
+ /** 加载视频 */
5
+ load: (channel: ChannelType) => void;
6
+ /** 卸载视频,参数为通道编号 */
7
+ unLoad: (channelNum: string) => void;
8
+ /** 一次加载多个视频,适用于初始化 */
9
+ multiLoad: (channels: ChannelType[]) => void;
10
+ };
11
+ interface LiveControlProps {
12
+ /** 展开/收缩按钮回调 */
13
+ onExpandChange?: (expand: boolean) => void;
14
+ /** 视频关闭回调,参数为通道编号数组 */
15
+ onChannelChange?: (channelSNum: string[]) => void;
16
+ /** 宽度 */
17
+ width?: number | string;
18
+ /** 高度 */
19
+ height?: number | string;
20
+ /** 轮询频率 */
21
+ polling?: number | undefined;
22
+ }
23
+ export declare type ChannelType = {
24
+ /** 通道号 */
25
+ channelNum: string;
26
+ /** 设备ID */
27
+ deviceId?: string;
28
+ /** 协议 */
29
+ protocol?: string;
30
+ };
31
+ /**
32
+ * 实时分屏组件
33
+ */
34
+ declare const LiveControl: import("react").ForwardRefExoticComponent<LiveControlProps & import("react").RefAttributes<LiveControlHandle>>;
35
+ export default LiveControl;
@@ -0,0 +1,22 @@
1
+ /// <reference types="react" />
2
+ import './index.less';
3
+ import { CloudControlPanelProps } from '@/components/controls';
4
+ import { VideoType } from '@/components/player';
5
+ interface VtxPlayerProps {
6
+ /** 视频流地址 */
7
+ url: string;
8
+ /** 宽度 */
9
+ width?: number;
10
+ /** 高度 */
11
+ height?: number;
12
+ /** 视频流格式,如果为空则根据url自行判断 */
13
+ type?: VideoType;
14
+ /** 截图文件名 */
15
+ captureName?: string;
16
+ /** 对讲地址 */
17
+ talkUrl?: string;
18
+ /** 云台控制 */
19
+ cloudParams?: CloudControlPanelProps;
20
+ }
21
+ export declare const LivePlayer: (props: VtxPlayerProps) => JSX.Element;
22
+ export default LivePlayer;
@@ -0,0 +1,84 @@
1
+ import moment from 'moment';
2
+ /** 视频流格式 */
3
+ export declare type VideoType = 'flv' | 'hls' | 'hk_ws';
4
+ interface ConstructorParams {
5
+ url: string;
6
+ /** 渲染容器 */
7
+ container: HTMLDivElement;
8
+ /** 是否直播,flv.js需要 */
9
+ live?: boolean;
10
+ /** 视频流格式 */
11
+ type?: VideoType;
12
+ /** 开始时间,历史回放需要 */
13
+ startTime?: moment.MomentInput;
14
+ /** 结束时间,历史回放需要 */
15
+ endTime?: moment.MomentInput;
16
+ }
17
+ /**
18
+ * 视频播放核心类
19
+ */
20
+ declare class Player {
21
+ /** 视频地址 */
22
+ url: string;
23
+ /** 视频流格式 */
24
+ type: VideoType;
25
+ private player;
26
+ private video;
27
+ /** 开始时间,历史回放需要 */
28
+ private startTime?;
29
+ /** 结束时间,历史回放需要 */
30
+ private endTime?;
31
+ /** 跳转时间,用于处理进度条位置 */
32
+ private seekTime?;
33
+ /** 之前的视频播放速度,用于处理海康音量控制 */
34
+ private preSpeed;
35
+ constructor(params: ConstructorParams);
36
+ /** 播放 */
37
+ play(): Promise<void>;
38
+ /** 回放 */
39
+ playBack(): Promise<void>;
40
+ /** 销毁 */
41
+ destroy(): void;
42
+ /** 截图 */
43
+ capture(captureName?: string, time?: boolean): void;
44
+ /** 尺寸重置 */
45
+ resize(): void;
46
+ /**
47
+ * 设置音量
48
+ * @param value
49
+ */
50
+ setVolume(value: number): void;
51
+ /**
52
+ * 设置播放速度
53
+ * @param speed
54
+ */
55
+ setSpeed(speed: 0.5 | 1 | 2 | 4 | 8): void;
56
+ /**
57
+ * 时间更新事件
58
+ * @param callback 回调函数
59
+ */
60
+ onTimeUpdate(callback: (currentTime: number, speed: number) => void): void;
61
+ /** 跳转到 */
62
+ seekTo(time: number): Promise<void>;
63
+ /**
64
+ * 暂停播放
65
+ * @param callback 回调函数
66
+ */
67
+ pause(callback?: () => void): void;
68
+ /**
69
+ * 恢复播放
70
+ * @param callback 回调函数
71
+ */
72
+ resume(callback?: () => void): void;
73
+ /**
74
+ * 开始对讲
75
+ * @param url 对讲地址
76
+ */
77
+ startTalk(url: string): Promise<void>;
78
+ /**
79
+ * 开始对讲
80
+ * @param state 状态
81
+ */
82
+ stopTalk(): Promise<void>;
83
+ }
84
+ export default Player;
@@ -0,0 +1,8 @@
1
+ import React from 'react';
2
+ export declare const PlayerThemeContext: React.Context<Context>;
3
+ interface Context {
4
+ /** 主题 */
5
+ theme: 'light' | 'dark';
6
+ }
7
+ declare const PlayerThemeProvider: React.Provider<Context>;
8
+ export default PlayerThemeProvider;
@@ -0,0 +1,9 @@
1
+ /**
2
+ * 获取配置信息
3
+ * @returns
4
+ */
5
+ declare const useSettings: () => {
6
+ theme: "light" | "dark";
7
+ isDark: boolean;
8
+ };
9
+ export default useSettings;