Webrtc 是否可以访问用户';管理员使用RTCMultiConnection#V3的网络摄像头
我正在创建音频/视频/文本聊天应用程序。我已成功完成视频会议功能。但我不知道如何在未经用户许可的情况下访问用户的网络摄像头 我想做的就是管理员可以访问用户的网络摄像头。我已经创建了在线用户列表。当管理员点击在线用户的按钮Webrtc 是否可以访问用户';管理员使用RTCMultiConnection#V3的网络摄像头,webrtc,rtcmulticonnection,Webrtc,Rtcmulticonnection,我正在创建音频/视频/文本聊天应用程序。我已成功完成视频会议功能。但我不知道如何在未经用户许可的情况下访问用户的网络摄像头 我想做的就是管理员可以访问用户的网络摄像头。我已经创建了在线用户列表。当管理员点击在线用户的按钮Watch时,管理员应该能够访问用户的网络摄像头,以便管理员可以从该特定用户的网络摄像头中查看 有谁能指导我这样做吗 超级管理员可以查看所有房间,从任何房间的任何用户处获取视频。 您可以使用socket.io或其他PHP/mySQL与超级管理员共享房间 超级管理员可以使用“加入”
Watch
时,管理员应该能够访问用户的网络摄像头,以便管理员可以从该特定用户的网络摄像头中查看
有谁能指导我这样做吗
超级管理员可以查看所有房间,从任何房间的任何用户处获取视频。 您可以使用socket.io或其他PHP/mySQL与超级管理员共享房间 超级管理员可以使用“加入”方法查看任何用户的视频: 超级管理员必须设置“dontCaptureUserMedia=true”以确保他不共享自己的相机。这意味着超级管理员可以从任何房间无需查看任何用户的视频
connection.dontCaptureUserMedia = true;
var selectedUserId = database.getSelectedUserId();
connection.join(selectedUserId);
看看如何去尝试
下面是超级管理员的示例代码:
connection.socketCustomEvent = 'super-admin-socket';
connection.dontCaptureUserMedia = true;
connection.connectSocket(function() {
connection.socket.on(connection.socketCustomEvent, function(message) {
if (message.newUser === true) {
connection.join(message.userid);
}
});
});
connection.socketCustomEvent = 'super-admin-socket';
connection.openOrJoin('any-room-id', function() {
// this message is going toward super-admin
// super-admin will receive this message
// super-admin can view this user's camera seamlessly
// or show his name in a list
connection.socket.emit(connection.socketCustomEvent, {
newUser: true,
userid: connection.userid
});
});
connection.socketCustomEvent = 'super-admin-socket';
connection.dontCaptureUserMedia = true;
connection.connectSocket(function() {
connection.socket.on(connection.socketCustomEvent, function(message) {
if (message.newUser === true) {
connection.join(message.userid);
}
if (message.newRoom === true) {
// display room in a list
// or view room owner's video
connection.join(message.roomid);
}
});
});
以下是所有普通用户的代码。i、 e.任何房间的任何用户:
connection.socketCustomEvent = 'super-admin-socket';
connection.dontCaptureUserMedia = true;
connection.connectSocket(function() {
connection.socket.on(connection.socketCustomEvent, function(message) {
if (message.newUser === true) {
connection.join(message.userid);
}
});
});
connection.socketCustomEvent = 'super-admin-socket';
connection.openOrJoin('any-room-id', function() {
// this message is going toward super-admin
// super-admin will receive this message
// super-admin can view this user's camera seamlessly
// or show his name in a list
connection.socket.emit(connection.socketCustomEvent, {
newUser: true,
userid: connection.userid
});
});
connection.socketCustomEvent = 'super-admin-socket';
connection.dontCaptureUserMedia = true;
connection.connectSocket(function() {
connection.socket.on(connection.socketCustomEvent, function(message) {
if (message.newUser === true) {
connection.join(message.userid);
}
if (message.newRoom === true) {
// display room in a list
// or view room owner's video
connection.join(message.roomid);
}
});
});
查看如何与超级管理员共享房间:
connection.socketCustomEvent = 'super-admin-socket';
connection.dontCaptureUserMedia = true;
connection.connectSocket(function() {
connection.socket.on(connection.socketCustomEvent, function(message) {
if (message.newUser === true) {
connection.join(message.userid);
}
});
});
connection.socketCustomEvent = 'super-admin-socket';
connection.openOrJoin('any-room-id', function() {
// this message is going toward super-admin
// super-admin will receive this message
// super-admin can view this user's camera seamlessly
// or show his name in a list
connection.socket.emit(connection.socketCustomEvent, {
newUser: true,
userid: connection.userid
});
});
connection.socketCustomEvent = 'super-admin-socket';
connection.dontCaptureUserMedia = true;
connection.connectSocket(function() {
connection.socket.on(connection.socketCustomEvent, function(message) {
if (message.newUser === true) {
connection.join(message.userid);
}
if (message.newRoom === true) {
// display room in a list
// or view room owner's video
connection.join(message.roomid);
}
});
});
以下代码适用于普通用户:
connection.socketCustomEvent = 'super-admin-socket';
connection.openOrJoin('any-room-id', function() {
// check if it is a room owner
if (connection.isInitiator === true) {
// room owner is sharing his room with super-adin
connection.socket.emit(connection.socketCustomEvent, {
newRoom: true,
roomid: connection.sessionid
});
}
});
以下代码适用于超级管理员:
connection.socketCustomEvent = 'super-admin-socket';
connection.dontCaptureUserMedia = true;
connection.connectSocket(function() {
connection.socket.on(connection.socketCustomEvent, function(message) {
if (message.newUser === true) {
connection.join(message.userid);
}
});
});
connection.socketCustomEvent = 'super-admin-socket';
connection.openOrJoin('any-room-id', function() {
// this message is going toward super-admin
// super-admin will receive this message
// super-admin can view this user's camera seamlessly
// or show his name in a list
connection.socket.emit(connection.socketCustomEvent, {
newUser: true,
userid: connection.userid
});
});
connection.socketCustomEvent = 'super-admin-socket';
connection.dontCaptureUserMedia = true;
connection.connectSocket(function() {
connection.socket.on(connection.socketCustomEvent, function(message) {
if (message.newUser === true) {
connection.join(message.userid);
}
if (message.newRoom === true) {
// display room in a list
// or view room owner's video
connection.join(message.roomid);
}
});
});
结论:
connection.socketCustomEvent = 'super-admin-socket';
connection.dontCaptureUserMedia = true;
connection.connectSocket(function() {
connection.socket.on(connection.socketCustomEvent, function(message) {
if (message.newUser === true) {
connection.join(message.userid);
}
});
});
connection.socketCustomEvent = 'super-admin-socket';
connection.openOrJoin('any-room-id', function() {
// this message is going toward super-admin
// super-admin will receive this message
// super-admin can view this user's camera seamlessly
// or show his name in a list
connection.socket.emit(connection.socketCustomEvent, {
newUser: true,
userid: connection.userid
});
});
connection.socketCustomEvent = 'super-admin-socket';
connection.dontCaptureUserMedia = true;
connection.connectSocket(function() {
connection.socket.on(connection.socketCustomEvent, function(message) {
if (message.newUser === true) {
connection.join(message.userid);
}
if (message.newRoom === true) {
// display room in a list
// or view room owner's video
connection.join(message.roomid);
}
});
});
超级管理员必须拥有任何用户的userid
,才能查看其视频
没有用户的许可是不可能的。发送一个请求,你可以发送一个customtrigger,它在发送者站点上执行getusermedia函数。这在NodeJS中可能吗?什么是
数据库。getSelectedUserId()代码>是否来自数据库?RTCMultiConnection-v3使用nodesj/socket.io。以上代码段的目标是socket.io。关于“data.getSelectedUserId”,这只是一个提示。您可以忽略该部分(即database.getSelectedUserId),因为您可以通过socket.io获取所有活动房间。最后一个代码段使用socket.io与超级管理员共享房间id。