Toggle navigation
Toggle navigation
此项目
正在载入...
Sign in
李勇
/
McuClient
转到一个项目
Toggle navigation
项目
群组
代码片段
帮助
Toggle navigation pinning
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Authored by
李勇
8 years ago
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
d56d89833ea8d9f91180099cdb8a64d66a27fc88
d56d8983
1 parent
a0319bdc
修改webRtc推流的分辨率,根据不同身份和课堂类型设置
隐藏空白字符变更
内嵌
并排对比
正在显示
2 个修改的文件
包含
35 行增加
和
19 行删除
src/EngineEntrance.js
src/apes/WebRtcApe.js
src/EngineEntrance.js
查看文件 @
d56d898
...
...
@@ -62,7 +62,7 @@ export default class MessageEntrance extends Emiter {
constructor
()
{
super
();
//sdk 信息
GlobalConfig
.
sdkVersion
=
"v2.18.1
0.20171019
"
;
GlobalConfig
.
sdkVersion
=
"v2.18.1
4.20171020
"
;
loger
.
warn
(
"sdkVersion:"
+
GlobalConfig
.
sdkVersion
);
//设置
...
...
@@ -1226,8 +1226,8 @@ export default class MessageEntrance extends Emiter {
//主讲人和老师可以设置旁录
if
(
GlobalConfig
.
appId
&&!
GlobalConfig
.
openFlash
){
//加入之前先设置旁录地址,只有直播支持旁路
if
(
_webRtc
&&
GlobalConfig
.
isTeachOrAssistant
){
//加入之前先设置旁录地址,只有直播支持旁路(1路流)
if
(
_webRtc
&&
GlobalConfig
.
isTeachOrAssistant
&&
GlobalConfig
.
maxMediaChannels
==
1
){
let
curTimestamp
=
new
Date
().
getTime
();
let
streamId
=
GlobalConfig
.
siteId
+
"_"
+
GlobalConfig
.
classId
+
"_"
+
GlobalConfig
.
userId
+
"_"
+
curTimestamp
;
//传入固定的流Id
...
...
src/apes/WebRtcApe.js
查看文件 @
d56d898
...
...
@@ -12,6 +12,10 @@ var AgoraRTC = require('../AgoraRTCSDK-1.14.0');
let
loger
=
Loger
.
getLoger
(
'WebRtcApe'
);
const
SIZE_480
=
480
;
const
SIZE_360
=
360
;
const
SIZE_320
=
320
;
const
SIZE_240
=
240
;
const
SIZE_160
=
160
;
const
SIZE_120
=
120
;
class
WebRtcApe
extends
Emiter
{
constructor
()
{
super
();
...
...
@@ -47,8 +51,10 @@ class WebRtcApe extends Emiter {
this
.
pFrameRate
=
30
;
this
.
pBitrate
=
500
;
this
.
videoResolution
=
"360P_8"
;
//480x360 30 490
//this.videoResolution = "240P";//
//120P 0 160x120 15 65
//240P 20 320x240 15 200
//360P_8 37 480x360 30 490
this
.
videoResolution
=
"240P"
;
this
.
isOpenVideo
=
true
;
this
.
isPublish
=
false
;
//当前是否正在推流
...
...
@@ -346,7 +352,21 @@ class WebRtcApe extends Emiter {
this.info = _params.info || "";
this.channelKey = _params.channelKey || null;
loger.log("
开始加入视频通话频道
->
channelId
:
" + this.channelId, "
uid
:
" + this.uid);
//根据不同身份设置不同的分辨率
if(GlobalConfig.isTeachOrAssistant){
if(GlobalConfig.maxMediaChannels==2){
//1v1时使用标清
this.videoResolution="
240
P
";
}else {
this.videoResolution="
360
P_8
";
}
}if(GlobalConfig.isInvisible){
this.videoResolution="
120
P
";
}else {
this.videoResolution="
240
P
";
}
loger.log("
开始加入视频通话频道
->
channelId
:
" + this.channelId, "
uid
:
" + this.uid,"
videoResolution
:
"+this.videoResolution);
this.client.join(this.channelKey, "" + this.channelId, this.uid, (uid)=> {
this.uid = uid;
loger.log("
加入视频通话频道
->
成功
->
channelId
:
" + this.channelId, "
uid
:
" + this.uid);
...
...
@@ -712,20 +732,16 @@ class WebRtcApe extends Emiter {
for (let i = 0; i < devices.length; i++) {
let device = devices[i];
//{"
deviceId
":"
default
","
kind
":"
audiooutput
","
label
":"
默认
","
groupId
":"
cf49a03ca26700235629fc13d3e6630bd34407c66438d157056a34dd3ae03ef5
"}
if (device.kind == 'audioinput') {
if (!device.label) {
device.label = "
麦克风
_
" + i;
}
this.microphones.push(device);
GlobalConfig.microphones.push(device.label);
} else if (device.kind == 'videoinput') {
if (!device.label) {
device.label = "
摄像头
_
" + i;
if(device){
if (device.kind == 'audioinput') {
this.microphones.push(device);
GlobalConfig.microphones.push(device.label);
} else if (device.kind == 'videoinput') {
this.cameras.push(device);
GlobalConfig.cameras.push(device.label);
} else {
loger.warn('其他设备: ', device);
}
this.cameras.push(device);
GlobalConfig.cameras.push(device.label);
} else {
loger.warn('其他设备: ', device);
}
}
let _deviceData = {cameras: GlobalConfig.cameras, microphones: GlobalConfig.microphones};
...
...
请
注册
或
登录
后发表评论