@x-edu/live-player 0.0.10 → 0.0.12
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.
- package/README.md +41 -1
- package/dist/XEduLivePlayer.common.js +49384 -25752
- package/dist/XEduLivePlayerPre.common.js +49364 -25732
- package/package.json +1 -1
- package/src/App.jsx +3 -1
- package/src/component/AliPlayer/index.jsx +7 -4
- package/src/component/Avatar/index.jsx +1 -3
- package/src/component/Icon/index.jsx +16 -0
- package/src/component/Icon/index.module.less +3 -0
- package/src/component/Pagination/LocalPagination.jsx +27 -0
- package/src/component/Pagination/RemotePagination.jsx +32 -0
- package/src/component/Pagination/index.jsx +31 -0
- package/src/component/Pagination/index.module.less +110 -0
- package/src/config/request/live-activity.js +1 -1
- package/src/demo/Detail.jsx +11 -0
- package/src/demo/List.jsx +62 -0
- package/src/demo/index.jsx +17 -0
- package/src/detail/LiveVideo/index.jsx +1 -1
- package/src/index.js +2 -7
- package/src/list/Empty/img/empty.png +0 -0
- package/src/list/Empty/index.jsx +20 -0
- package/src/list/Empty/index.module.less +23 -0
- package/src/list/ListItem/Action/index.jsx +98 -0
- package/src/list/ListItem/Action/index.module.less +22 -0
- package/src/list/ListItem/img/live.png +0 -0
- package/src/list/ListItem/img/play.svg +16 -0
- package/src/list/ListItem/index.jsx +95 -0
- package/src/list/ListItem/index.module.less +123 -0
- package/src/list/index.jsx +150 -0
- package/src/list/index.module.less +36 -0
- package/src/service/live.js +57 -0
package/README.md
CHANGED
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
初版,API可能后续会大幅调整
|
|
4
4
|
|
|
5
5
|
## Demo
|
|
6
|
+
### PublicLiveDetail 直播详情页
|
|
6
7
|
|
|
7
8
|
```jsx
|
|
8
9
|
import { PublicLiveDetail, getLiveOnlineCount } from '@x-edu/live-player'
|
|
@@ -96,11 +97,50 @@ export default function LiveTest() {
|
|
|
96
97
|
}
|
|
97
98
|
```
|
|
98
99
|
|
|
100
|
+
### 直播列表页
|
|
101
|
+
```jsx
|
|
102
|
+
import { PublicLiveList } from '@x-edu/live-player'
|
|
103
|
+
import React, { useContext } from 'react'
|
|
104
|
+
import style from './style.module.less'
|
|
105
|
+
import { getLoginUrl, uc } from '@/util/auth/func'
|
|
106
|
+
import UserContext from '@/component/Login/UserContext'
|
|
107
|
+
|
|
108
|
+
export default function LiveTest() {
|
|
109
|
+
const loginInfo = useContext(UserContext)
|
|
110
|
+
|
|
111
|
+
// 部分直播需要登录后才可以播放,这是要求登录的回调
|
|
112
|
+
const handleLogin = (item) => {
|
|
113
|
+
// 处理必须登陆的情况
|
|
114
|
+
window.location.href = getLoginUrl()
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
const handleDetailClick = (item) => {
|
|
118
|
+
// 根据 item 决定怎么跳转详情页
|
|
119
|
+
// 默认跳转中小学直播详情 window.open(`https://basic.smartedu.cn/publicLive/${liveId}}`)
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
return (
|
|
123
|
+
<div>
|
|
124
|
+
<PublicLiveList
|
|
125
|
+
scopeType='e_teacher_studio' // 适用范围,如名师工作室:e_teacher_studio 机构工作室:e_inst_studio 专家工作室:e_expert_studio 精准匹配
|
|
126
|
+
scopeId='xxx' // 适用id,如专家工作室id 精准匹配,必须有scope_type才生效
|
|
127
|
+
containerClassName={style.container} // 容器样式
|
|
128
|
+
uc={uc} // 登陆状态下必填
|
|
129
|
+
loginInfo={loginInfo} // 登陆状态下必填,特别的里面的 userInfo
|
|
130
|
+
handleLogin={handleLogin} // 用于需要强制登陆的回调,会传传入当前直播作为参数
|
|
131
|
+
onDetailClick={handleDetailClick}
|
|
132
|
+
/>
|
|
133
|
+
</div>
|
|
134
|
+
)
|
|
135
|
+
}
|
|
136
|
+
```
|
|
137
|
+
|
|
99
138
|
## 预生产
|
|
100
139
|
|
|
101
140
|
```js
|
|
102
141
|
import {
|
|
103
142
|
PublicLiveDetail,
|
|
104
|
-
getLiveOnlineCount
|
|
143
|
+
getLiveOnlineCount,
|
|
144
|
+
PublicLiveList
|
|
105
145
|
} from '@x-edu/live-player/dist/XEduLivePlayerPre.common'
|
|
106
146
|
```
|