Web Video Chat Room API
Overview
The video call room API will enable developers to easily embed the ooVoo video rooms
inside their own web sites. Since we believe that ease of use is the key for success,
the focus is to have as much functionality as possible using "copy/paste" or ready
to use JavaScript code.
One server API (REST protocol) is also included to get the list of active video
calls in all instances of a specified room.
Register Now to get 5 free room instances for your web site !!
Room Widget
Overview
The room widget lets developers who are familiar with HTML and/or JavaScript to
easily embed ooVoo video chat rooms into their web sites. After the room is created,
there are JavaScript functions that let the developer control the video chat window.
The video call window itself is implemented as a Java applet or Active X, depending
if Java Runtime is installed or not. The video window control JavaScript functions
are only wrappers around the applet and Active X functions.
The JavaScript functions exist in a separate JS file that is included on the page
where the video chat room is used.
Room creation code
This is the embed code that the user sees in the Code tab on the Room management
window. To find it, go to www.oovoo.com, click on the My Account tab and login,
then select the Video Chat Room tab:
<!--Start ooVoo room code-->
<script type="text/javascript" src="http://videocallroom.oovoo.com/oovoomelink/codelib/oovoorooms.js"></script>
<script src='http://java.com/js/deployJava.js'></script>
<script type='text/javascript'>
roomProps.roomID = '60D56CE75A321CE3E01230144F7E8E22';
<!-- This is a sample room ID, get your
room ID here -->
roomProps.instanceKey = 'randomString';
<!-- create multiple rooms by changing this string. same string for two people
will put them in the same room. -->
roomProps.controlVisible = true;
<!-- you can hid the control bar -->
roomProps.width = '795';
<!-- Note: width cannot be set below 795 (with a caption) or 735 (without a caption)
-->
roomProps.height = '640'
<!-- Note: height cannot be set below 640 (with a caption) or 580 (without a
caption). -->
<!-- If you want smaller rooms, contact ooVoo to turn off ads and thereby allow
smaller rooms -->
roomProps.backgroundColor = '#666666';
roomProps.captionText = 'Enter your caption here';
roomProps.captionColor = '#FFFFFF';
var myRoom=CreateRoom();
</script>
<!--End ooVoo room code-->
Properties
The following table lists the available properties that are sent to the 'CreateRoom'
function. They are available only for the room's creation. Once the room is created,
these properties cannot be changed.
|
Name
|
Description
|
|
roomProps.roomID
|
The unique identifier of the room in ooVoo. This property is unique to every developer
or ooVoo user. All of his or her rooms will have the same roomID associated with
the ooVoo ID. You can get your room ID here:
https://secure.oovoo.com/oovooRooms/GenerateCode.aspx
|
|
roomProps.width
|
The width of the video room. It includes the video window and also the extra space
for the background. Minimum width is 795px with ads turned on.
|
|
roomProps.height
|
The height of the video room. It includes the video window and also the extra space
for the background. Minimum height is 640px with ads turned on.
|
|
roomProps.backgroundColor
|
The background color of the room element. This is not the background of the video
window which uses the standard ooVoo black background. The value is in standard
HTML color format. Example: "#ffffff".
|
|
roomProps.captionColor
|
The color of the room's caption. The value is in standard HTML color format. Example:
"#ffffff".
|
|
roomProps.captionText
|
The text that will appear above the video window.
|
|
roomProps.hasBackground
|
Determines if the video room element also contains a background around the video
window or only a video window without a background. Can be "true" (default) or "false".
If CaptionText is defined it will override hasBackground, so to turn off the background
you must not include captionText in your room code.
|
|
roomProps.instanceKey
|
Identifies the instance that will be used. If it's not set, the default instance
is used.
Remarks: This property is available to developers only (ooVoo users that registered
as developers and have a developer profile associated).
instanceKey controls which people on your web site are in the same room or different
rooms. If you send two people to the same room with the same RoomID and same instanceKey,
they will see each other. If you want them to go into different rooms, send them
to different instance keys. Typical instance keys are a user's email address, a
room's discussion topic, a date stamp, or a classroom title. You can use any text
string as the instance key.
|
|
roomProps.displayName
|
The display name of the user that entered the room. If this is not set then a default
page will be displayed to enter the display name.
|
|
roomProps.language
|
2 character language code for the texts that are included in the room. For version
2.0 the following values are supported:
English - "en"
Spanish - "es"
Arabic - "ar"
Russian - "ru"
Chinese (Simplified) - "zh"
Hebrew - "he"
By default, the language of the browser is detected and used. The default language
for languages that are not in this list is English.
|
|
roomProps.controlVisible
|
Are the speaker, mic, end call buttons visible or hidden (true/false)
|
|
roomProps.yearOfBirth
|
The year of birth of the person that has entered the room. This will help make advertising
more relevant.
|
|
roomProps.gender
|
The gender of the person that has entered the room. This will help make advertising
more relevant.
|
|
roomProps.useActiveXorApplet
|
Lets the developer control if s/he wants to use a Java Applet, Active X, or let
ooVoo decide based on the browser's capabilities. Possible values:
Active X ="activex"
Java Applet = "applet"
Automatically decide ="auto"
If not set then the default = "auto".
|
|
roomProps.background
|
Control the video arena background color
Room property that can be set before the call initiated.
Value - hex
Example: roomProps.background = '#666666';
If property not set correctly use the default black background.
|
Video window control functions
Once the room is created, several functions are available to control the room's
behavior. The functions are accessed using the room object that is returned from
the "CreateRoom" function. For example:
<!--Start ooVoo room code-->
<script type="text/javascript" src="http://videocallroom.oovoo.com/oovoomelink/codelib/oovoorooms.js"></script>
<script src='http://java.com/js/deployJava.js'>
</script> <script type='text/javascript'>
...
var myRoom=CreateRoom();
</script>
<!--End ooVoo room code-->
...
myRoom.endCall();
|
Prototype
|
Description
|
|
endCall()
|
Ends the current call. The "End Call" page will be displayed and the "EndOfCall"
event will raise.
|
|
muteMic(bool mute)
|
Mutes or un-mutes the microphone.
|
|
muteCamera(bool mute)
|
Turns the camera on or off (mutes).
|
|
muteSpeakers(bool mute)
|
Mutes or un-mutes the speakers.
|
|
setSpeakersVolume(int vol)
|
Sets the speaker volume to a specified level (0-100).
|
|
setMicVolume(int vol)
|
Sets the microphone volume to a specified level (0-100).
|
|
enableMic (bool enable)
|
Enables or disables the microphone button and microphone volume bar.
|
|
enableSpeakers (bool enable)
|
Enables or disables the speaker button and speaker volume bar.
|
|
enableCamera (bool enable)
|
Enables or disables the camera button.
|
|
enableEndCallButton(bool enable)
|
Enables or disables the end call button.
|
|
getRoomName()
|
Returns the room name as defined in the 'settings'.
|
|
minimizeVideoWindow(string id)
|
Minimizes the video window for the specified participant.
|
|
restoreVideoWindow(string id)
|
Restores the video window for the specified participant.
|
|
transfer(string new-room-id,
string new-instance-id)
|
Transfer, disconnect from video server and reconnect to different
room:instance without re-starting Java, re-querying Display name,
or re-loading the applet/activeX.
|
Events
Events are set before the room is created, together with other room properties.
A JavaScript function name is given to be called when the event is raised. For example:
<!--Start ooVoo room code-->
<script type="text/javascript" src="http://videocallroom.oovoo.com/oovoomelink/codelib/oovoorooms.js"></script>
<script src='http://java.com/js/deployJava.js'></script>
<script type='text/javascript'>
var myRoom=CreateRoom();
rcp.roomID = "f2e89750-78c6-11dd-ad8b-0800200c9a66";
rcp.width = "400 px";
rcp.height = "400 px";
rcp.backgroundColor = "#00ffff";
rcp.captionColor = "#00ffff";
rcp.caption = "My Room";
rcp.EndOfCall="myRoom_EndOfCall";
var myRoom=CreateRoom();
</script>
<!--End ooVoo room code-->
<script type="text/javascript">
function myRoom_EndOfCall(duration)
{
alert("Call Ended!");
}
</script>
|
Event Name
|
Description
|
|
EndOfCall(int duration)
|
Fired when the call is ended and receives the call duration as an argument.
|
|
onParticipantJoined(xml participantInfo)
|
Fired when a participant of any type has joined the call and receives an XML with
information about the joined participant. XML format:
<?xml version="1.0" encoding="utf-8" ?>
<user id="applet:{39c2c4e1-f4a4-434e-834e-aa8e2bea44d6}:ggg@oovoo.com" displayName="Amit
Tsafrir"/>
XML attributes:
Id = unique identifier for the user that entered the call
displayName = the display name of the user that entered the call. The name should
be "XML encode" to support characters like "<".
|
|
onParticipantLeft(string id)
|
Fired when a participant has left the call and receives the unique identifier of
the participant that left.
|
Room video calls web service
The Room info web service will return information about the calls that are currently
active for all instances of the room. The information will include the participant
list of the users that are currently in the call. It will be server-side only and
will be restricted to 1-5 IP addresses.
|
REST URL
|
Description
|
|
http://webvideocall.oovoo.com/rooms/<roomID>/videocalls
|
Returns a list of all video calls that are currently active for all instances of
the room (XML). The information is updated from every audio/video server every 30
seconds (not in real-time).
|
Example
Request:
http://webvideocall.oovoo.com/rooms/f2e89750-78c6-11dd-ad8b-0800200c9a66/videocalls/
Response:
<?xml version="1.0" encoding="utf-8" ?>
<videoCalls roomID="f2e89750-78c6-11dd-ad8b-0800200c9a66">
<videoCall instanceKey="MyInstanceKey1">
<user id="applet:{39c2c4e1-f4a4-434e-834e-aa8e2bea44d6}:ggg@oovoo.com" name="name"
></user>
<user id="applet{8F02F17A-0F8D-4eee-AFAB-BE18A3828316}:eee@oovoo.com" name="name"
></user>
</videoCall>
<videoCall instanceKey="MyInstanceKay2">
<user id="applet{CCE51BA5-AB44-41fb-A173-9BF6B3DA57EE}:ggg@oovoo.com" name="name"
</user>
<user id="applet {E915F91E-8A64-4b3f-8409-B0F63F5F4B55}:ggg@oovoo.com " name="name"
</user>
</videoCall>
</videoCalls> {
alert("Call Ended!");
}
</script>