one peer with audio the other one with video

已查看 88 次
跳至第一个未读帖子

Francois Baret

未读,
2015年10月14日 12:55:402015/10/14
收件人 EasyRTC
I would like to establish a  communication between two PCs, one as a webcam, the other has just a mic. If I use the "video only" demo I get an error message "DevicesNotFound" on the PC without webcam. How can I remove the consistency check which triggers the error message? I cannot find which subroutine is coding for it. I know I could use the "Video+Audio" demo, but I would rather modify the "video only".
Thanks for your help!

Eric Davies

未读,
2015年10月14日 13:56:172015/10/14
收件人 EasyRTC
before connecting to the server:
call easyrtc.enableAudio(false) on the pc without a microphone.
call easyrtc.enableVideo(false) on the pc without a camera.

Francois Baret

未读,
2015年10月15日 05:43:222015/10/15
收件人 EasyRTC
I suppose you mean I have to modify the "demo_video_only.js" code and replace the current:
easyrtc.enableAudio(false);
easyrtc.enableAudioReceive(false)
by something else...
But then I do not understand what you mean by "on the pc without a camera". There is only one "demo_video_only.js", it is on the other pc, the one with the camera! The other pc is just accessing the demo through a browser with 192.168.1.10:8080/demos/demo_video_only.html. I have no way to modify any code for this pc.
Sorry, but I am confused by you wrote.
已删除帖子

Eric Davies

未读,
2015年10月15日 10:56:022015/10/15
收件人 EasyRTC
If I understand your problem (and thats a bit of guess), you want a single file that automatically decides what to send based on the machines capability.

Removing "the consistency check" would be modifying the easyrtc.js code. You could do it, I just wouldn't recommend it.
The cleaner approach is:
  Determine if you have any video cameras hooked up, if you don't, disable video.
  Determine if you have a microphone hooked up, if don't, disable audio.
  You can check these two items with:

  easyrtc.getVideoSourceList and easyrtc.getAudioSourceList

    /**
     * Gets a list of the available audio sources (ie, cameras)
     * @param {Function} callback receives list of {label:String, id:String, kind:"audio"}
     * Note: the label string always seems to be the empty string if you aren't using https.
     * Note: not supported by Firefox.
     * @example  easyrtc.getAudioSourceList( function(list) {
     *               var i;
     *               for( i = 0; i < list.length; i++ ) {
     *                   console.log("label=" + list[i].label + ", id= " + list[i].id);
     *               }
     *          });
     */
    this.getAudioSourceList = function(callback){
       getSourceList(callback, "audio");
    };

    /**
     * Gets a list of the available video sources (ie, cameras)
     * @param {Function} callback receives list of {facing:String, label:String, id:String, kind:"video"}
     * Note: the label string always seems to be the empty string if you aren't using https.
     * Note: not supported by Firefox.
     * @example  easyrtc.getVideoSourceList( function(list) {
     *               var i;
     *               for( i = 0; i < list.length; i++ ) {
     *                   console.log("label=" + list[i].label + ", id= " + list[i].id);
     *               }
     *          });
     */
    this.getVideoSourceList = function(callback) {
       getSourceList(callback, "video");
    };

If instead, you actually want two different URLs, then the problem is easier, you take the audio_only demo and the video_only demo, and modify them so that they use the same app name (the first argument to easyrtc.easyApp), resulting in them "seeing each other".

回复全部
回复作者
转发
0 个新帖子