Webcamon/off switch



  • Does anyone know how to turn off the webcam mid session ie. if someone decides they do not wish to send their video/sound to their partner anymore, is there a call/event that is built in to turn off the webcam?

    I understand that "event:opensetts" is used on jabbercam.com if someone's webcam is not turned on, but how can someone turn it off?

    Also, could someone help me make a toggle button in flash to toggle the webcam?

    Thanks.



  • On/Off: on
    On/Off: right click on the running Flash application >>Settings>>"Deny">>Close



  • This is what I did to get round it:

    Created a new button in the mxml file you want that links to this function in jabbercam.as:

    private function btnWebcam_clickHandler(event:MouseEvent):void
    {
    	// TODO Auto-generated method stub
    	if(webcamOn==true) {
    		webcamOn=false;
    		stopVideo();
    		stopAudio();
    //		status(this.lang.getSimpleProperty("webcamOff")+"\n");
    		btnWebcam.label = this.lang.getSimpleProperty("webcamLabelOn");
    	} else {
    		webcamOn=true;
    		startVideo();
    		startAudio();
    //		status(this.lang.getSimpleProperty("webcamOn")+"\n");
    		btnWebcam.label = this.lang.getSimpleProperty("webcamLabelOff");
    	}
    }
    
    

    This then needs two new functions:

    private function stopVideo():void
    {
    	vidMe.attachCamera(null);
    	if (outgoingStream)
    	{
    		outgoingStream.attachCamera(null);
    	}
    }
    
    private function stopAudio():void
    {
    	if (outgoingStream)
    	{
    		outgoingStream.attachAudio(null);
    	}
    }
    
    

    I put these two in jabbercam.as after the startaudio() and after the startvideo() functions.

    Hope this works for you too.


 

Looks like your connection to H7 was lost, please wait while we try to reconnect.