UNPKG

zby-live-sdk

Version:

This is a live SDK for weclassroom.

54 lines (52 loc) 1.28 kB
/* * @Author: your name * @Date: 2020-08-03 20:14:52 * @LastEditTime: 2020-08-17 18:46:53 * @LastEditors: why * @Description: In User Settings Edit * @FilePath: \xinxiaoban_zego\zby_live_sdk\src\live\extend.js */ import BASSAPI from './base'; export default { /** * @function 获取sdk版本号 * @return: Promise */ getLiveSdkVersion() { return BASSAPI.getLiveSdkVersion(); }, /** * @function 是否推流静音 * @return: Promise */ isStreamAudioMuted() { return BASSAPI.isStreamAudioMuted(); }, /** * @function 是否推画面流 * @return: Promise */ isStreamVideoMuted() { return BASSAPI.isStreamVideoMuted(); }, async getStreamType(){ try { const pushAudio = (await this.isStreamAudioMuted()).msg.ret; const pushVideo = (await this.isStreamVideoMuted()).msg.ret; let stream_type = 'both'; if (pushAudio && !pushVideo) { stream_type = 'video'; } if (!pushAudio && pushVideo) { stream_type = 'audio'; } if (pushAudio && pushVideo) { stream_type = 'none'; } return stream_type; } catch (e){ let stream_type = 'none'; return stream_type; } }, };