zby-live-sdk
Advanced tools
Comparing version 1.0.20 to 1.0.21
@@ -5,2 +5,6 @@ # Change Log | ||
<a name="1.0.21"></a> | ||
## 1.0.21 (2019-06-24) | ||
1.销毁播放器方法兼容 | ||
<a name="1.0.20"></a> | ||
@@ -7,0 +11,0 @@ ## 1.0.20 (2019-06-23) |
{ | ||
"name": "zby-live-sdk", | ||
"version": "1.0.20", | ||
"version": "1.0.21", | ||
"main": "dist/zby-live-sdk.cjs.js", | ||
@@ -5,0 +5,0 @@ "module": "dist/zby-live-sdk.esm.js", |
@@ -7,2 +7,6 @@ # Zby live SDK | ||
<a name="1.0.21"></a> | ||
## 1.0.21 (2019-06-24) | ||
1.销毁播放器方法兼容 | ||
<a name="1.0.20"></a> | ||
@@ -9,0 +13,0 @@ ## 1.0.20 (2019-06-23) |
@@ -13,3 +13,3 @@ const prefix = { | ||
export const version = '1.0.20'; | ||
export const version = '1.0.21'; | ||
@@ -16,0 +16,0 @@ export const extensionInfo = { |
@@ -322,2 +322,3 @@ /** | ||
case ZEGO: | ||
return zegosdk.playDestroy(streamId); | ||
case AGORA: | ||
@@ -324,0 +325,0 @@ default: |
@@ -23,3 +23,3 @@ /** | ||
// 拉流的播放通道初始化从 1 开始依次递增,-1 为推流的本地视频预览 | ||
let uiChnIndex = 1; | ||
const uiChnIndexs = [20, 19, 18, 17, 16, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1]; | ||
// 初始化是否完成的标志,0 为未完成,1 为完成 | ||
@@ -421,3 +421,3 @@ let isInitFinished = 0; | ||
for (let key in streamIdToPreviewId) { | ||
await stopPlayStream(key); | ||
await playDestroy(key); | ||
} | ||
@@ -437,3 +437,2 @@ await stopPreview(); | ||
streamIdToPreviewId = {}; | ||
uiChnIndex = 1; | ||
hasLoginChannel = 0; | ||
@@ -1349,18 +1348,20 @@ hasPushFlow = 0; | ||
if (!streamIdToPreviewId[streamId]) { | ||
streamIdToPreviewId[streamId] = { | ||
playChannel: uiChnIndex++, | ||
status: '' | ||
}; | ||
if (typeof zegoCallback === 'function' && uiChnIndex > 20) { | ||
let uiChnIndex = 1; | ||
if (typeof zegoCallback === 'function' && uiChnIndexs.length === 0) { | ||
zegoCallback({ | ||
type: 'over_max_connect', | ||
data: { | ||
message: `service zego index over max 20 , now is ${uiChnIndex}` | ||
message: 'ZEGO:: all uiChnIndexs are used' | ||
} | ||
}); | ||
} | ||
if (uiChnIndex > 20) { | ||
writeLog('error', `avsdk ZEGO:: uiChnIndex ${uiChnIndex} 超出max 20`); | ||
if (uiChnIndexs.length === 0) { | ||
writeLog('error', 'ZEGO:: all uiChnIndexs are used'); | ||
return; | ||
} | ||
uiChnIndex = uiChnIndexs.pop(); | ||
streamIdToPreviewId[streamId] = { | ||
playChannel: uiChnIndex, | ||
status: '' | ||
}; | ||
} else if (streamIdToPreviewId[streamId].status === 'start') { | ||
@@ -1420,2 +1421,15 @@ await stopPlayStream(streamId); | ||
/** | ||
* @function 销毁拉指定的流 | ||
* @param streamId:String 被拉取的流的 id,必选 | ||
* @return Promise | void | ||
*/ | ||
export const playDestroy = (streamId) => { | ||
uiChnIndexs.push(streamIdToPreviewId[streamId].playChannel); | ||
delete streamIdToPreviewId[streamId]; | ||
return callMethod('StopPlayStream', { | ||
pszStreamID: streamId | ||
}); | ||
}; | ||
/** | ||
* @function 转推,录课 | ||
@@ -1691,2 +1705,3 @@ * @param type:String 必选,'start' | 'stop' | ||
stopPlayStream, | ||
playDestroy, | ||
mixStream, | ||
@@ -1693,0 +1708,0 @@ leaveRoom, |
@@ -678,4 +678,4 @@ import interactWithChannel from './channel/interactWithChannel'; | ||
await zbyAVSDK.playDestroy(streamId); | ||
noticeStreamStatus(userId, 'stream_stopped'); | ||
writeLog('info', `sdk action : playDestroy ,userId : ${userId}, groupId: ${groupId}, notice: stream_stopped`); | ||
noticeStreamStatus(userId, 'stream_destroy'); | ||
writeLog('info', `sdk action : playDestroy ,userId : ${userId}, groupId: ${groupId}, notice: stream_destroy`); | ||
}, | ||
@@ -682,0 +682,0 @@ |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
879265
10936
167