vhall-mini-sdk 0.1.0 → 0.1.2

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 (280) hide show
  1. package/lib/components/chat/chat-edit/chat-edit.js +7 -4
  2. package/lib/components/chat/chat-list/chat-list.js +1 -1
  3. package/lib/components/live-landscape/live-landscape.js +11 -7
  4. package/lib/components/live-landscape/live-landscape.wxml +2 -2
  5. package/lib/components/live-portrait/live-portrait.js +11 -7
  6. package/lib/components/live-portrait/live-portrait.wxml +3 -3
  7. package/lib/components/live-portrait/live-portrait.wxss +1 -1
  8. package/lib/components/lottery/lottery.wxml +2 -2
  9. package/lib/components/player/components/online-hot/index.js +2 -2
  10. package/lib/components/player/extensions/observers.js +5 -5
  11. package/lib/components/player/player.js +5 -0
  12. package/lib/components/player/player.wxml +3 -3
  13. package/lib/components/product/product-list/product-list.wxml +3 -11
  14. package/lib/components/signin/signin-dialog.js +1 -0
  15. package/lib/sdk/main/index.js +2 -1
  16. package/lib/sdk/player/index.js +1 -1
  17. package/lib/sdk/plugins/InviteCardServer.js +1 -1
  18. package/lib/sdk/plugins/MallRewardServer.js +1 -1
  19. package/lib/sdk/plugins/ProductServer.js +1 -1
  20. package/lib/shared/RequestUtil.js +1 -1
  21. package/lib/shared/logger.js +1 -1
  22. package/package.json +2 -4
  23. package/postinstall.js +21 -51
  24. package/dist/components/chat/chat-edit/chat-edit.js +0 -127
  25. package/dist/components/chat/chat-edit/chat-edit.json +0 -4
  26. package/dist/components/chat/chat-edit/chat-edit.wxml +0 -7
  27. package/dist/components/chat/chat-edit/chat-edit.wxss +0 -1
  28. package/dist/components/chat/chat-item/chat-item.js +0 -253
  29. package/dist/components/chat/chat-item/chat-item.json +0 -3
  30. package/dist/components/chat/chat-item/chat-item.wxml +0 -96
  31. package/dist/components/chat/chat-item/chat-item.wxss +0 -1
  32. package/dist/components/chat/chat-list/chat-list.js +0 -216
  33. package/dist/components/chat/chat-list/chat-list.json +0 -6
  34. package/dist/components/chat/chat-list/chat-list.wxml +0 -9
  35. package/dist/components/chat/chat-list/chat-list.wxss +0 -1
  36. package/dist/components/chat/chat.js +0 -98
  37. package/dist/components/chat/chat.json +0 -7
  38. package/dist/components/chat/chat.wxml +0 -7
  39. package/dist/components/chat/chat.wxss +0 -1
  40. package/dist/components/gift/gift-display/gift-display.js +0 -118
  41. package/dist/components/gift/gift-display/gift-display.json +0 -3
  42. package/dist/components/gift/gift-display/gift-display.wxml +0 -16
  43. package/dist/components/gift/gift-display/gift-display.wxss +0 -1
  44. package/dist/components/gift/gift-sender/gift-sender.js +0 -63
  45. package/dist/components/gift/gift-sender/gift-sender.json +0 -6
  46. package/dist/components/gift/gift-sender/gift-sender.wxml +0 -19
  47. package/dist/components/gift/gift-sender/gift-sender.wxss +0 -1
  48. package/dist/components/introduction/introduction.js +0 -43
  49. package/dist/components/introduction/introduction.json +0 -3
  50. package/dist/components/introduction/introduction.wxml +0 -8
  51. package/dist/components/introduction/introduction.wxss +0 -1
  52. package/dist/components/invite-rank/img/bronze.png +0 -0
  53. package/dist/components/invite-rank/img/gold.png +0 -0
  54. package/dist/components/invite-rank/img/silver.png +0 -0
  55. package/dist/components/invite-rank/index.js +0 -135
  56. package/dist/components/invite-rank/index.json +0 -8
  57. package/dist/components/invite-rank/index.wxml +0 -42
  58. package/dist/components/invite-rank/index.wxss +0 -1
  59. package/dist/components/invite-rank/invite-rank-item.js +0 -12
  60. package/dist/components/invite-rank/invite-rank-item.json +0 -4
  61. package/dist/components/invite-rank/invite-rank-item.wxml +0 -21
  62. package/dist/components/invite-rank/invite-rank-item.wxss +0 -1
  63. package/dist/components/invite-rank/my-invite-detail.js +0 -82
  64. package/dist/components/invite-rank/my-invite-detail.json +0 -7
  65. package/dist/components/invite-rank/my-invite-detail.wxml +0 -27
  66. package/dist/components/invite-rank/my-invite-detail.wxss +0 -1
  67. package/dist/components/invite-rank/util.wxs +0 -21
  68. package/dist/components/live-landscape/live-landscape.js +0 -216
  69. package/dist/components/live-landscape/live-landscape.json +0 -39
  70. package/dist/components/live-landscape/live-landscape.wxml +0 -73
  71. package/dist/components/live-landscape/live-landscape.wxss +0 -1
  72. package/dist/components/live-portrait/live-portrait.js +0 -274
  73. package/dist/components/live-portrait/live-portrait.json +0 -38
  74. package/dist/components/live-portrait/live-portrait.wxml +0 -106
  75. package/dist/components/live-portrait/live-portrait.wxss +0 -1
  76. package/dist/components/lottery/lottery-accept/index.js +0 -249
  77. package/dist/components/lottery/lottery-accept/index.json +0 -4
  78. package/dist/components/lottery/lottery-accept/index.wxml +0 -49
  79. package/dist/components/lottery/lottery-accept/index.wxss +0 -1
  80. package/dist/components/lottery/lottery-history/index.js +0 -36
  81. package/dist/components/lottery/lottery-history/index.json +0 -3
  82. package/dist/components/lottery/lottery-history/index.wxml +0 -28
  83. package/dist/components/lottery/lottery-history/index.wxss +0 -1
  84. package/dist/components/lottery/lottery-shake/lottery-shake.js +0 -328
  85. package/dist/components/lottery/lottery-shake/lottery-shake.json +0 -1
  86. package/dist/components/lottery/lottery-shake/lottery-shake.wxml +0 -52
  87. package/dist/components/lottery/lottery-shake/lottery-shake.wxss +0 -1
  88. package/dist/components/lottery/lottery-slot/lottery-slot.js +0 -230
  89. package/dist/components/lottery/lottery-slot/lottery-slot.json +0 -1
  90. package/dist/components/lottery/lottery-slot/lottery-slot.wxml +0 -62
  91. package/dist/components/lottery/lottery-slot/lottery-slot.wxss +0 -1
  92. package/dist/components/lottery/lottery-wheel/lottery-wheel.js +0 -153
  93. package/dist/components/lottery/lottery-wheel/lottery-wheel.json +0 -4
  94. package/dist/components/lottery/lottery-wheel/lottery-wheel.wxml +0 -91
  95. package/dist/components/lottery/lottery-wheel/lottery-wheel.wxss +0 -1
  96. package/dist/components/lottery/lottery-winners/index.js +0 -101
  97. package/dist/components/lottery/lottery-winners/index.json +0 -4
  98. package/dist/components/lottery/lottery-winners/index.wxml +0 -39
  99. package/dist/components/lottery/lottery-winners/index.wxss +0 -1
  100. package/dist/components/lottery/lottery.js +0 -388
  101. package/dist/components/lottery/lottery.json +0 -11
  102. package/dist/components/lottery/lottery.wxml +0 -78
  103. package/dist/components/lottery/lottery.wxss +0 -1
  104. package/dist/components/lottery/wheel.json +0 -49
  105. package/dist/components/mall-reward/common/reward-card.wxss +0 -0
  106. package/dist/components/mall-reward/duration-icon/index.js +0 -101
  107. package/dist/components/mall-reward/duration-icon/index.json +0 -3
  108. package/dist/components/mall-reward/duration-icon/index.wxml +0 -7
  109. package/dist/components/mall-reward/duration-icon/index.wxss +0 -1
  110. package/dist/components/mall-reward/f-count-down/index.js +0 -61
  111. package/dist/components/mall-reward/f-count-down/index.json +0 -3
  112. package/dist/components/mall-reward/f-count-down/index.wxml +0 -9
  113. package/dist/components/mall-reward/f-count-down/index.wxss +0 -1
  114. package/dist/components/mall-reward/f-empty/index.js +0 -11
  115. package/dist/components/mall-reward/f-empty/index.json +0 -3
  116. package/dist/components/mall-reward/f-empty/index.wxml +0 -8
  117. package/dist/components/mall-reward/f-empty/index.wxss +0 -1
  118. package/dist/components/mall-reward/f-history/index.js +0 -84
  119. package/dist/components/mall-reward/f-history/index.json +0 -4
  120. package/dist/components/mall-reward/f-history/index.wxml +0 -38
  121. package/dist/components/mall-reward/f-history/index.wxss +0 -1
  122. package/dist/components/mall-reward/f-open/index.js +0 -36
  123. package/dist/components/mall-reward/f-open/index.json +0 -3
  124. package/dist/components/mall-reward/f-open/index.wxml +0 -10
  125. package/dist/components/mall-reward/f-open/index.wxss +0 -1
  126. package/dist/components/mall-reward/f-receive/index.js +0 -36
  127. package/dist/components/mall-reward/f-receive/index.json +0 -3
  128. package/dist/components/mall-reward/f-receive/index.wxml +0 -9
  129. package/dist/components/mall-reward/f-receive/index.wxss +0 -1
  130. package/dist/components/mall-reward/index.js +0 -374
  131. package/dist/components/mall-reward/index.json +0 -8
  132. package/dist/components/mall-reward/index.wxml +0 -4
  133. package/dist/components/mall-reward/index.wxss +0 -0
  134. package/dist/components/mall-reward/main-popup/index.js +0 -46
  135. package/dist/components/mall-reward/main-popup/index.json +0 -12
  136. package/dist/components/mall-reward/main-popup/index.wxml +0 -16
  137. package/dist/components/mall-reward/main-popup/index.wxss +0 -1
  138. package/dist/components/player/assets/image/arrow-left.png +0 -0
  139. package/dist/components/player/assets/image/arrow-right.png +0 -0
  140. package/dist/components/player/assets/image/enterFullScreen.png +0 -0
  141. package/dist/components/player/assets/image/exitFullScreen.png +0 -0
  142. package/dist/components/player/assets/image/fullscreen_1.png +0 -0
  143. package/dist/components/player/assets/image/fullscreen_2.png +0 -0
  144. package/dist/components/player/assets/image/pause.png +0 -0
  145. package/dist/components/player/assets/image/pause_1.png +0 -0
  146. package/dist/components/player/assets/image/play.png +0 -0
  147. package/dist/components/player/assets/image/play_1.png +0 -0
  148. package/dist/components/player/assets/image/refresh.png +0 -0
  149. package/dist/components/player/assets/image/refresh_1.png +0 -0
  150. package/dist/components/player/assets/image/subtitle_close.png +0 -0
  151. package/dist/components/player/assets/image/subtitle_default.png +0 -0
  152. package/dist/components/player/assets/image/volume-off.png +0 -0
  153. package/dist/components/player/assets/image/volume-on.png +0 -0
  154. package/dist/components/player/common/config.js +0 -7
  155. package/dist/components/player/common/veComponent.js +0 -4
  156. package/dist/components/player/components/barrage/barrage-canvas.js +0 -488
  157. package/dist/components/player/components/barrage/barrage-dom.js +0 -471
  158. package/dist/components/player/components/barrage/index.js +0 -62
  159. package/dist/components/player/components/barrage/index.json +0 -4
  160. package/dist/components/player/components/barrage/index.wxml +0 -39
  161. package/dist/components/player/components/barrage/index.wxss +0 -1
  162. package/dist/components/player/components/barrage/utils.js +0 -71
  163. package/dist/components/player/components/controls/controls.js +0 -93
  164. package/dist/components/player/components/controls/controls.json +0 -6
  165. package/dist/components/player/components/controls/controls.wxml +0 -60
  166. package/dist/components/player/components/controls/controls.wxss +0 -1
  167. package/dist/components/player/components/danmaku/danmaku.js +0 -23
  168. package/dist/components/player/components/danmaku/danmaku.json +0 -4
  169. package/dist/components/player/components/danmaku/danmaku.wxml +0 -1
  170. package/dist/components/player/components/danmaku/danmaku.wxss +0 -0
  171. package/dist/components/player/components/error/error.js +0 -15
  172. package/dist/components/player/components/error/error.json +0 -3
  173. package/dist/components/player/components/error/error.wxml +0 -6
  174. package/dist/components/player/components/error/error.wxss +0 -1
  175. package/dist/components/player/components/loading/loading.js +0 -9
  176. package/dist/components/player/components/loading/loading.json +0 -3
  177. package/dist/components/player/components/loading/loading.wxml +0 -4
  178. package/dist/components/player/components/loading/loading.wxss +0 -1
  179. package/dist/components/player/components/main/extensions/data.js +0 -8
  180. package/dist/components/player/components/main/extensions/export.js +0 -83
  181. package/dist/components/player/components/main/extensions/methods.js +0 -110
  182. package/dist/components/player/components/main/extensions/observers.js +0 -41
  183. package/dist/components/player/components/main/extensions/props.js +0 -177
  184. package/dist/components/player/components/main/index.js +0 -44
  185. package/dist/components/player/components/main/index.json +0 -4
  186. package/dist/components/player/components/main/index.wxml +0 -7
  187. package/dist/components/player/components/main/index.wxss +0 -1
  188. package/dist/components/player/components/marquee/marquee.js +0 -304
  189. package/dist/components/player/components/marquee/marquee.json +0 -4
  190. package/dist/components/player/components/marquee/marquee.wxml +0 -14
  191. package/dist/components/player/components/marquee/marquee.wxss +0 -1
  192. package/dist/components/player/components/online-hot/assets/line-hot.png +0 -0
  193. package/dist/components/player/components/online-hot/assets/line-user.png +0 -0
  194. package/dist/components/player/components/online-hot/index.js +0 -66
  195. package/dist/components/player/components/online-hot/index.json +0 -3
  196. package/dist/components/player/components/online-hot/index.wxml +0 -15
  197. package/dist/components/player/components/online-hot/index.wxss +0 -1
  198. package/dist/components/player/components/poster/poster.js +0 -12
  199. package/dist/components/player/components/poster/poster.json +0 -3
  200. package/dist/components/player/components/poster/poster.wxml +0 -5
  201. package/dist/components/player/components/poster/poster.wxss +0 -1
  202. package/dist/components/player/components/watermark/watermark.js +0 -52
  203. package/dist/components/player/components/watermark/watermark.json +0 -4
  204. package/dist/components/player/components/watermark/watermark.wxml +0 -8
  205. package/dist/components/player/components/watermark/watermark.wxss +0 -1
  206. package/dist/components/player/extensions/data.js +0 -63
  207. package/dist/components/player/extensions/export.js +0 -325
  208. package/dist/components/player/extensions/methods.js +0 -406
  209. package/dist/components/player/extensions/observers.js +0 -114
  210. package/dist/components/player/extensions/props.js +0 -162
  211. package/dist/components/player/player.js +0 -83
  212. package/dist/components/player/player.json +0 -33
  213. package/dist/components/player/player.wxml +0 -48
  214. package/dist/components/player/player.wxss +0 -1
  215. package/dist/components/praise/praise.js +0 -150
  216. package/dist/components/praise/praise.json +0 -5
  217. package/dist/components/praise/praise.wxml +0 -17
  218. package/dist/components/praise/praise.wxss +0 -1
  219. package/dist/components/product/product-card/product-card.js +0 -109
  220. package/dist/components/product/product-card/product-card.json +0 -3
  221. package/dist/components/product/product-card/product-card.wxml +0 -47
  222. package/dist/components/product/product-card/product-card.wxss +0 -1
  223. package/dist/components/product/product-detail/product-detail.js +0 -127
  224. package/dist/components/product/product-detail/product-detail.json +0 -3
  225. package/dist/components/product/product-detail/product-detail.wxml +0 -57
  226. package/dist/components/product/product-detail/product-detail.wxss +0 -1
  227. package/dist/components/product/product-item/product-item.js +0 -56
  228. package/dist/components/product/product-item/product-item.json +0 -3
  229. package/dist/components/product/product-item/product-item.wxml +0 -35
  230. package/dist/components/product/product-item/product-item.wxss +0 -1
  231. package/dist/components/product/product-list/product-list.js +0 -67
  232. package/dist/components/product/product-list/product-list.json +0 -6
  233. package/dist/components/product/product-list/product-list.wxml +0 -16
  234. package/dist/components/product/product-list/product-list.wxss +0 -1
  235. package/dist/components/product/product-order/product-order.js +0 -394
  236. package/dist/components/product/product-order/product-order.json +0 -3
  237. package/dist/components/product/product-order/product-order.wxml +0 -75
  238. package/dist/components/product/product-order/product-order.wxss +0 -1
  239. package/dist/components/signin/signin-dialog.js +0 -305
  240. package/dist/components/signin/signin-dialog.json +0 -7
  241. package/dist/components/signin/signin-dialog.wxml +0 -19
  242. package/dist/components/signin/signin-dialog.wxss +0 -1
  243. package/dist/components/top-notify/index.js +0 -14
  244. package/dist/components/top-notify/index.json +0 -3
  245. package/dist/components/top-notify/index.wxml +0 -2
  246. package/dist/components/top-notify/index.wxss +0 -1
  247. package/dist/pubComponents/countdown/countdown.js +0 -97
  248. package/dist/pubComponents/countdown/countdown.json +0 -5
  249. package/dist/pubComponents/countdown/countdown.wxml +0 -19
  250. package/dist/pubComponents/countdown/countdown.wxss +0 -1
  251. package/dist/pubComponents/error-page/index.js +0 -146
  252. package/dist/pubComponents/error-page/index.json +0 -5
  253. package/dist/pubComponents/error-page/index.wxml +0 -37
  254. package/dist/pubComponents/error-page/index.wxss +0 -1
  255. package/dist/pubComponents/popup/popup.js +0 -161
  256. package/dist/pubComponents/popup/popup.json +0 -5
  257. package/dist/pubComponents/popup/popup.wxml +0 -17
  258. package/dist/pubComponents/popup/popup.wxss +0 -1
  259. package/dist/pubComponents/tabs/index.js +0 -95
  260. package/dist/pubComponents/tabs/index.json +0 -4
  261. package/dist/pubComponents/tabs/index.wxml +0 -22
  262. package/dist/pubComponents/tabs/index.wxss +0 -1
  263. package/dist/sdk/config/index.js +0 -1
  264. package/dist/sdk/main/index.js +0 -1
  265. package/dist/sdk/player/index.js +0 -1
  266. package/dist/sdk/plugins/ChatServer.js +0 -1
  267. package/dist/sdk/plugins/CustomMenuServer.js +0 -1
  268. package/dist/sdk/plugins/InteractServer.js +0 -1
  269. package/dist/sdk/plugins/InviteCardServer.js +0 -1
  270. package/dist/sdk/plugins/LotteryServer.js +0 -1
  271. package/dist/sdk/plugins/MallRewardServer.js +0 -1
  272. package/dist/sdk/plugins/ProductServer.js +0 -1
  273. package/dist/shared/RequestUtil.js +0 -1
  274. package/dist/shared/SerializableMap.js +0 -1
  275. package/dist/shared/base.server.js +0 -1
  276. package/dist/shared/cacheUtil.js +0 -1
  277. package/dist/shared/dateUtil.js +0 -1
  278. package/dist/shared/logger.js +0 -1
  279. package/dist/shared/mpUtils.js +0 -1
  280. package/dist/shared/utils.js +0 -1
