zby-live-sdk 1.0.49-beta-talrtc0922 → 1.0.49-beta-talrtc1014
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/.babelrc +5 -5
- package/.editorconfig +13 -13
- package/.eslintrc.js +29 -29
- package/CHANGELOG.md +381 -370
- package/README.md +276 -276
- package/dist/zby-live-sdk.cjs.js +4 -3
- package/dist/zby-live-sdk.esm.js +4 -3
- package/dist/zby-live-sdk.umd.js +4 -3
- package/package.json +1 -1
- package/src/channel/getSendMsgParams.js +66 -66
- package/src/channel/index.js +138 -138
- package/src/channel/pomelo/index.js +184 -184
- package/src/channel/pomelo/latestQueue.js +151 -151
- package/src/channel/pomelo/polemo.js +749 -749
- package/src/channel/pomelo/util.js +54 -54
- package/src/channel/sdk-cb.js +73 -73
- package/src/channel/stream-msg.js +97 -97
- package/src/channel/zby/index.js +74 -74
- package/src/channel/zby/interactWithChannel.js +4 -4
- package/src/channel/zby/interactWithChannelControl.js +1568 -1568
- package/src/channel/zby/interactWithChannelEntry.js +318 -318
- package/src/config/config.js +153 -153
- package/src/default/base.js +70 -70
- package/src/default/extend.js +36 -36
- package/src/default/index.js +9 -9
- package/src/live/base.js +42 -42
- package/src/live/call-method.js +9 -9
- package/src/live/extend.js +53 -53
- package/src/live/index.js +9 -9
- package/src/network/api.js +50 -50
- package/src/network/commonFetch.js +66 -66
- package/src/network/dataReport.js +429 -429
- package/src/notice.js +394 -394
- package/src/tool/base.js +74 -74
- package/src/tool/call-method.js +9 -9
- package/src/tool/extend.js +42 -42
- package/src/tool/index.js +9 -9
- package/src/util/bridge.js +87 -87
- package/src/util/bridge1.js +46 -46
- package/src/util/dict.js +51 -51
- package/src/util/sessionStorage.js +29 -29
- package/src/util/sha256.js +482 -482
- package/src/util/util.js +308 -308
- package/src/zby-av-sdk/agora-sdk.js +711 -711
- package/src/zby-av-sdk/device.js +145 -145
- package/src/zby-av-sdk/rtc-sdk.js +2839 -2839
- package/src/zby-av-sdk/talrtc-sdk.js +2392 -2348
- package/src/zby-av-sdk/trtc-sdk.js +1801 -1801
- package/src/zby-av-sdk/zby-av-sdk.js +1891 -1891
- package/src/zby-av-sdk/zego-sdk.js +2987 -2987
- package/src/zby-live-sdk.js +1561 -1557
package/src/live/extend.js
CHANGED
|
@@ -1,53 +1,53 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* @Author: your name
|
|
3
|
-
* @Date: 2020-08-03 20:14:52
|
|
4
|
-
* @LastEditTime: 2020-08-17 18:46:53
|
|
5
|
-
* @LastEditors: why
|
|
6
|
-
* @Description: In User Settings Edit
|
|
7
|
-
* @FilePath: \xinxiaoban_zego\zby_live_sdk\src\live\extend.js
|
|
8
|
-
*/
|
|
9
|
-
import BASSAPI from './base';
|
|
10
|
-
|
|
11
|
-
export default {
|
|
12
|
-
/**
|
|
13
|
-
* @function 获取sdk版本号
|
|
14
|
-
* @return: Promise
|
|
15
|
-
*/
|
|
16
|
-
getLiveSdkVersion() {
|
|
17
|
-
return BASSAPI.getLiveSdkVersion();
|
|
18
|
-
},
|
|
19
|
-
/**
|
|
20
|
-
* @function 是否推流静音
|
|
21
|
-
* @return: Promise
|
|
22
|
-
*/
|
|
23
|
-
isStreamAudioMuted() {
|
|
24
|
-
return BASSAPI.isStreamAudioMuted();
|
|
25
|
-
},
|
|
26
|
-
/**
|
|
27
|
-
* @function 是否推画面流
|
|
28
|
-
* @return: Promise
|
|
29
|
-
*/
|
|
30
|
-
isStreamVideoMuted() {
|
|
31
|
-
return BASSAPI.isStreamVideoMuted();
|
|
32
|
-
},
|
|
33
|
-
async getStreamType(){
|
|
34
|
-
try {
|
|
35
|
-
const pushAudio = (await this.isStreamAudioMuted()).msg.ret;
|
|
36
|
-
const pushVideo = (await this.isStreamVideoMuted()).msg.ret;
|
|
37
|
-
let stream_type = 'both';
|
|
38
|
-
if (pushAudio && !pushVideo) {
|
|
39
|
-
stream_type = 'video';
|
|
40
|
-
}
|
|
41
|
-
if (!pushAudio && pushVideo) {
|
|
42
|
-
stream_type = 'audio';
|
|
43
|
-
}
|
|
44
|
-
if (pushAudio && pushVideo) {
|
|
45
|
-
stream_type = 'none';
|
|
46
|
-
}
|
|
47
|
-
return stream_type;
|
|
48
|
-
} catch (e){
|
|
49
|
-
let stream_type = 'none';
|
|
50
|
-
return stream_type;
|
|
51
|
-
}
|
|
52
|
-
},
|
|
53
|
-
};
|
|
1
|
+
/*
|
|
2
|
+
* @Author: your name
|
|
3
|
+
* @Date: 2020-08-03 20:14:52
|
|
4
|
+
* @LastEditTime: 2020-08-17 18:46:53
|
|
5
|
+
* @LastEditors: why
|
|
6
|
+
* @Description: In User Settings Edit
|
|
7
|
+
* @FilePath: \xinxiaoban_zego\zby_live_sdk\src\live\extend.js
|
|
8
|
+
*/
|
|
9
|
+
import BASSAPI from './base';
|
|
10
|
+
|
|
11
|
+
export default {
|
|
12
|
+
/**
|
|
13
|
+
* @function 获取sdk版本号
|
|
14
|
+
* @return: Promise
|
|
15
|
+
*/
|
|
16
|
+
getLiveSdkVersion() {
|
|
17
|
+
return BASSAPI.getLiveSdkVersion();
|
|
18
|
+
},
|
|
19
|
+
/**
|
|
20
|
+
* @function 是否推流静音
|
|
21
|
+
* @return: Promise
|
|
22
|
+
*/
|
|
23
|
+
isStreamAudioMuted() {
|
|
24
|
+
return BASSAPI.isStreamAudioMuted();
|
|
25
|
+
},
|
|
26
|
+
/**
|
|
27
|
+
* @function 是否推画面流
|
|
28
|
+
* @return: Promise
|
|
29
|
+
*/
|
|
30
|
+
isStreamVideoMuted() {
|
|
31
|
+
return BASSAPI.isStreamVideoMuted();
|
|
32
|
+
},
|
|
33
|
+
async getStreamType(){
|
|
34
|
+
try {
|
|
35
|
+
const pushAudio = (await this.isStreamAudioMuted()).msg.ret;
|
|
36
|
+
const pushVideo = (await this.isStreamVideoMuted()).msg.ret;
|
|
37
|
+
let stream_type = 'both';
|
|
38
|
+
if (pushAudio && !pushVideo) {
|
|
39
|
+
stream_type = 'video';
|
|
40
|
+
}
|
|
41
|
+
if (!pushAudio && pushVideo) {
|
|
42
|
+
stream_type = 'audio';
|
|
43
|
+
}
|
|
44
|
+
if (pushAudio && pushVideo) {
|
|
45
|
+
stream_type = 'none';
|
|
46
|
+
}
|
|
47
|
+
return stream_type;
|
|
48
|
+
} catch (e){
|
|
49
|
+
let stream_type = 'none';
|
|
50
|
+
return stream_type;
|
|
51
|
+
}
|
|
52
|
+
},
|
|
53
|
+
};
|
package/src/live/index.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* @Author: why
|
|
3
|
-
* @Date: 2019-08-08 19:33:44
|
|
4
|
-
* @LastEditors: why
|
|
5
|
-
* @LastEditTime: 2019-09-09 15:02:54
|
|
6
|
-
* @Description:
|
|
7
|
-
*/
|
|
8
|
-
import api from './extend';
|
|
9
|
-
|
|
1
|
+
/*
|
|
2
|
+
* @Author: why
|
|
3
|
+
* @Date: 2019-08-08 19:33:44
|
|
4
|
+
* @LastEditors: why
|
|
5
|
+
* @LastEditTime: 2019-09-09 15:02:54
|
|
6
|
+
* @Description:
|
|
7
|
+
*/
|
|
8
|
+
import api from './extend';
|
|
9
|
+
|
|
10
10
|
export default api;
|
package/src/network/api.js
CHANGED
|
@@ -1,50 +1,50 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* @Author: your name
|
|
3
|
-
* @Date: 2020-08-28 17:06:45
|
|
4
|
-
* @LastEditTime: 2020-12-15 13:18:45
|
|
5
|
-
* @LastEditors: Please set LastEditors
|
|
6
|
-
* @Description: In User Settings Edit
|
|
7
|
-
* @FilePath: \1705\zby_live_sdk\src\network\api.js
|
|
8
|
-
*/
|
|
9
|
-
import commonFetch from './commonFetch.js';
|
|
10
|
-
import {getReportBaseUrl, getApiCloudBaseUrl, getCloudApiDomain, getApiChangeSdkUrl, timestampUrl} from '../config/config.js';
|
|
11
|
-
import util from '../util/util';
|
|
12
|
-
|
|
13
|
-
//获取信道服务器地址
|
|
14
|
-
export function getImServerAddress(param){
|
|
15
|
-
return commonFetch(`${getCloudApiDomain()}/service/chat`, param, 'GET');
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
/**
|
|
19
|
-
* @function 从三方服务器获取时间戳
|
|
20
|
-
*/
|
|
21
|
-
export function getNetworkTimestampApi(name = 'taobao'){
|
|
22
|
-
return commonFetch(timestampUrl[name], 'GET');
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
// 获取云控参数
|
|
26
|
-
export function getCloudData(param){
|
|
27
|
-
return commonFetch(`${getApiCloudBaseUrl()}/rtccloud/class/init`, param, 'GET', null, util.getVerifySign1());
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
//获取初始化参数
|
|
31
|
-
export function getInitParams(param){
|
|
32
|
-
return commonFetch(`${getApiCloudBaseUrl()}/v1/play/init`, param, 'GET');
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
//获取新旧信道开关和地址
|
|
36
|
-
export function getSwitchDomain(param){
|
|
37
|
-
return commonFetch(`${getApiCloudBaseUrl()}/v1/switch/domain`, param, 'GET');
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
export function dabanDataReport(param){
|
|
41
|
-
return commonFetch(getReportBaseUrl(), param, 'POST');
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
//sdk切换(客户端直接调用) 根据上课情况手动操作,对单个组ID进行SDK切换
|
|
45
|
-
// export function changeSdkInRoom(param){
|
|
46
|
-
// return commonFetch(`${getApiChangeSdkUrl()}/rtccloud/sdk/set/room/client`, param, 'FROMDATA');
|
|
47
|
-
// }
|
|
48
|
-
export function changeSdkInRoom(param){
|
|
49
|
-
return commonFetch(`${getApiChangeSdkUrl()}/rtccloud/sdk/set/lecture/client`, param, 'FROMDATA');
|
|
50
|
-
}
|
|
1
|
+
/*
|
|
2
|
+
* @Author: your name
|
|
3
|
+
* @Date: 2020-08-28 17:06:45
|
|
4
|
+
* @LastEditTime: 2020-12-15 13:18:45
|
|
5
|
+
* @LastEditors: Please set LastEditors
|
|
6
|
+
* @Description: In User Settings Edit
|
|
7
|
+
* @FilePath: \1705\zby_live_sdk\src\network\api.js
|
|
8
|
+
*/
|
|
9
|
+
import commonFetch from './commonFetch.js';
|
|
10
|
+
import {getReportBaseUrl, getApiCloudBaseUrl, getCloudApiDomain, getApiChangeSdkUrl, timestampUrl} from '../config/config.js';
|
|
11
|
+
import util from '../util/util';
|
|
12
|
+
|
|
13
|
+
//获取信道服务器地址
|
|
14
|
+
export function getImServerAddress(param){
|
|
15
|
+
return commonFetch(`${getCloudApiDomain()}/service/chat`, param, 'GET');
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* @function 从三方服务器获取时间戳
|
|
20
|
+
*/
|
|
21
|
+
export function getNetworkTimestampApi(name = 'taobao'){
|
|
22
|
+
return commonFetch(timestampUrl[name], 'GET');
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
// 获取云控参数
|
|
26
|
+
export function getCloudData(param){
|
|
27
|
+
return commonFetch(`${getApiCloudBaseUrl()}/rtccloud/class/init`, param, 'GET', null, util.getVerifySign1());
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
//获取初始化参数
|
|
31
|
+
export function getInitParams(param){
|
|
32
|
+
return commonFetch(`${getApiCloudBaseUrl()}/v1/play/init`, param, 'GET');
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
//获取新旧信道开关和地址
|
|
36
|
+
export function getSwitchDomain(param){
|
|
37
|
+
return commonFetch(`${getApiCloudBaseUrl()}/v1/switch/domain`, param, 'GET');
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
export function dabanDataReport(param){
|
|
41
|
+
return commonFetch(getReportBaseUrl(), param, 'POST');
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
//sdk切换(客户端直接调用) 根据上课情况手动操作,对单个组ID进行SDK切换
|
|
45
|
+
// export function changeSdkInRoom(param){
|
|
46
|
+
// return commonFetch(`${getApiChangeSdkUrl()}/rtccloud/sdk/set/room/client`, param, 'FROMDATA');
|
|
47
|
+
// }
|
|
48
|
+
export function changeSdkInRoom(param){
|
|
49
|
+
return commonFetch(`${getApiChangeSdkUrl()}/rtccloud/sdk/set/lecture/client`, param, 'FROMDATA');
|
|
50
|
+
}
|
|
@@ -1,66 +1,66 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* @Author: songge
|
|
3
|
-
* @Date: 2020-08-31 16:13:51
|
|
4
|
-
* @LastEditTime: 2020-08-31 19:21:52
|
|
5
|
-
* @LastEditors: Please set LastEditors
|
|
6
|
-
* @Description: In User Settings Edit
|
|
7
|
-
* @FilePath: \demo9\51-demo\src\_zby_live_sdk\src\network\commonFetch.js
|
|
8
|
-
*/
|
|
9
|
-
import axios from 'axios';
|
|
10
|
-
import Qs from 'qs';
|
|
11
|
-
/**
|
|
12
|
-
* 真正的请求
|
|
13
|
-
* @param url 请求地址
|
|
14
|
-
* @param options 请求参数
|
|
15
|
-
* @param method 请求方式
|
|
16
|
-
*/
|
|
17
|
-
|
|
18
|
-
const get = (params, url, timeout, headers) => {
|
|
19
|
-
return axios({
|
|
20
|
-
method: 'get',
|
|
21
|
-
url,
|
|
22
|
-
timeout,
|
|
23
|
-
params,
|
|
24
|
-
headers
|
|
25
|
-
});
|
|
26
|
-
};
|
|
27
|
-
|
|
28
|
-
const post = (data, url, timeout) => {
|
|
29
|
-
return axios({
|
|
30
|
-
method: 'post',
|
|
31
|
-
url,
|
|
32
|
-
timeout,
|
|
33
|
-
data
|
|
34
|
-
});
|
|
35
|
-
};
|
|
36
|
-
|
|
37
|
-
const post1 = (data, url, timeout, headers) => {
|
|
38
|
-
return axios({
|
|
39
|
-
method: 'post',
|
|
40
|
-
url,
|
|
41
|
-
timeout,
|
|
42
|
-
data: Qs.stringify(data),
|
|
43
|
-
headers
|
|
44
|
-
});
|
|
45
|
-
};
|
|
46
|
-
function commonFetch(url, options, method = 'GET', timeOut = 60000, headers) {
|
|
47
|
-
if (method === 'GET') { // 如果是GET请求,拼接url
|
|
48
|
-
return get(options, url, timeOut, headers).then((res)=>{
|
|
49
|
-
return res.data;
|
|
50
|
-
});
|
|
51
|
-
} else if(method === 'POST') {
|
|
52
|
-
return post(options, url, timeOut).then((res)=>{
|
|
53
|
-
return res.data;
|
|
54
|
-
});
|
|
55
|
-
} else if(method === 'FROMDATA') {
|
|
56
|
-
let headers = {
|
|
57
|
-
'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8'
|
|
58
|
-
};
|
|
59
|
-
return post1(options, url, timeOut, headers).then((res)=>{
|
|
60
|
-
return res.data;
|
|
61
|
-
});
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
export default commonFetch;
|
|
66
|
-
|
|
1
|
+
/*
|
|
2
|
+
* @Author: songge
|
|
3
|
+
* @Date: 2020-08-31 16:13:51
|
|
4
|
+
* @LastEditTime: 2020-08-31 19:21:52
|
|
5
|
+
* @LastEditors: Please set LastEditors
|
|
6
|
+
* @Description: In User Settings Edit
|
|
7
|
+
* @FilePath: \demo9\51-demo\src\_zby_live_sdk\src\network\commonFetch.js
|
|
8
|
+
*/
|
|
9
|
+
import axios from 'axios';
|
|
10
|
+
import Qs from 'qs';
|
|
11
|
+
/**
|
|
12
|
+
* 真正的请求
|
|
13
|
+
* @param url 请求地址
|
|
14
|
+
* @param options 请求参数
|
|
15
|
+
* @param method 请求方式
|
|
16
|
+
*/
|
|
17
|
+
|
|
18
|
+
const get = (params, url, timeout, headers) => {
|
|
19
|
+
return axios({
|
|
20
|
+
method: 'get',
|
|
21
|
+
url,
|
|
22
|
+
timeout,
|
|
23
|
+
params,
|
|
24
|
+
headers
|
|
25
|
+
});
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
const post = (data, url, timeout) => {
|
|
29
|
+
return axios({
|
|
30
|
+
method: 'post',
|
|
31
|
+
url,
|
|
32
|
+
timeout,
|
|
33
|
+
data
|
|
34
|
+
});
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
const post1 = (data, url, timeout, headers) => {
|
|
38
|
+
return axios({
|
|
39
|
+
method: 'post',
|
|
40
|
+
url,
|
|
41
|
+
timeout,
|
|
42
|
+
data: Qs.stringify(data),
|
|
43
|
+
headers
|
|
44
|
+
});
|
|
45
|
+
};
|
|
46
|
+
function commonFetch(url, options, method = 'GET', timeOut = 60000, headers) {
|
|
47
|
+
if (method === 'GET') { // 如果是GET请求,拼接url
|
|
48
|
+
return get(options, url, timeOut, headers).then((res)=>{
|
|
49
|
+
return res.data;
|
|
50
|
+
});
|
|
51
|
+
} else if(method === 'POST') {
|
|
52
|
+
return post(options, url, timeOut).then((res)=>{
|
|
53
|
+
return res.data;
|
|
54
|
+
});
|
|
55
|
+
} else if(method === 'FROMDATA') {
|
|
56
|
+
let headers = {
|
|
57
|
+
'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8'
|
|
58
|
+
};
|
|
59
|
+
return post1(options, url, timeOut, headers).then((res)=>{
|
|
60
|
+
return res.data;
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
export default commonFetch;
|
|
66
|
+
|