@x-edu/live-player 0.0.3 → 0.0.4

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 (2) hide show
  1. package/README.md +12 -1
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -5,7 +5,7 @@
5
5
  ## Demo
6
6
 
7
7
  ```jsx
8
- import PublicLiveDetail from '@x-edu/live-player'
8
+ import { PublicLiveDetail, getLiveOnlineCount } from '@x-edu/live-player'
9
9
  import React, { useContext } from 'react'
10
10
  import style from './style.module.less'
11
11
  import { getLoginUrl, uc } from '@/util/auth/func'
@@ -14,6 +14,17 @@ import { sensorsTrack } from '@/util/sensorsTracking'
14
14
 
15
15
  export default function LiveTest() {
16
16
  const loginInfo = useContext(UserContext)
17
+
18
+ // 获取直播人数请在直播开始之后调用并显示
19
+ // 直播结束之后也不应显示
20
+ useEffect(() => {
21
+ const test = async () => {
22
+ const count = await getLiveOnlineCount('13aafbce-8ca2-4587-bc6e-eab183c9d5b6')
23
+ console.log(count)
24
+ }
25
+ test()
26
+ }, [])
27
+
17
28
  // 部分直播需要登录后才可以播放,这是要求登录的回调
18
29
  const handleLogin = () => {
19
30
  window.location.href = getLoginUrl()
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@x-edu/live-player",
3
- "version": "0.0.3",
3
+ "version": "0.0.4",
4
4
  "main": "dist/XEduLivePlayer.common.js",
5
5
  "scripts": {
6
6
  "start": "cross-env SDP_ENV=local gms dev",