@cloud-app-dev/vidc 4.0.19 → 4.0.21

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 (410) hide show
  1. package/es/AppContext/Sync.d.ts +8 -0
  2. package/es/AppContext/Sync.js +42 -0
  3. package/es/AppContext/index.d.ts +10 -0
  4. package/es/AppContext/index.js +141 -0
  5. package/es/AppContext/interface.d.ts +41 -0
  6. package/es/AppContext/static.d.ts +8 -0
  7. package/es/AppContext/static.js +9 -0
  8. package/es/Auth/index.d.ts +8 -0
  9. package/es/Auth/index.js +14 -0
  10. package/es/AutoExit/index.d.ts +6 -0
  11. package/es/AutoExit/index.js +19 -0
  12. package/es/CheckGroupFixed/demo.d.ts +3 -0
  13. package/es/CheckGroupFixed/demo.js +22 -0
  14. package/es/CheckGroupFixed/index.d.ts +24 -0
  15. package/es/CheckGroupFixed/index.js +140 -0
  16. package/es/CheckGroupFixed/index.less +56 -0
  17. package/es/Config/index.d.ts +4 -0
  18. package/es/Config/index.js +77 -0
  19. package/es/Config/interface.d.ts +65 -0
  20. package/es/Config/utils.d.ts +4 -0
  21. package/es/Config/utils.js +33 -0
  22. package/es/ConfigContext/index.d.ts +17 -0
  23. package/es/ConfigContext/index.js +21 -0
  24. package/es/CustomRenderSelect/index.d.ts +12 -0
  25. package/es/CustomRenderSelect/index.js +73 -0
  26. package/es/CustomRenderSelect/index.less +25 -0
  27. package/es/DBTools/index.d.ts +25 -0
  28. package/es/DBTools/index.js +336 -0
  29. package/es/DisableMark/index.d.ts +9 -0
  30. package/es/DisableMark/index.js +19 -0
  31. package/es/DisableMark/index.less +9 -0
  32. package/es/DomMove/demo.d.ts +2 -0
  33. package/es/DomMove/demo.js +16 -0
  34. package/es/DomMove/index.d.ts +16 -0
  35. package/es/DomMove/index.js +139 -0
  36. package/es/DomMove/utils.d.ts +8 -0
  37. package/es/DomMove/utils.js +32 -0
  38. package/es/Drag/DragAndDropItem.d.ts +4 -0
  39. package/es/Drag/DragAndDropItem.js +134 -0
  40. package/es/Drag/DropItem.d.ts +4 -0
  41. package/es/Drag/DropItem.js +50 -0
  42. package/es/Drag/index.d.ts +7 -0
  43. package/es/Drag/index.js +7 -0
  44. package/es/Drag/interface.d.ts +16 -0
  45. package/es/DynamicGridList/Demo.d.ts +3 -0
  46. package/es/DynamicGridList/Demo.js +77 -0
  47. package/es/DynamicGridList/index.d.ts +24 -0
  48. package/es/DynamicGridList/index.js +67 -0
  49. package/es/DynamicList/demo.d.ts +2 -0
  50. package/es/DynamicList/demo.js +44 -0
  51. package/es/DynamicList/index.d.ts +22 -0
  52. package/es/DynamicList/index.js +86 -0
  53. package/es/DynamicList/index.less +17 -0
  54. package/es/DynamicList/interface.d.ts +19 -0
  55. package/es/DynamicList/utils.d.ts +4 -0
  56. package/es/DynamicList/utils.js +6 -0
  57. package/es/ErrorFallback/index.d.ts +9 -0
  58. package/es/ErrorFallback/index.js +31 -0
  59. package/es/ErrorFallback/inerface.d.ts +48 -0
  60. package/es/EventTools/index.d.ts +3 -0
  61. package/es/EventTools/index.js +12 -0
  62. package/es/FrontendPlayer/index.d.ts +4 -0
  63. package/es/FrontendPlayer/index.js +2 -0
  64. package/es/FullScreen/index.d.ts +22 -0
  65. package/es/FullScreen/index.js +33 -0
  66. package/es/FullScreen/index.less +18 -0
  67. package/es/GridList/Demo.d.ts +3 -0
  68. package/es/GridList/Demo.js +80 -0
  69. package/es/GridList/data.d.ts +16 -0
  70. package/es/GridList/data.js +609 -0
  71. package/es/GridList/hook.d.ts +13 -0
  72. package/es/GridList/hook.js +270 -0
  73. package/es/GridList/index.d.ts +15 -0
  74. package/es/GridList/index.js +44 -0
  75. package/es/GridList/index.less +8 -0
  76. package/es/GridList/interface.d.ts +59 -0
  77. package/es/GridList/utils.d.ts +9 -0
  78. package/es/GridList/utils.js +42 -0
  79. package/es/HightLevel/index.d.ts +9 -0
  80. package/es/HightLevel/index.js +18 -0
  81. package/es/HightLevel/index.less +3 -0
  82. package/es/IconFont/index.d.ts +12 -0
  83. package/es/IconFont/index.js +54 -0
  84. package/es/ImageView/index.d.ts +20 -0
  85. package/es/ImageView/index.js +51 -0
  86. package/es/ImageView/index.less +11 -0
  87. package/es/InstanceHistory/index.d.ts +3 -0
  88. package/es/InstanceHistory/index.js +7 -0
  89. package/es/LabelPlayer/111.png +0 -0
  90. package/es/LabelPlayer/demo.d.ts +2 -0
  91. package/es/LabelPlayer/demo.js +115 -0
  92. package/es/LabelPlayer/index.d.ts +21 -0
  93. package/es/LabelPlayer/index.js +160 -0
  94. package/es/LabelPlayer/index.less +24 -0
  95. package/es/LabelValue/index.d.ts +15 -0
  96. package/es/LabelValue/index.js +27 -0
  97. package/es/LabelValue/index.less +23 -0
  98. package/es/List/demo.d.ts +3 -0
  99. package/es/List/demo.js +23 -0
  100. package/es/List/index.d.ts +28 -0
  101. package/es/List/index.js +28 -0
  102. package/es/List/index.less +20 -0
  103. package/es/ListWithSizeAnimate/demo.d.ts +2 -0
  104. package/es/ListWithSizeAnimate/demo.js +98 -0
  105. package/es/ListWithSizeAnimate/index.d.ts +14 -0
  106. package/es/ListWithSizeAnimate/index.js +85 -0
  107. package/es/ListWithSizeAnimate/index.less +23 -0
  108. package/es/LoaderScript/index.d.ts +47 -0
  109. package/es/LoaderScript/index.js +34 -0
  110. package/es/LoaderScript/utils.d.ts +13 -0
  111. package/es/LoaderScript/utils.js +179 -0
  112. package/es/Map/AMap.d.ts +7109 -0
  113. package/es/Map/BasicMap/AMapInstance.d.ts +19 -0
  114. package/es/Map/BasicMap/AMapInstance.js +98 -0
  115. package/es/Map/BasicMap/LeafletInstance.d.ts +18 -0
  116. package/es/Map/BasicMap/LeafletInstance.js +111 -0
  117. package/es/Map/BasicMap/index.d.ts +9 -0
  118. package/es/Map/BasicMap/index.js +90 -0
  119. package/es/Map/BasicMap/index.less +29 -0
  120. package/es/Map/ClusterLayer/demo.d.ts +3 -0
  121. package/es/Map/ClusterLayer/demo.js +18 -0
  122. package/es/Map/ClusterLayer/hook.d.ts +5 -0
  123. package/es/Map/ClusterLayer/hook.js +123 -0
  124. package/es/Map/ClusterLayer/index.d.ts +6 -0
  125. package/es/Map/ClusterLayer/index.js +28 -0
  126. package/es/Map/ClusterLayer/index.less +29 -0
  127. package/es/Map/ClusterLayer/props.d.ts +8 -0
  128. package/es/Map/Config/index.d.ts +9 -0
  129. package/es/Map/Config/index.js +48 -0
  130. package/es/Map/Config/utils.d.ts +2 -0
  131. package/es/Map/Config/utils.js +65 -0
  132. package/es/Map/Context/index.d.ts +11 -0
  133. package/es/Map/Context/index.js +51 -0
  134. package/es/Map/FindPio/index.d.ts +4 -0
  135. package/es/Map/FindPio/index.js +13 -0
  136. package/es/Map/FindPio/index.less +7 -0
  137. package/es/Map/InfoWindow/MakerLikeWindow.d.ts +4 -0
  138. package/es/Map/InfoWindow/MakerLikeWindow.js +112 -0
  139. package/es/Map/InfoWindow/demo.d.ts +3 -0
  140. package/es/Map/InfoWindow/demo.js +70 -0
  141. package/es/Map/InfoWindow/index.d.ts +11 -0
  142. package/es/Map/InfoWindow/index.js +66 -0
  143. package/es/Map/LevelCenter/DragMarker/index.d.ts +10 -0
  144. package/es/Map/LevelCenter/DragMarker/index.js +42 -0
  145. package/es/Map/LevelCenter/demo.d.ts +3 -0
  146. package/es/Map/LevelCenter/demo.js +38 -0
  147. package/es/Map/LevelCenter/index.d.ts +15 -0
  148. package/es/Map/LevelCenter/index.js +66 -0
  149. package/es/Map/LoaderMap/index.d.ts +7 -0
  150. package/es/Map/LoaderMap/index.js +62 -0
  151. package/es/Map/MapDrawSelect/demo.d.ts +3 -0
  152. package/es/Map/MapDrawSelect/demo.js +71 -0
  153. package/es/Map/MapDrawSelect/index.d.ts +15 -0
  154. package/es/Map/MapDrawSelect/index.js +56 -0
  155. package/es/Map/MouseTool/index.d.ts +10 -0
  156. package/es/Map/MouseTool/index.js +40 -0
  157. package/es/Map/MouseTool/useMouseTools.d.ts +7 -0
  158. package/es/Map/MouseTool/useMouseTools.js +83 -0
  159. package/es/Map/ResetTools/index.d.ts +10 -0
  160. package/es/Map/ResetTools/index.js +57 -0
  161. package/es/Map/ResetTools/index.less +39 -0
  162. package/es/Map/SinglePoint/demo.d.ts +3 -0
  163. package/es/Map/SinglePoint/demo.js +14 -0
  164. package/es/Map/SinglePoint/index.d.ts +27 -0
  165. package/es/Map/SinglePoint/index.js +52 -0
  166. package/es/Map/SinglePoint/index.less +41 -0
  167. package/es/Map/hook/useMapEvent.d.ts +2 -0
  168. package/es/Map/hook/useMapEvent.js +19 -0
  169. package/es/Map/hook/useMapType.d.ts +4 -0
  170. package/es/Map/hook/useMapType.js +12 -0
  171. package/es/Map/icon.d.ts +2 -0
  172. package/es/Map/icon.js +10 -0
  173. package/es/Map/index.d.ts +24 -0
  174. package/es/Map/index.js +25 -0
  175. package/es/Map/interface.d.ts +74 -0
  176. package/es/Map/points.d.ts +50 -0
  177. package/es/Map/points.js +1 -0
  178. package/es/Map/useMarker/index.d.ts +10 -0
  179. package/es/Map/useMarker/index.js +71 -0
  180. package/es/Map/withMap/index.d.ts +3 -0
  181. package/es/Map/withMap/index.js +10 -0
  182. package/es/Picture/component/DefaultRects/RectInfo.d.ts +8 -0
  183. package/es/Picture/component/DefaultRects/RectInfo.js +80 -0
  184. package/es/Picture/component/DefaultRects/index.d.ts +13 -0
  185. package/es/Picture/component/DefaultRects/index.js +52 -0
  186. package/es/Picture/component/DefaultRects/index.less +211 -0
  187. package/es/Picture/component/DefaultRects/utils.d.ts +2 -0
  188. package/es/Picture/component/DefaultRects/utils.js +11 -0
  189. package/es/Picture/component/DrawRect/index.d.ts +13 -0
  190. package/es/Picture/component/DrawRect/index.js +46 -0
  191. package/es/Picture/component/DrawRect/index.less +8 -0
  192. package/es/Picture/component/RectMenu/index.d.ts +12 -0
  193. package/es/Picture/component/RectMenu/index.js +76 -0
  194. package/es/Picture/component/RectMenu/index.less +36 -0
  195. package/es/Picture/component/RectMenu/utils.d.ts +12 -0
  196. package/es/Picture/component/RectMenu/utils.js +19 -0
  197. package/es/Picture/component/Tools/index.d.ts +12 -0
  198. package/es/Picture/component/Tools/index.js +73 -0
  199. package/es/Picture/component/Tools/index.less +49 -0
  200. package/es/Picture/component/WheelScale/index.d.ts +7 -0
  201. package/es/Picture/component/WheelScale/index.js +27 -0
  202. package/es/Picture/demo.d.ts +2 -0
  203. package/es/Picture/demo.js +105 -0
  204. package/es/Picture/index.d.ts +5 -0
  205. package/es/Picture/index.js +341 -0
  206. package/es/Picture/index.less +20 -0
  207. package/es/Picture/interface.d.ts +196 -0
  208. package/es/Picture/loadCaptureRectImage.d.ts +3 -0
  209. package/es/Picture/loadCaptureRectImage.js +99 -0
  210. package/es/Picture/useDraw.d.ts +1 -0
  211. package/es/Picture/useDraw.js +103 -0
  212. package/es/Picture/utils.d.ts +26 -0
  213. package/es/Picture/utils.js +143 -0
  214. package/es/Player/api/index.d.ts +68 -0
  215. package/es/Player/api/index.js +309 -0
  216. package/es/Player/context.d.ts +17 -0
  217. package/es/Player/context.js +24 -0
  218. package/es/Player/contraller_bar/bar.d.ts +8 -0
  219. package/es/Player/contraller_bar/bar.js +20 -0
  220. package/es/Player/contraller_bar/contraller_event.d.ts +6 -0
  221. package/es/Player/contraller_bar/contraller_event.js +50 -0
  222. package/es/Player/contraller_bar/index.d.ts +14 -0
  223. package/es/Player/contraller_bar/index.js +27 -0
  224. package/es/Player/contraller_bar/left_bar.d.ts +10 -0
  225. package/es/Player/contraller_bar/left_bar.js +83 -0
  226. package/es/Player/contraller_bar/right_bar.d.ts +8 -0
  227. package/es/Player/contraller_bar/right_bar.js +32 -0
  228. package/es/Player/contraller_bar/time.d.ts +3 -0
  229. package/es/Player/contraller_bar/time.js +19 -0
  230. package/es/Player/contraller_bar/useBarStatus.d.ts +2 -0
  231. package/es/Player/contraller_bar/useBarStatus.js +43 -0
  232. package/es/Player/contraller_bar/volume.d.ts +9 -0
  233. package/es/Player/contraller_bar/volume.js +62 -0
  234. package/es/Player/demo.d.ts +3 -0
  235. package/es/Player/demo.js +266 -0
  236. package/es/Player/empty.d.ts +2 -0
  237. package/es/Player/empty.js +4 -0
  238. package/es/Player/event/errorEvent.d.ts +14 -0
  239. package/es/Player/event/errorEvent.js +88 -0
  240. package/es/Player/event/eventName.d.ts +18 -0
  241. package/es/Player/event/eventName.js +29 -0
  242. package/es/Player/event/index.d.ts +24 -0
  243. package/es/Player/event/index.js +205 -0
  244. package/es/Player/fps_play.d.ts +11 -0
  245. package/es/Player/fps_play.js +83 -0
  246. package/es/Player/frontend_player.d.ts +8 -0
  247. package/es/Player/frontend_player.js +64 -0
  248. package/es/Player/frontend_timeline.d.ts +10 -0
  249. package/es/Player/frontend_timeline.js +132 -0
  250. package/es/Player/iconfont.d.ts +5 -0
  251. package/es/Player/iconfont.js +16 -0
  252. package/es/Player/index.d.ts +2 -0
  253. package/es/Player/index.js +2 -0
  254. package/es/Player/live_heart.d.ts +8 -0
  255. package/es/Player/live_heart.js +45 -0
  256. package/es/Player/message.d.ts +5 -0
  257. package/es/Player/message.js +137 -0
  258. package/es/Player/player.d.ts +233 -0
  259. package/es/Player/segment_player.d.ts +9 -0
  260. package/es/Player/segment_player.js +228 -0
  261. package/es/Player/segment_timeline.d.ts +12 -0
  262. package/es/Player/segment_timeline.js +173 -0
  263. package/es/Player/single_player.d.ts +5 -0
  264. package/es/Player/single_player.js +262 -0
  265. package/es/Player/style/bar.less +43 -0
  266. package/es/Player/style/iconfont.js +43 -0
  267. package/es/Player/style/index.less +34 -0
  268. package/es/Player/style/message.less +56 -0
  269. package/es/Player/style/slider.less +106 -0
  270. package/es/Player/style/timeline.less +117 -0
  271. package/es/Player/style/volume.less +24 -0
  272. package/es/Player/timeline.d.ts +5 -0
  273. package/es/Player/timeline.js +95 -0
  274. package/es/Player/util.d.ts +43 -0
  275. package/es/Player/util.js +189 -0
  276. package/es/PlayerExt/demo.d.ts +3 -0
  277. package/es/PlayerExt/demo.js +154 -0
  278. package/es/PlayerExt/index.d.ts +48 -0
  279. package/es/PlayerExt/index.js +188 -0
  280. package/es/PlayerExt/index.less +10 -0
  281. package/es/Progress/index.d.ts +7 -0
  282. package/es/Progress/index.js +53 -0
  283. package/es/Progress/index.less +21 -0
  284. package/es/ROI/demo.d.ts +3 -0
  285. package/es/ROI/demo.js +16 -0
  286. package/es/ROI/index.d.ts +33 -0
  287. package/es/ROI/index.js +54 -0
  288. package/es/ROI/index.less +33 -0
  289. package/es/RefDrawer/Footer.d.ts +9 -0
  290. package/es/RefDrawer/Footer.js +22 -0
  291. package/es/RefDrawer/demo.d.ts +3 -0
  292. package/es/RefDrawer/demo.js +18 -0
  293. package/es/RefDrawer/index.d.ts +26 -0
  294. package/es/RefDrawer/index.js +71 -0
  295. package/es/RefModal/demo.d.ts +3 -0
  296. package/es/RefModal/demo.js +18 -0
  297. package/es/RefModal/index.d.ts +17 -0
  298. package/es/RefModal/index.js +70 -0
  299. package/es/ScreenPlayer/Live.d.ts +5 -0
  300. package/es/ScreenPlayer/Live.js +212 -0
  301. package/es/ScreenPlayer/LiveTools.d.ts +29 -0
  302. package/es/ScreenPlayer/LiveTools.js +151 -0
  303. package/es/ScreenPlayer/PlayerWithExt.d.ts +34 -0
  304. package/es/ScreenPlayer/PlayerWithExt.js +231 -0
  305. package/es/ScreenPlayer/RatePick.d.ts +8 -0
  306. package/es/ScreenPlayer/RatePick.js +29 -0
  307. package/es/ScreenPlayer/Record.d.ts +10 -0
  308. package/es/ScreenPlayer/Record.js +442 -0
  309. package/es/ScreenPlayer/RecordTools.d.ts +38 -0
  310. package/es/ScreenPlayer/RecordTools.js +197 -0
  311. package/es/ScreenPlayer/ScreenSelect.d.ts +7 -0
  312. package/es/ScreenPlayer/ScreenSelect.js +46 -0
  313. package/es/ScreenPlayer/SegmentTimeLine.d.ts +17 -0
  314. package/es/ScreenPlayer/SegmentTimeLine.js +36 -0
  315. package/es/ScreenPlayer/TimeMode.d.ts +7 -0
  316. package/es/ScreenPlayer/TimeMode.js +26 -0
  317. package/es/ScreenPlayer/TimeSelect.d.ts +7 -0
  318. package/es/ScreenPlayer/TimeSelect.js +88 -0
  319. package/es/ScreenPlayer/demo.d.ts +2 -0
  320. package/es/ScreenPlayer/demo.js +21 -0
  321. package/es/ScreenPlayer/demo2.d.ts +2 -0
  322. package/es/ScreenPlayer/demo2.js +194 -0
  323. package/es/ScreenPlayer/index.d.ts +6 -0
  324. package/es/ScreenPlayer/index.js +9 -0
  325. package/es/ScreenPlayer/index.less +335 -0
  326. package/es/ScreenPlayer/interface.d.ts +216 -0
  327. package/es/ScreenPlayer/useTimeSlider.d.ts +25 -0
  328. package/es/ScreenPlayer/useTimeSlider.js +451 -0
  329. package/es/ScreenPlayer/useVideoFit.d.ts +5 -0
  330. package/es/ScreenPlayer/useVideoFit.js +35 -0
  331. package/es/ScreenPlayer/utils.d.ts +17 -0
  332. package/es/ScreenPlayer/utils.js +85 -0
  333. package/es/SegmentPlayer/index.d.ts +2 -0
  334. package/es/SegmentPlayer/index.js +2 -0
  335. package/es/Service/http.d.ts +6 -0
  336. package/es/Service/http.js +133 -0
  337. package/es/Service/index.d.ts +3 -0
  338. package/es/Service/index.js +11 -0
  339. package/es/Service/interface.d.ts +23 -0
  340. package/es/Service/middleware.d.ts +8 -0
  341. package/es/Service/middleware.js +22 -0
  342. package/es/SocketEmitter/eventEmitter.d.ts +27 -0
  343. package/es/SocketEmitter/eventEmitter.js +88 -0
  344. package/es/SocketEmitter/index.d.ts +24 -0
  345. package/es/SocketEmitter/index.js +125 -0
  346. package/es/SocketEmitter/interface.d.ts +4 -0
  347. package/es/TableLayout/index.d.ts +10 -0
  348. package/es/TableLayout/index.js +27 -0
  349. package/es/TableLayout/index.less +4 -0
  350. package/es/ThemeAntd/demo.d.ts +4 -0
  351. package/es/ThemeAntd/demo.js +81 -0
  352. package/es/ThemeAntd/demo.less +20 -0
  353. package/es/ThemeAntd/index.d.ts +7 -0
  354. package/es/ThemeAntd/index.js +21 -0
  355. package/es/ThemeAntd/index.less +4 -0
  356. package/es/Timeout/index.d.ts +26 -0
  357. package/es/Timeout/index.js +65 -0
  358. package/es/bigNumberTransformCN/index.d.ts +5 -0
  359. package/es/bigNumberTransformCN/index.js +58 -0
  360. package/es/cache/index.d.ts +34 -0
  361. package/es/cache/index.js +94 -0
  362. package/es/copy/index.d.ts +1 -0
  363. package/es/copy/index.js +9 -0
  364. package/es/core.d.ts +0 -0
  365. package/es/getThemeStyle/index.d.ts +2 -0
  366. package/es/getThemeStyle/index.js +5 -0
  367. package/es/index.d.ts +62 -0
  368. package/es/index.js +62 -0
  369. package/es/likeGo/index.d.ts +2 -0
  370. package/es/likeGo/index.js +31 -0
  371. package/es/likeGoSync/index.d.ts +2 -0
  372. package/es/likeGoSync/index.js +10 -0
  373. package/es/logger/index.d.ts +7 -0
  374. package/es/logger/index.js +30 -0
  375. package/es/nextTick/index.d.ts +1 -0
  376. package/es/nextTick/index.js +3 -0
  377. package/es/recorder/demo.d.ts +3 -0
  378. package/es/recorder/demo.js +181 -0
  379. package/es/recorder/index.d.ts +294 -0
  380. package/es/recorder/index.js +992 -0
  381. package/es/submidstr/index.d.ts +5 -0
  382. package/es/submidstr/index.js +14 -0
  383. package/es/treeHelper/index.d.ts +11 -0
  384. package/es/treeHelper/index.js +188 -0
  385. package/es/typings.d.ts +2 -0
  386. package/es/useDrawROI/index.d.ts +16 -0
  387. package/es/useDrawROI/index.js +318 -0
  388. package/es/useEventEmitterHandle/index.d.ts +2 -0
  389. package/es/useEventEmitterHandle/index.js +17 -0
  390. package/es/useFullscreen/demo.d.ts +2 -0
  391. package/es/useFullscreen/demo.js +43 -0
  392. package/es/useFullscreen/index.d.ts +12 -0
  393. package/es/useFullscreen/index.js +76 -0
  394. package/es/useHistory/index.d.ts +3 -0
  395. package/es/useHistory/index.js +9 -0
  396. package/es/useHistory/interface.d.ts +3 -0
  397. package/es/useInfiniteScroll/index.d.ts +16 -0
  398. package/es/useInfiniteScroll/index.js +102 -0
  399. package/es/useRafInterval/index.d.ts +5 -0
  400. package/es/useRafInterval/index.js +71 -0
  401. package/es/useSimpleState/index.d.ts +3 -0
  402. package/es/useSimpleState/index.js +35 -0
  403. package/es/useVirtualList/index.d.ts +13 -0
  404. package/es/useVirtualList/index.js +136 -0
  405. package/es/utils.d.ts +14 -0
  406. package/es/utils.js +46 -0
  407. package/es/uuid/index.d.ts +5 -0
  408. package/es/uuid/index.js +6 -0
  409. package/package.json +1 -1
  410. package/tsconfig.json +1 -1
