|
@@ -51,6 +51,29 @@ export function initListener(vue) {
|
|
|
rtc.handsUp({
|
|
|
success: str => {
|
|
|
console.log('举手成功', str);
|
|
|
+ console.log('创建本地流推流');
|
|
|
+ const createData = {
|
|
|
+ video: true,
|
|
|
+ audio: true
|
|
|
+ };
|
|
|
+ rtc.createLocalStream({
|
|
|
+ streamName: 'picture',
|
|
|
+ createData,
|
|
|
+ success: function (stream) {
|
|
|
+ console.log('创建本地流成功', stream);
|
|
|
+ // 创建本地流成功,将流展示到id为 student 的dom元素盒子中
|
|
|
+ stream.show('group-local');
|
|
|
+ publishStream('picture'); // 如果需要立即推流,执行 publish 方法
|
|
|
+ },
|
|
|
+ fail: function (data) {
|
|
|
+ console.log('创建本地流失败,应用层处理', data);
|
|
|
+ // 创建本地流失败,应用层处理
|
|
|
+ Message({
|
|
|
+ type: 'error',
|
|
|
+ message: '创建本地流失败:' + data
|
|
|
+ });
|
|
|
+ }
|
|
|
+ });
|
|
|
},
|
|
|
fail: data => {
|
|
|
console.log('举手失败', data);
|
|
@@ -190,30 +213,7 @@ export function initListener(vue) {
|
|
|
});
|
|
|
|
|
|
rtc.on('createLocalStream', () => {
|
|
|
- // 创建本地流推流
|
|
|
console.log('创建本地流推流');
|
|
|
- const createData = {
|
|
|
- video: true,
|
|
|
- audio: true
|
|
|
- };
|
|
|
- rtc.createLocalStream({
|
|
|
- streamName: 'picture',
|
|
|
- createData,
|
|
|
- success: function (stream) {
|
|
|
- console.log('创建本地流成功', stream);
|
|
|
- // 创建本地流成功,将流展示到id为 student 的dom元素盒子中
|
|
|
- stream.show('group-local');
|
|
|
- publishStream('picture'); // 如果需要立即推流,执行 publish 方法
|
|
|
- },
|
|
|
- fail: function (data) {
|
|
|
- console.log('创建本地流失败,应用层处理', data);
|
|
|
- // 创建本地流失败,应用层处理
|
|
|
- Message({
|
|
|
- type: 'error',
|
|
|
- message: '创建本地流失败:' + data
|
|
|
- });
|
|
|
- }
|
|
|
- });
|
|
|
});
|
|
|
|
|
|
/**
|