@@ -1,44 +0,0 @@
1
- import { VeComponent } from '../../common/veComponent';
2
- import { createData } from './extensions/data';
3
- import { props } from './extensions/props';
4
- import { createObservers } from './extensions/observers';
5
- import { createExport } from './extensions/export';
6
- import { createMethods } from './extensions/methods';
7
- import createLogger from '../../../../shared/logger';
8
-
9
- const logger = createLogger('playerComp_main');
10
-
11
- VeComponent({
12
- behaviors: ['wx://component-export'],
13
- properties: props,
14
- data: createData(),
15
- observers: createObservers(),
16
- methods: createMethods(),
17
- lifetimes: {
18
- created() {
19
- logger.debug('lifetimes created')
20
- this.stallCount = 0;
21
- this.stallTime = 0;
22
- },
23
- attached() {
24
- logger.debug('lifetimes attached')
25
- this.livePlayerContext = wx.createLivePlayerContext(this.data.id, this);
26
- this.videoContext = wx.createVideoContext(this.data.id, this)
27
- this.playerContext = this.data.type == 'live' ? this.livePlayerContext : this.videoContext;
28
- },
29
- detached() {
30
- logger.debug('lifetimes detached')
31
- this.livePlayerContext ? this.livePlayerContext.stop() : null
32
- this.videoContext ? this.videoContext.stop() : null
33
- this.livePlayerContext = null
34
- this.videoContext = null
35
- this.playerContext = null
36
- this.setData({
37
- src: ''
38
- });
39
- },
40
- },
41
- export() {
42
- return createExport.apply(this);
43
- },
44
- });
@@ -1,4 +0,0 @@
1
- {
2
- "component": true,
3
- "usingComponents": {}
4
- }
@@ -1,7 +0,0 @@
1
- <live-player wx:if="{{type=='live'}}" id='{{id}}' class='vhall-player' src='{{src}}' mode='{{mode}}' autoplay='{{true||autoplay}}' muted='{{muted}}' orientation='{{orientation}}' object-fit='{{livePlayerObjectFit}}' min-cache='{{minCache}}' max-cache='{{maxCache}}' sound-mode='{{soundMode}}' auto-pause-if-navigate='{{autoPauseIfNavigate}}' auto-pause-if-open-native='{{autoPauseIfOpenNative}}' picture-in-picture-mode='{{pictureInPictureMode}}' picture-in-picture-init-position='{{pictureInPictureInitPosition}}' enable-auto-rotation='{{enableAutoRotation}}' referrer-policy='{{referrerPolicy}}' enable-casting='{{enableCasting}}' enable-recv-message bindstatechange='onStateChange' bindfullscreenchange='onFullScreenChange' bindnetstatus='onNetStatus' bindaudiovolumenotify='onAudioVolumeNotify' bindenterpictureinpicture='onEnterPictureInPicture' bindleavepictureinpicture='onLeavePictureInPicture'>
2
- <slot />
3
- </live-player>
4
- <video wx:elif="{{type=='vod'}}" id='{{id}}' class='vhall-player' src='{{src}}' duration='{{duration}}' controls='{{controls}}' danmu-list='{{danmuList}}' danmu-btn='{{danmuBtn}}' enable-danmu='{{enableDanmu}}' autoplay='{{true||autoplay}}' loop='{{loop}}' muted='{{muted}}' initial-time='{{initialSeekTime}}' page-gesture='{{pageGesture}}' direction='{{direction}}' show-progress='{{showProgress}}' show-fullscreen-btn='{{showFullscreenBtn}}' show-play-btn='{{showPlayBtn}}' show-center-play-btn='{{showCenterPlayBtn}}' enable-progress-gesture='{{enableProgressGesture}}' object-fit='{{videoObjectFit}}' poster='{{poster}}' show-mute-btn='{{showMuteBtn}}' title='{{title}}' play-btn-position='{{playBtnPosition}}' enable-play-gesture='{{enablePlayGesture}}' auto-pause-if-navigate='{{autoPauseIfNavigate}}' auto-pause-if-open-native='{{autoPauseIfOpenNative}}' vslide-gesture='{{vslideGesture}}' vslide-gesture-in-fullscreen='{{vslideGestureInFullscreen}}' show-bottom-progress='{{showBottomProgress}}' show-casting-button='{{showCastingButton}}' show-background-playback-button="{{true}}" picture-in-picture-mode='{{[]}}' picture-in-picture-init-position='{{pictureInPictureInitPosition}}' picture-in-picture-show-progress='{{pictureInPictureShowProgress}}' enable-auto-rotation='{{enableAutoRotation}}' show-screen-lock-button='{{showScreenLockButton}}' show-snapshot-button='{{showSnapshotButton}}' bindplay="onPlay" bindpause="onPause" bindended="onEnded" bindloadedmetadata="onLoadedMetadata" binderror="onError" bindtimeupdate="onTimeupdate" bindfullscreenchange="onFullScreenChange" bindwaiting="onWaiting" bindprogress="onProgress" bindcontrolstoggle="onControlsToggle" bindenterpictureinpicture="onEnterPictureInPicture" bindleavepictureinpicture="onLeavePictureInPicture" bindseekcomplete="onSeekComplete">
5
- <slot />
6
- </video>
7
-
@@ -1 +0,0 @@
1
- .vhall-player{display:block;height:100%;line-height:20px;width:100%}
@@ -1,304 +0,0 @@
1
- // components/vhall-player-marquee/vhall-player-marquee.js
2
- Component({
3
- properties: {
4
- option: {
5
- type: Object,
6
- value: {},
7
- observer: '_optionChanged'
8
- }
9
- },
10
-
11
- data: {
12
- marqueeItems: [],
13
- timer: null,
14
- activeItems: 0, // 当前活跃的跑马灯数量
15
- positionMap: {
16
- 1: 'random',
17
- 2: 'top',
18
- 3: 'middle',
19
- 4: 'bottom'
20
- },
21
- speedMap: {
22
- 3000: 3,
23
- 6000: 6,
24
- 10000: 12
25
- }
26
- },
27
-
28
- lifetimes: {
29
- attached() {
30
- console.debug('[Marquee] 组件已附加到页面');
31
- },
32
- detached() {
33
- console.debug('[Marquee] 组件已从页面分离');
34
- this._clearTimer();
35
- }
36
- },
37
-
38
- methods: {
39
- _optionChanged(newVal) {
40
- console.debug('[Marquee] 配置变更:', newVal);
41
- this._clearTimer();
42
-
43
- if (!newVal.enable) {
44
- console.debug('[Marquee] 跑马灯已禁用');
45
- this.setData({ marqueeItems: [] });
46
- return;
47
- }
48
-
49
- const validatedConfig = this._validateConfig(newVal);
50
- if (!validatedConfig.text) {
51
- console.debug('[Marquee] 跑马灯文本为空,不创建');
52
- return;
53
- }
54
-
55
- this._startMarquee(validatedConfig);
56
- },
57
-
58
- _validateConfig(config) {
59
- const defaultConfig = {
60
- displayType: 0,
61
- alpha: 100,
62
- color: '#ff8d41',
63
- size: 16,
64
- interval: 20,
65
- speed: 6000,
66
- position: 1
67
- };
68
-
69
- const result = Object.assign({}, defaultConfig, config);
70
-
71
- if (result.displayType !== 0 && result.displayType !== 1) {
72
- result.displayType = 0;
73
- }
74
-
75
- if (result.position < 1 || result.position > 4) {
76
- result.position = 1;
77
- }
78
-
79
- if (![3000, 6000, 10000].includes(result.speed)) {
80
- result.speed = 6000;
81
- }
82
-
83
- console.debug('[Marquee] 验证后的配置:', result);
84
- return result;
85
- },
86
-
87
- _startMarquee(config) {
88
- console.debug('[Marquee] 启动跑马灯,配置:', config);
89
-
90
- this._createMarqueeItem(config);
91
- this._setTimer(config);
92
- },
93
-
94
- _createMarqueeItem(config) {
95
- const query = this.createSelectorQuery();
96
- query.select('.marquee-container').boundingClientRect(rect => {
97
- if (!rect || rect.width === 0 || rect.height === 0) {
98
- console.warn('[Marquee] 容器不可见或尺寸为0');
99
- return;
100
- }
101
-
102
- const containerWidth = rect.width;
103
- const containerHeight = rect.height;
104
- const id = `marquee-${Date.now()}-${Math.floor(Math.random() * 1000)}`;
105
-
106
- // 增加活跃项目计数
107
- this.setData({
108
- activeItems: this.data.activeItems + 1
109
- });
110
-
111
- if (config.displayType === 0) {
112
- this.setData({
113
- marqueeItems: [...this.data.marqueeItems, {
114
- id,
115
- ...config,
116
- positionStyle: this._getInitialPositionStyle(config, containerWidth, containerHeight)
117
- }]
118
- }, () => {
119
- this._measureTextWidth(id, containerWidth, containerHeight, config);
120
- });
121
- } else {
122
- const positionStyle = this._getFlashPositionStyle(config, containerWidth, containerHeight);
123
-
124
- this.setData({
125
- marqueeItems: [...this.data.marqueeItems, {
126
- id,
127
- ...config,
128
- positionStyle
129
- }]
130
- }, () => {
131
- // 直接设置3秒后消失
132
- setTimeout(() => {
133
- this._removeMarqueeItem(id);
134
- }, 3000);
135
- });
136
- }
137
- }).exec();
138
- },
139
-
140
- _measureTextWidth(id, containerWidth, containerHeight, config) {
141
- const query = this.createSelectorQuery();
142
- query.select(`#${id}`).boundingClientRect(textRect => {
143
- if (!textRect || textRect.width === 0) {
144
- console.warn('[Marquee] 文本元素未找到或宽度为0');
145
- this._removeMarqueeItem(id);
146
- return;
147
- }
148
-
149
- const textWidth = textRect.width;
150
- const textHeight = textRect.height;
151
- const duration = this._calculateAnimationDuration(config.speed, textWidth, containerWidth);
152
-
153
- // 计算完全移出屏幕需要的距离(容器宽度 + 文本宽度)
154
- const translateDistance = containerWidth + textWidth;
155
-
156
- // 更新跑马灯样式
157
- this.setData({
158
- marqueeItems: this.data.marqueeItems.map(item => {
159
- if (item.id === id) {
160
- return {
161
- ...item,
162
- positionStyle: `${this._getFinalPositionStyle(config, containerWidth, containerHeight, textWidth, textHeight)}; transform: translateX(-${translateDistance}px); transition: transform ${duration}s linear; opacity: ${config.alpha / 100};`
163
- };
164
- }
165
- return item;
166
- })
167
- });
168
-
169
- // 动画结束后移除元素
170
- setTimeout(() => {
171
- this._removeMarqueeItem(id);
172
- }, duration * 1000);
173
- }).exec();
174
- },
175
-
176
- /**
177
- * 移除跑马灯项目
178
- * @param {String} id 项目ID
179
- */
180
- _removeMarqueeItem(id) {
181
- this.setData({
182
- marqueeItems: this.data.marqueeItems.filter(item => item.id !== id),
183
- activeItems: this.data.activeItems - 1
184
- });
185
- },
186
-
187
- _calculateAnimationDuration(speed, textWidth, containerWidth) {
188
- // 基础持续时间乘以文本长度比例(确保长文本移动时间合理)
189
- return this.data.speedMap[speed] * (1 + (textWidth / containerWidth));
190
- },
191
-
192
- _getInitialPositionStyle(config, containerWidth, containerHeight) {
193
- const textHeight = config.size * 1.2;
194
- let styles = [];
195
-
196
- switch (config.position) {
197
- case 1: // 随机位置
198
- const maxTop = containerHeight * 0.8 - textHeight;
199
- const randomTop = Math.max(0, Math.random() * maxTop);
200
- styles.push(`top: ${randomTop}px`);
201
- break;
202
-
203
- case 2: // 顶部
204
- styles.push(`top: ${containerHeight * 0.2}px`);
205
- break;
206
-
207
- case 3: // 中部
208
- styles.push(`top: 50%`, `margin-top: -${textHeight/2}px`);
209
- break;
210
-
211
- case 4: // 底部
212
- styles.push(`bottom: ${containerHeight * 0.2}px`);
213
- break;
214
- }
215
-
216
- styles.push(`left: ${containerWidth}px`, `opacity: 0`);
217
-
218
- return styles.join('; ');
219
- },
220
-
221
- _getFinalPositionStyle(config, containerWidth, containerHeight, textWidth, textHeight) {
222
- let styles = [];
223
-
224
- switch (config.position) {
225
- case 1:
226
- case 2:
227
- case 4:
228
- const initialStyle = this._getInitialPositionStyle(config, containerWidth, containerHeight);
229
- return initialStyle.replace('opacity: 0', '').trim();
230
-
231
- case 3:
232
- styles.push(`top: 50%`, `margin-top: -${textHeight/2}px`);
233
- break;
234
- }
235
-
236
- styles.push(`left: ${containerWidth}px`);
237
-
238
- return styles.join('; ');
239
- },
240
-
241
- _getFlashPositionStyle(config, containerWidth, containerHeight) {
242
- const textHeight = config.size * 1.2;
243
- let styles = [];
244
-
245
- // 计算可用区域(保留20%边距)
246
- const availableWidth = containerWidth * 0.8;
247
- const availableHeight = containerHeight * 0.8 - textHeight;
248
-
249
- switch (config.position) {
250
- case 1: // 随机位置
251
- styles.push(
252
- `top: ${Math.max(0, Math.random() * availableHeight)}px`,
253
- `left: ${Math.max(0, Math.random() * availableWidth)}px`
254
- );
255
- break;
256
-
257
- case 2: // 顶部随机
258
- styles.push(
259
- `top: ${containerHeight * 0.2}px`,
260
- `left: ${containerWidth * 0.2 + Math.random() * (containerWidth * 0.6)}px`
261
- );
262
- break;
263
-
264
- case 3: // 中部随机
265
- styles.push(
266
- `top: 50%`,
267
- `margin-top: -${textHeight/2}px`,
268
- `left: ${containerWidth * 0.2 + Math.random() * (containerWidth * 0.6)}px`
269
- );
270
- break;
271
-
272
- case 4: // 底部随机
273
- styles.push(
274
- `bottom: ${containerHeight * 0.2}px`,
275
- `left: ${containerWidth * 0.2 + Math.random() * (containerWidth * 0.6)}px`
276
- );
277
- break;
278
- }
279
-
280
- // 仅保留基础样式(不再添加动画)
281
- return styles.join('; ');
282
- },
283
-
284
- _setTimer(config) {
285
- this._clearTimer();
286
-
287
- this.data.timer = setInterval(() => {
288
- // 检查当前活跃的跑马灯数量,避免创建过多
289
- if (this.data.activeItems < 5) { // 最多允许5个同时存在
290
- // console.debug('[Marquee] 定时器触发,创建新跑马灯');
291
- this._createMarqueeItem(config);
292
- }
293
- }, config.interval * 1000);
294
- },
295
-
296
- _clearTimer() {
297
- if (this.data.timer) {
298
- clearInterval(this.data.timer);
299
- this.data.timer = null;
300
- console.debug('[Marquee] 定时器已清除');
301
- }
302
- }
303
- }
304
- });
@@ -1,4 +0,0 @@
1
- {
2
- "component": true,
3
- "usingComponents": {}
4
- }
@@ -1,14 +0,0 @@
1
- <!--components/vhall-player-marquee/vhall-player-marquee.wxml-->
2
- <!-- 跑马灯容器,绝对定位覆盖在播放器上方 -->
3
- <view class="marquee-container">
4
- <!-- 每个跑马灯项目 -->
5
- <view
6
- wx:for="{{marqueeItems}}"
7
- wx:key="id"
8
- id="{{item.id}}"
9
- class="marquee-item {{item.displayType === 0 ? 'scroll' : 'flash'}}"
10
- style="opacity: {{item.alpha / 100}}; color: {{item.color}}; font-size: {{item.size}}px; {{item.positionStyle}}"
11
- >
12
- {{item.text}}
13
- </view>
14
- </view>
@@ -1 +0,0 @@
1
- .marquee-container{height:100%;left:0;overflow:hidden;top:0;width:100%;z-index:2}.marquee-container,.marquee-item{pointer-events:none!important;position:absolute}.marquee-item{line-height:1.2;-webkit-user-select:none;user-select:none;white-space:nowrap;will-change:transform}.marquee-item.scroll{transition:transform linear}
@@ -1,66 +0,0 @@
1
- import { VeComponent } from '../../common/veComponent';
2
- VeComponent({
3
- properties: {
4
- fullscreen: {
5
- type: Boolean,
6
- value: false,
7
- },
8
- // 是否显示人数
9
- showPerson: {
10
- type: Boolean,
11
- value: false,
12
- },
13
- // 人数
14
- personValue: {
15
- type: [Number, String],
16
- value: 1,
17
- },
18
- // 是否显示热度
19
- showHot: {
20
- type: Boolean,
21
- value: false,
22
- },
23
- // 热度
24
- hotValue: {
25
- type: [Number, String],
26
- value: 0,
27
- },
28
- },
29
- data: {
30
- fmtPersonValue: 1,
31
- fmtHotValue: 1
32
- },
33
- observers: {
34
- 'personValue': function (newVal, oldVal) {
35
- if (newVal >= 0) {
36
- this.setData({
37
- fmtPersonValue: this._formatHotNum(newVal)
38
- })
39
- }
40
- },
41
- 'hotValue': function (newVal, oldVal) {
42
- if (newVal >= 0) {
43
- this.setData({
44
- fmtHotValue: this._formatHotNum(newVal)
45
- })
46
- }
47
- },
48
- },
49
-
50
- methods: {
51
- // 格式化热度显示数据。wxs不支持Math所以直接用方法
52
- _formatHotNum(value) {
53
- value = parseInt(value);
54
- let unit = '';
55
- const k = 99999;
56
- const sizes = ['', '万', '亿', '万亿'];
57
- let i;
58
- if (value > k) {
59
- i = Math.floor(Math.log(value) / Math.log(k));
60
- value = (value / Math.pow(k / 10, i)).toFixed(1);
61
- unit = sizes[i];
62
- }
63
- return `${value}${unit}`;
64
- }
65
- }
66
- });
@@ -1,3 +0,0 @@
1
- {
2
- "component": true
3
- }
@@ -1,15 +0,0 @@
1
- <view class="online-hot {{fullscreen?'is-fullscreen':''}}" wx:if="{{showPerson||showHot}}">
2
- <!-- 在线人数 -->
3
- <view class="online-hot__item" wx:if="{{showPerson}}">
4
- <image class="image-person" src="./assets/line-user.png" />
5
- <text class="text-count">{{ fmtPersonValue }}</text>
6
- </view>
7
- <!-- 分隔元素 -->
8
- <view class="splitter" wx:if="{{showPerson && showHot}}"></view>
9
- <!-- 热度 -->
10
- <view class="online-hot__item" wx:if="{{showHot}}">
11
- <image class="image-hot" src="./assets/line-hot.png" />
12
- <text class="text-count">{{ fmtHotValue }}</text>
13
- </view>
14
- </view>
15
-
@@ -1 +0,0 @@
1
- .online-hot{background:rgba(0,0,0,.5);border-radius:20px;flex-direction:row;height:24px;margin-left:10px;margin-top:12px;padding:0 12px}.online-hot,.online-hot__item{align-items:center;display:inline-flex}.online-hot__item{color:#fff}.online-hot__item .image-hot,.online-hot__item .image-person{display:inline-block;height:13px;object-fit:contain;width:13px}.online-hot__item .text-count{font-size:13px;line-height:1;margin-left:3px}.online-hot .splitter{width:12px}.online-hot.is-fullscreen{margin-left:90px;margin-top:18px}
@@ -1,12 +0,0 @@
1
- import { VeComponent } from '../../common/veComponent';
2
- VeComponent({
3
- properties: {
4
- url: {
5
- type: String,
6
- value: undefined,
7
- },
8
- },
9
- data: {
10
-
11
- },
12
- });
@@ -1,3 +0,0 @@
1
- {
2
- "component": true
3
- }
@@ -1,5 +0,0 @@
1
- <image
2
- class='vhall-player-poster'
3
- mode='scaleToFill'
4
- src='{{url}}'
5
- />
@@ -1 +0,0 @@
1
- .vhall-player-poster{height:100%;left:0;position:absolute;top:0;width:100%}
@@ -1,52 +0,0 @@
1
- Component({
2
- properties: {
3
- option: {
4
- type: Object,
5
- value: {
6
- url: '',
7
- align: 'tr',
8
- position: ['10px', '10px'],
9
- size: ['100px', '50px'],
10
- alpha: 100,
11
- },
12
- observer: function(newVal) {
13
- this._generateStyles(newVal);
14
- }
15
- }
16
- },
17
-
18
- data: {
19
- url: "",
20
- containerStyle: ""
21
- },
22
-
23
- methods: {
24
- _generateStyles(option) {
25
- const { url, align, position, size, alpha } = option;
26
- const [x, y] = position.map(v => v || '10px');
27
- const [width, height] = size.map(v => v || '0');
28
- const opacity = Math.min(1, Math.max(0, alpha / 100));
29
- const positionStyle = this._getPositionStyle(align, x, y);
30
-
31
- this.setData({
32
- url,
33
- containerStyle: `opacity: ${opacity}; width: ${width}; height: ${height}; ${positionStyle}`
34
- });
35
- },
36
-
37
- _getPositionStyle(align, x, y) {
38
- const styles = [];
39
- const directions = (align || 'tr').toLowerCase();
40
- if (directions.includes('t')) styles.push(`top: ${y}`, 'justify-content: flex-start');
41
- if (directions.includes('b')) styles.push(`bottom: ${y}`, 'justify-content: flex-end');
42
- if (directions.includes('l')) styles.push(`left: ${x}`, 'align-items: flex-start');
43
- if (directions.includes('r')) styles.push(`right: ${x}`, 'align-items: flex-end');
44
-
45
- return styles.join(';');
46
- },
47
-
48
- _imgOnError(err) {
49
- console.error('Watermark load failed:', err);
50
- }
51
- }
52
- });
@@ -1,4 +0,0 @@
1
- {
2
- "component": true,
3
- "usingComponents": {}
4
- }
@@ -1,8 +0,0 @@
1
- <view class="vhall-player-watermark-container" style="{{containerStyle}}">
2
- <image
3
- class="vhall-player-watermark"
4
- src="{{url}}"
5
- mode="aspectFit"
6
- binderror="_imgOnError"
7
- />
8
- </view>
@@ -1 +0,0 @@
1
- .vhall-player-watermark-container{display:flex;flex-direction:column;pointer-events:none;position:absolute;-webkit-user-select:none;user-select:none;z-index:2}.vhall-player-watermark{height:100%;object-fit:contain;width:100%}
@@ -1,63 +0,0 @@
1
- import { generateShortId } from '../../../shared/utils';
2
- import { prefix } from '../common/config';
3
- const name = `${prefix}-live-player`;
4
-
5
- export function createData() {
6
- return {
7
- liveInfo: {},
8
- id: `player-core-${generateShortId()}`,
9
- componetVersion: '1.0.0',
10
- prefix,
11
- showAudioCover: false,
12
- showPoster: false,
13
- posterUrl: '',
14
- showLoading: false,
15
- showError: false,
16
- showWatermark: false,
17
- showMarquee: false,
18
- showDanmaku: false,
19
- showBarrage: false,
20
-
21
- // 是否显示在线人数
22
- showPerson: false,
23
- personValue: 0, // 在线人数值
24
- // 是否显示热度
25
- showHot: false,
26
- hotValue: 0, // 热度值
27
-
28
- innerStyle: '',
29
- _style: '',
30
- controlsHiddenFlag: false,
31
-
32
- videoSrc: '',
33
- qualitys: [],
34
- currentQuality: '',
35
- qualityArray: [],
36
- qualityIndex: 0,
37
- subtitles: [],
38
- currentSubtitle: '',
39
-
40
- playStatus: 'paused',
41
- pausedFlag: false,
42
- fullscreenFlag: false,
43
- mutedFlag: false,
44
- currentPlaybackRate: 1,
45
- currentVodPlayTime: 0,
46
- vodDuration: 0,
47
-
48
- webinarInfo: {},
49
- webinarType: undefined,
50
- webinarTypeStr: undefined,
51
- webinarSubject: undefined,
52
- webinarStatusMap: {
53
- 1: '直播中',
54
- 2: '预约',
55
- 3: '结束',
56
- 4: '点播',
57
- 5: '回放',
58
- },
59
- recordWatchExpireObj: {},
60
-
61
-
62
- };
63
- }