@@ -0,0 +1,83 @@
1
+ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
2
+ function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
3
+ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
4
+ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
5
+ function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
6
+ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
7
+ import React, { useEffect, useMemo, useRef, useState } from 'react';
8
+ import useRafInterval from "../useRafInterval";
9
+ import { useRegisterPlayerEvent } from "./event";
10
+ import Events from "./event/eventName";
11
+ import { getDomStyleValue } from "./util";
12
+ var oneFps = 1 / 30;
13
+ function FPSPlay(_ref) {
14
+ var api = _ref.api,
15
+ event = _ref.event,
16
+ fpsDelay = _ref.fpsDelay,
17
+ fps = _ref.fps;
18
+ var _useState = useState(Date.now()),
19
+ _useState2 = _slicedToArray(_useState, 2),
20
+ forceKey = _useState2[0],
21
+ update = _useState2[1];
22
+ var ref = useRef(null);
23
+ var timerRef = useRef();
24
+ var fps_second = useMemo(function () {
25
+ return fps ? 1 / fps : oneFps;
26
+ }, [fps]);
27
+ useEffect(function () {
28
+ var fpsCapture = function fpsCapture() {
29
+ if (!ref.current || !(event !== null && event !== void 0 && event.video) || !api) {
30
+ return;
31
+ }
32
+ var video = event.video;
33
+ var fpsTime = api.getCurrentTime() + fps_second;
34
+ video.currentTime = fpsTime;
35
+ if (video.currentTime >= api.getDuration()) {
36
+ clearInterval(timerRef.current);
37
+ video.currentTime = 0;
38
+ event.emit(Events.PLAY_ENDED);
39
+ }
40
+ var canvas = ref.current;
41
+ var ctx = canvas.getContext('2d');
42
+ var _video$getBoundingCli = video.getBoundingClientRect(),
43
+ width = _video$getBoundingCli.width,
44
+ height = _video$getBoundingCli.height;
45
+ canvas.width = width;
46
+ canvas.height = height;
47
+ var fit = getDomStyleValue(video, 'object-fit');
48
+ if (fit === 'fill') {
49
+ //全画面绘制,存在拉伸
50
+ ctx === null || ctx === void 0 || ctx.drawImage(video, 0, 0, width, height);
51
+ } else {
52
+ // 自适应绘制
53
+ var videoWidth = video.videoWidth;
54
+ var videoHeight = video.videoHeight;
55
+ var scale = height / videoHeight;
56
+ var s_vw = scale * videoWidth;
57
+ var paddingSize = (width - s_vw) / 2;
58
+ ctx === null || ctx === void 0 || ctx.drawImage(video, paddingSize, 0, s_vw, height);
59
+ }
60
+ };
61
+ fpsCapture();
62
+ timerRef.current = setInterval(fpsCapture, fpsDelay);
63
+ return function () {
64
+ clearInterval(timerRef.current);
65
+ };
66
+ }, [api, event, fpsDelay, forceKey, fps_second]);
67
+ useRegisterPlayerEvent(Events.CANVAS_PAUSE, function () {
68
+ clearInterval(timerRef.current);
69
+ });
70
+ useRegisterPlayerEvent(Events.CANVAS_PLAY, function () {
71
+ update(Date.now());
72
+ });
73
+
74
+ // TODO: 未知情况,video会自动播放,轮训检测并暂停零时解决
75
+ useRafInterval(function () {
76
+ return !(api !== null && api !== void 0 && api.paused) ? api === null || api === void 0 ? void 0 : api.pause() : null;
77
+ }, 10);
78
+ return /*#__PURE__*/React.createElement("canvas", {
79
+ className: "fps-play-canvas",
80
+ ref: ref
81
+ });
82
+ }
83
+ export default FPSPlay;
@@ -0,0 +1,8 @@
1
+ import React from 'react';
2
+ import type { IFrontendPlayerProps } from './player';
3
+ /**
4
+ * @desc 主组件,负责片段整体逻辑控制
5
+ * @return JSX.Element
6
+ */
7
+ declare function FrontendPlayer({ url, begin, end, onSeek, forwordRef, customTimeLine, onCanPlayerInit, ...props }: IFrontendPlayerProps): React.JSX.Element;
8
+ export default FrontendPlayer;
@@ -0,0 +1,64 @@
1
+ var _excluded = ["url", "begin", "end", "onSeek", "forwordRef", "customTimeLine", "onCanPlayerInit"];
2
+ function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
3
+ function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
4
+ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
5
+ import { useMemoizedFn, useUpdate } from 'ahooks';
6
+ import React, { useMemo, useRef } from 'react';
7
+ import Events from "./event/eventName";
8
+ import FrontendTimeLine from "./frontend_timeline";
9
+ import SinglePlayer from "./single_player";
10
+
11
+ /**
12
+ * @desc 主组件,负责片段整体逻辑控制
13
+ * @return JSX.Element
14
+ */
15
+ function FrontendPlayer(_ref) {
16
+ var url = _ref.url,
17
+ begin = _ref.begin,
18
+ end = _ref.end,
19
+ onSeek = _ref.onSeek,
20
+ forwordRef = _ref.forwordRef,
21
+ customTimeLine = _ref.customTimeLine,
22
+ onCanPlayerInit = _ref.onCanPlayerInit,
23
+ props = _objectWithoutProperties(_ref, _excluded);
24
+ var update = useUpdate();
25
+ var ref = useRef(null);
26
+ var playRef = forwordRef ? forwordRef : ref;
27
+ var _ref2 = playRef.current || {},
28
+ api = _ref2.api,
29
+ event = _ref2.event;
30
+
31
+ // 转换毫秒
32
+ var duration = useMemo(function () {
33
+ return (end !== null && end !== void 0 ? end : 0 - (begin !== null && begin !== void 0 ? begin : 0)) / 1000;
34
+ }, [begin, end]); //单位s 秒
35
+
36
+ // 重置reload
37
+ var reload = useMemoizedFn(function () {
38
+ var _playRef$current, _playRef$current2;
39
+ (_playRef$current = playRef.current) === null || _playRef$current === void 0 || _playRef$current.event.emit(Events.RELOAD);
40
+ onSeek === null || onSeek === void 0 || onSeek(begin);
41
+ (_playRef$current2 = playRef.current) === null || _playRef$current2 === void 0 || _playRef$current2.api.reload();
42
+ });
43
+ var onInit = useMemoizedFn(function () {
44
+ update();
45
+ onCanPlayerInit === null || onCanPlayerInit === void 0 || onCanPlayerInit();
46
+ });
47
+ var hasReady = api && event;
48
+ var timeline = customTimeLine !== null && customTimeLine !== void 0 ? customTimeLine : /*#__PURE__*/React.createElement(FrontendTimeLine, {
49
+ end: end !== null && end !== void 0 ? end : 0,
50
+ onSeek: onSeek,
51
+ begin: begin !== null && begin !== void 0 ? begin : 0,
52
+ duration: duration
53
+ });
54
+ return /*#__PURE__*/React.createElement(SinglePlayer, _extends({
55
+ ref: playRef,
56
+ url: url,
57
+ reload: reload,
58
+ onCanPlayerInit: onInit,
59
+ isLive: false,
60
+ type: "flv",
61
+ customTimeLine: hasReady ? timeline : /*#__PURE__*/React.createElement(React.Fragment, null)
62
+ }, props));
63
+ }
64
+ export default FrontendPlayer;
@@ -0,0 +1,10 @@
1
+ import React from 'react';
2
+ import './style/timeline.less';
3
+ interface ITimeLineProps {
4
+ duration: number;
5
+ begin: number;
6
+ end: number;
7
+ onSeek?: (time: number) => void;
8
+ }
9
+ declare function FrontendTimeLine({ duration, begin, end, onSeek }: ITimeLineProps): React.JSX.Element;
10
+ export default FrontendTimeLine;
@@ -0,0 +1,132 @@
1
+ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
2
+ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
3
+ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
4
+ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
5
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
6
+ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
7
+ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
8
+ function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
9
+ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
10
+ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
11
+ function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
12
+ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
13
+ import { useUpdateEffect } from 'ahooks';
14
+ import moment from 'dayjs';
15
+ import React, { startTransition, useMemo, useState } from 'react';
16
+ import useBarStatus from "./contraller_bar/useBarStatus";
17
+ import "./style/timeline.less";
18
+ import { useTimes } from "./timeline";
19
+ import { FMT } from "./util";
20
+ function TipTitle(_ref) {
21
+ var end = _ref.end,
22
+ begin = _ref.begin,
23
+ left = _ref.left,
24
+ current = _ref.current,
25
+ markTime = _ref.markTime;
26
+ if (left === -1) {
27
+ return null;
28
+ }
29
+ return /*#__PURE__*/React.createElement("div", {
30
+ className: "frontend-line-tip-box",
31
+ style: {
32
+ left: left
33
+ }
34
+ }, /*#__PURE__*/React.createElement("div", {
35
+ style: {
36
+ fontWeight: 600
37
+ }
38
+ }, "\u5F55\u50CF\u4FE1\u606F"), /*#__PURE__*/React.createElement("div", null, "\u5F00\u59CB\uFF1A", moment(begin).format(FMT)), /*#__PURE__*/React.createElement("div", null, "\u7ED3\u675F\uFF1A", moment(end).format(FMT)), /*#__PURE__*/React.createElement("div", null, "\u523B\u5EA6\uFF1A", moment(markTime).format(FMT)), /*#__PURE__*/React.createElement("div", null, "\u5F53\u524D\uFF1A", moment(current).format(FMT)));
39
+ }
40
+ function FrontendTimeLine(_ref2) {
41
+ var duration = _ref2.duration,
42
+ begin = _ref2.begin,
43
+ end = _ref2.end,
44
+ onSeek = _ref2.onSeek;
45
+ // time 是记录seek时跳了多少
46
+ var _useState = useState({
47
+ time: 0,
48
+ markTime: 0,
49
+ left: -1,
50
+ visible: false
51
+ }),
52
+ _useState2 = _slicedToArray(_useState, 2),
53
+ state = _useState2[0],
54
+ setState = _useState2[1];
55
+ var status = useBarStatus();
56
+
57
+ //获取视频当前播放时长单位s
58
+ var _useTimes = useTimes(),
59
+ _useTimes2 = _slicedToArray(_useTimes, 1),
60
+ currentTime = _useTimes2[0];
61
+ var rTime = useMemo(function () {
62
+ return state.time + currentTime;
63
+ }, [state.time, currentTime]);
64
+ useUpdateEffect(function () {
65
+ return setState(function (old) {
66
+ return _objectSpread(_objectSpread({}, old), {}, {
67
+ time: 0
68
+ });
69
+ });
70
+ }, [begin]);
71
+ var playPercent = useMemo(function () {
72
+ return rTime / duration * 100;
73
+ }, [duration, rTime]);
74
+ var cTime = useMemo(function () {
75
+ return begin + rTime * 1000;
76
+ }, [begin, rTime]);
77
+ var seekWithLine = function seekWithLine(e) {
78
+ var rect = e.currentTarget.getBoundingClientRect();
79
+ var current = e.pageX - rect.left;
80
+ var cTime = current / rect.width * duration;
81
+ onSeek === null || onSeek === void 0 || onSeek(begin + cTime * 1000);
82
+ //时间轴进度条rTime是要加上currentTime,这里要减去一下,包装交互一致性
83
+ setState(function (old) {
84
+ return _objectSpread(_objectSpread({}, old), {}, {
85
+ time: cTime
86
+ });
87
+ });
88
+ };
89
+ var onLineMouseOver = function onLineMouseOver(e) {
90
+ var rect = e.currentTarget.getBoundingClientRect();
91
+ var left = e.pageX - rect.left;
92
+ var mTime = left / rect.width * duration;
93
+ setState(function (old) {
94
+ return _objectSpread(_objectSpread({}, old), {}, {
95
+ left: left,
96
+ markTime: begin + mTime * 1000
97
+ });
98
+ });
99
+ };
100
+ var onLineMouseOut = function onLineMouseOut() {
101
+ return startTransition(function () {
102
+ return setState(function (old) {
103
+ return _objectSpread(_objectSpread({}, old), {}, {
104
+ left: -1
105
+ });
106
+ });
107
+ });
108
+ };
109
+ return /*#__PURE__*/React.createElement("div", {
110
+ className: "player-timeline-layout frontend-player-timeline-layout ".concat(status === 0 ? 'hide-time-line' : ''),
111
+ onClick: seekWithLine,
112
+ onMouseMove: onLineMouseOver,
113
+ onMouseOut: onLineMouseOut
114
+ }, /*#__PURE__*/React.createElement("div", {
115
+ className: "current-line",
116
+ style: {
117
+ width: "".concat(playPercent, "%")
118
+ }
119
+ }), /*#__PURE__*/React.createElement(TipTitle, {
120
+ end: end,
121
+ begin: begin,
122
+ left: state.left,
123
+ current: cTime,
124
+ markTime: state.markTime
125
+ }), state.left !== -1 && /*#__PURE__*/React.createElement("span", {
126
+ className: "frontend-line-mark",
127
+ style: {
128
+ left: state.left
129
+ }
130
+ }));
131
+ }
132
+ export default FrontendTimeLine;
@@ -0,0 +1,5 @@
1
+ import React from 'react';
2
+ import { IIconFontProps } from '../IconFont';
3
+ import './style/iconfont.js';
4
+ declare function IconFont({ className, ...props }: IIconFontProps): React.JSX.Element;
5
+ export default IconFont;
@@ -0,0 +1,16 @@
1
+ var _excluded = ["className"];
2
+ function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
3
+ function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
4
+ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
5
+ import React from 'react';
6
+ import Icon from "../IconFont";
7
+ import "./style/iconfont.js";
8
+ function IconFont(_ref) {
9
+ var _ref$className = _ref.className,
10
+ className = _ref$className === void 0 ? '' : _ref$className,
11
+ props = _objectWithoutProperties(_ref, _excluded);
12
+ return /*#__PURE__*/React.createElement(Icon, _extends({
13
+ className: "lm-player-iconfont ".concat(className)
14
+ }, props));
15
+ }
16
+ export default IconFont;
@@ -0,0 +1,2 @@
1
+ import SinglePlayer from './single_player';
2
+ export default SinglePlayer;
@@ -0,0 +1,2 @@
1
+ import SinglePlayer from "./single_player";
2
+ export default SinglePlayer;
@@ -0,0 +1,8 @@
1
+ import type Api from './api';
2
+ import type VideoEventInstance from './event';
3
+ declare function useLiveHeart({ api, event, isLive }: {
4
+ api?: Api;
5
+ event?: VideoEventInstance;
6
+ isLive?: boolean;
7
+ }): void;
8
+ export default useLiveHeart;
@@ -0,0 +1,45 @@
1
+ /* eslint-disable react-hooks/rules-of-hooks */
2
+ import { useDocumentVisibility, useRafInterval, useUpdateEffect } from 'ahooks';
3
+ import { useRef } from 'react';
4
+ import Events from "./event/eventName";
5
+ function useLiveHeart(_ref) {
6
+ var api = _ref.api,
7
+ event = _ref.event,
8
+ isLive = _ref.isLive;
9
+ var documentVisibility = useDocumentVisibility();
10
+ var cTimeRef = useRef(0);
11
+ var run = function run() {
12
+ var _api$getCurrentTime;
13
+ if (!isLive || documentVisibility !== 'visible' || !api) {
14
+ return;
15
+ }
16
+ var current = (_api$getCurrentTime = api.getCurrentTime()) !== null && _api$getCurrentTime !== void 0 ? _api$getCurrentTime : 0;
17
+ var buffered = api.getSecondsLoaded();
18
+ if (buffered - current > 5) {
19
+ console.debug("\u5F53\u524D\u5EF6\u65F6\u8FC7\u5927current->".concat(current, " buffered->").concat(buffered, ", \u57FA\u4E8E\u89C6\u9891\u5F53\u524D\u7F13\u5B58\u65F6\u95F4\u66F4\u65B0\u5F53\u524D\u64AD\u653E\u65F6\u95F4 updateTime -> ").concat(buffered - 2));
20
+ api.seekTo(buffered - 2 > 0 ? buffered - 2 : 0);
21
+ api.play();
22
+ }
23
+ };
24
+ useUpdateEffect(function () {
25
+ return run();
26
+ }, [documentVisibility]);
27
+ useRafInterval(function () {
28
+ var _api$getCurrentTime2;
29
+ return cTimeRef.current = (_api$getCurrentTime2 = api === null || api === void 0 ? void 0 : api.getCurrentTime()) !== null && _api$getCurrentTime2 !== void 0 ? _api$getCurrentTime2 : 0;
30
+ }, 1 * 1000);
31
+ useRafInterval(function () {
32
+ return run();
33
+ }, 30 * 1000);
34
+ useRafInterval(function () {
35
+ var _api$video;
36
+ if (!api || !event) {
37
+ return;
38
+ }
39
+ var cuurentTime = api.getCurrentTime();
40
+ if (!!isLive && !((_api$video = api.video) !== null && _api$video !== void 0 && _api$video.paused) && cuurentTime === cTimeRef.current) {
41
+ event.emit(Events.ERROR, 'long time no play!');
42
+ }
43
+ }, 20 * 1000);
44
+ }
45
+ export default useLiveHeart;
@@ -0,0 +1,5 @@
1
+ import React from 'react';
2
+ import './style/message.less';
3
+ declare function VideoMessage(): React.JSX.Element;
4
+ export declare const NoSource: () => React.JSX.Element;
5
+ export default VideoMessage;
@@ -0,0 +1,137 @@
1
+ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
2
+ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
3
+ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
4
+ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
5
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
6
+ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
7
+ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
8
+ function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
9
+ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
10
+ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
11
+ function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
12
+ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
13
+ import React, { useContext, useMemo, useRef, useState } from 'react';
14
+ import { Context } from "./context";
15
+ import { useRegisterPlayerEvent, useVideoEvent } from "./event";
16
+ import EventName from "./event/eventName";
17
+ import IconFont from "./iconfont";
18
+ import "./style/message.less";
19
+ function VideoMessage() {
20
+ var _useContext = useContext(Context),
21
+ api = _useContext.api;
22
+ var _useState = useState({
23
+ status: null,
24
+ errorTimer: 1,
25
+ loading: false
26
+ }),
27
+ _useState2 = _slicedToArray(_useState, 2),
28
+ state = _useState2[0],
29
+ setState = _useState2[1];
30
+ var timeRef = useRef();
31
+ var message = useMemo(function () {
32
+ if (state.status === 'fail') {
33
+ console.warn("\u89C6\u9891\u9519\u8BEF\uFF0C\u8BF7\u624B\u52A8\u5237\u65B0\u91CD\u8BD5\uFF01");
34
+ return '请稍后重试!';
35
+ }
36
+ if (state.status === 'reload') {
37
+ console.warn("\u7B2C".concat(state.errorTimer, "\u6B21\u91CD\u8FDE"));
38
+ return "\u6B63\u5728\u5237\u65B0...";
39
+ }
40
+ return '';
41
+ }, [state.errorTimer, state.status]);
42
+ var openLoading = function openLoading() {
43
+ //@ts-ignore
44
+ clearTimeout(timeRef.current);
45
+ timeRef.current = setTimeout(function () {
46
+ return setState(function (old) {
47
+ return _objectSpread(_objectSpread({}, old), {}, {
48
+ loading: true
49
+ });
50
+ });
51
+ }, 200);
52
+ };
53
+ var closeLoading = function closeLoading() {
54
+ //@ts-ignore
55
+ clearTimeout(timeRef.current);
56
+ setState(function (old) {
57
+ return _objectSpread(_objectSpread({}, old), {}, {
58
+ loading: false
59
+ });
60
+ });
61
+ };
62
+ var errorReload = function errorReload(timer) {
63
+ //@ts-ignore
64
+ clearTimeout(timeRef.current);
65
+ setState(function () {
66
+ return {
67
+ status: 'reload',
68
+ errorTimer: timer,
69
+ loading: true
70
+ };
71
+ });
72
+ };
73
+ var reloadFail = function reloadFail() {
74
+ return setState(function (old) {
75
+ return _objectSpread(_objectSpread({}, old), {}, {
76
+ status: 'fail'
77
+ });
78
+ });
79
+ };
80
+ var reloadSuccess = function reloadSuccess() {
81
+ return setState(function (old) {
82
+ return _objectSpread(_objectSpread({}, old), {}, {
83
+ status: null
84
+ });
85
+ });
86
+ };
87
+ var reload = function reload() {
88
+ return setState(function (old) {
89
+ return _objectSpread(_objectSpread({}, old), {}, {
90
+ status: 'reload',
91
+ loading: true
92
+ });
93
+ });
94
+ };
95
+ var playEnd = function playEnd() {
96
+ //@ts-ignore
97
+ clearTimeout(timeRef.current);
98
+ setState(function (old) {
99
+ return _objectSpread(_objectSpread({}, old), {}, {
100
+ status: null,
101
+ loading: false
102
+ });
103
+ });
104
+ api === null || api === void 0 || api.pause();
105
+ };
106
+ useVideoEvent('loadstart', openLoading);
107
+ useVideoEvent('loadeddata', closeLoading);
108
+ useVideoEvent('canplay', closeLoading);
109
+ useRegisterPlayerEvent(EventName.ERROR_RELOAD, errorReload);
110
+ useRegisterPlayerEvent(EventName.RELOAD_FAIL, reloadFail);
111
+ useRegisterPlayerEvent(EventName.RELOAD_SUCCESS, reloadSuccess);
112
+ useRegisterPlayerEvent(EventName.RELOAD, reload);
113
+ useRegisterPlayerEvent(EventName.HISTORY_PLAY_END, playEnd);
114
+ useRegisterPlayerEvent(EventName.CLEAR_ERROR_TIMER, reloadSuccess);
115
+ var loading = state.loading,
116
+ status = state.status;
117
+ return /*#__PURE__*/React.createElement("div", {
118
+ className: "lm-player-message-mask ".concat(loading || status === 'fail' ? 'lm-player-mask-loading-animation' : '')
119
+ }, /*#__PURE__*/React.createElement(IconFont, {
120
+ type: status === 'fail' ? 'lm-player-YesorNo_No_Dark' : 'lm-player-Loading',
121
+ className: "".concat(loading && status !== 'fail' ? 'lm-player-loading-animation' : status === 'fail' ? 'lm-player-loadfail' : '', " lm-player-loading-icon")
122
+ }), /*#__PURE__*/React.createElement("span", {
123
+ className: "lm-player-message"
124
+ }, message));
125
+ }
126
+ export var NoSource = function NoSource() {
127
+ return /*#__PURE__*/React.createElement("div", {
128
+ className: "lm-player-message-mask lm-player-mask-loading-animation"
129
+ }, /*#__PURE__*/React.createElement(IconFont, {
130
+ style: {
131
+ fontSize: 80
132
+ },
133
+ type: "lm-player-PlaySource",
134
+ title: "\u8BF7\u9009\u62E9\u89C6\u9891\u6E90"
135
+ }));
136
+ };
137
+ export default VideoMessage;