com.skype.api
Class Video

java.lang.Object
  extended by com.skype.api.SkypeObject
      extended by com.skype.api.Video

public class Video
extends SkypeObject

This class contains basic video control functionality for live conversations with video. Basically, Video objects represent specific Participant's video state in a live Conversation. The Video class can represent both local (outgoing) and remote (incoming) video streams. Note that as of SkypeKit SDK version 3.2, this class no longer handles video rendering in the UI. Currently available SkypeKit runtimes do not support multi-party video. The API however is designed with future compatibility in mind, so the Video class is attached to Participant class rather than Conversation class. Once multi-party video will become available for SkypeKit, the logic should go like this:

Let there be 4-way live conversation C and participants P1, P2, P3 and P4. P1 is the local user. Remote participants P2 and P3 are capable of sending video. Remote user P4 is not capable of sending video. You would then end up with 4 video objects: V1, V2, V3 and V0.

- C->P1->V1-> outgoing video stream
- C->P2->V2-> incoming video stream 1
- C->P3->V3-> incoming video stream 2
- C->P4-> no video object as participant P4 does not advertise supporting video
- V0-> local webcam preview - this is not attached to any particular conversation, however the corresponding video object can be retrieved with Skype.GetPreviewVideo method.

As getting from a live conversation to running video streams involves three classes, it can be somewhat less than obvious. The basic state transition logic goes like this:

You start out with a Conversation, that suddenly becomes live

CONVERSATION.LOCAL_LIVESTATUS = IM_LIVE
At this point you have access to participant list of that conversation. The next step will be to catch Partcipant property changes for PARTICIPANT.VIDEO_STATUS to see if any of the people in conversation have Video available. Note that you should not make assumptions on when this availability happens. Remote users may switch their video on-off as they please.

PARTICIPANT.VIDEO_STATUS = VIDEO_AVAILABLE
If you get to VIDEO_AVAILABLE (not necessarily for all Participants), you can retrieve Video object, with Participant.GetVideo method.

Now you will need to handle Video.STATUS property changes. In case of successful video call, the sequence of Video.STATUS and Participant.VIDEO_STATUS changes for each Participant and Video object should look like this:

- Video.STATUS = AVAILABLE
- Video.STATUS = STARTING
- Video.STATUS = CHECKING_SUBSCRIPTION
- Video.STATUS = STARTING

Participant.VIDEO_STATUS = VIDEO_CONNECTING
- Video.STATUS = RUNNING
- Participant.VIDEO_STATUS = STREAMING
Both Video.STATUS == RUNNING and Participant.VIDEO_STATUS == STREAMING are indicative that the video for that particular participant is up and running, and your UI should update itself accordingly.

NB! Note that it is not enough to check for Video.STATUS property updates. By the time you obtain the Video object in your client, it may already it may already have progressed to a further status. You should always check the status property immediately after obtaining the Video object.


Nested Class Summary
 class Video.GetCurrentVideoDeviceResult
           
static class Video.MEDIATYPE
           
static class Video.PROPERTY
          Properties of the Video class
static class Video.STATUS
           
 class Video.SubmitCaptureRequestResult
           
static class Video.VIDEO_DEVICE_CAPABILITY
           
static interface Video.VideoListener
           
 
Field Summary
static java.lang.String VIDEO_ADVERTPOLICY
          Setupkey SETUPKEY_VIDEO_ADVERTPOLICY type:string default value:"contacts"
noone | contacts | everyone
This is account-specific setup key.
static java.lang.String VIDEO_AUTOSEND
          Setupkey SETUPKEY_VIDEO_AUTOSEND type:int
Setting this to 1 starts sending video automatically when call starts
This is account-specific setup key.
static java.lang.String VIDEO_DEVICE
          Setupkey SETUPKEY_VIDEO_DEVICE type:string
Selected video device name
This is account-specific setup key.
static java.lang.String VIDEO_DEVICE_PATH
          Setupkey SETUPKEY_VIDEO_DEVICE_PATH type:string
Currently selected video device path.
static java.lang.String VIDEO_DISABLE
          Setupkey SETUPKEY_VIDEO_DISABLE type:int
Setting this to 1 disables all video functionality.
static java.lang.String VIDEO_RECVPOLICY
          Setupkey SETUPKEY_VIDEO_RECVPOLICY type:string default value:"contacts"
noone | contacts | callpolicy
This is account-specific setup key.
 
Fields inherited from class com.skype.api.SkypeObject
mObjectId, mPropCache, skype
 
Constructor Summary
Video(int oid, Skype skype)
           
 
Method Summary
 byte[] GetBinProperty(Video.PROPERTY prop)
           
 boolean GetBooleanProperty(Video.PROPERTY prop)
           
 Video.GetCurrentVideoDeviceResult GetCurrentVideoDevice()
           
 int GetIntProperty(Video.PROPERTY prop)
           
 java.lang.Object GetPropertyAsEnum(int propid)
           
 java.lang.String GetStrProperty(Video.PROPERTY prop)
           
static int moduleID()
           
 void SelectVideoSource(Video.MEDIATYPE mediaType, java.lang.String webcamName, java.lang.String devicePath, boolean updateSetup)
          This method has no effect in current version.
 void SetRenderRectangle(int x0, int y0, int width, int height)
           
 void SetScreen(int windowh)
           
 void SetScreenCaptureRectangle(int x0, int y0, int width, int height, int monitorNumber, int windowHandle)
          This method has no known effect in current version.
 void Start()
          This method starts either video send or video receive, depending on whether the video object is sender or receiver.
 void Stop()
          This method stops either video send or video receive, depending on whether the video object is sender or receiver.
 Video.SubmitCaptureRequestResult SubmitCaptureRequest()
           
 
Methods inherited from class com.skype.api.SkypeObject
close, getOid
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

VIDEO_DEVICE

public static final java.lang.String VIDEO_DEVICE
Setupkey SETUPKEY_VIDEO_DEVICE type:string
Selected video device name
This is account-specific setup key. It can only be used while an account is logged in.

See Also:
Constant Field Values

VIDEO_DEVICE_PATH

public static final java.lang.String VIDEO_DEVICE_PATH
Setupkey SETUPKEY_VIDEO_DEVICE_PATH type:string
Currently selected video device path.
This is account-specific setup key. It can only be used while an account is logged in.

See Also:
Constant Field Values

VIDEO_AUTOSEND

public static final java.lang.String VIDEO_AUTOSEND
Setupkey SETUPKEY_VIDEO_AUTOSEND type:int
Setting this to 1 starts sending video automatically when call starts
This is account-specific setup key. It can only be used while an account is logged in.

See Also:
Constant Field Values

VIDEO_DISABLE

public static final java.lang.String VIDEO_DISABLE
Setupkey SETUPKEY_VIDEO_DISABLE type:int
Setting this to 1 disables all video functionality.
This setup key is machine-specific and affects all local accounts.

See Also:
Constant Field Values

VIDEO_RECVPOLICY

public static final java.lang.String VIDEO_RECVPOLICY
Setupkey SETUPKEY_VIDEO_RECVPOLICY type:string default value:"contacts"
noone | contacts | callpolicy
This is account-specific setup key. It can only be used while an account is logged in.

See Also:
Constant Field Values

VIDEO_ADVERTPOLICY

public static final java.lang.String VIDEO_ADVERTPOLICY
Setupkey SETUPKEY_VIDEO_ADVERTPOLICY type:string default value:"contacts"
noone | contacts | everyone
This is account-specific setup key. It can only be used while an account is logged in.

See Also:
Constant Field Values
Constructor Detail

Video

public Video(int oid,
             Skype skype)
Method Detail

moduleID

public static final int moduleID()

GetPropertyAsEnum

public java.lang.Object GetPropertyAsEnum(int propid)
Specified by:
GetPropertyAsEnum in class SkypeObject

GetStrProperty

public java.lang.String GetStrProperty(Video.PROPERTY prop)

GetIntProperty

public int GetIntProperty(Video.PROPERTY prop)

GetBooleanProperty

public boolean GetBooleanProperty(Video.PROPERTY prop)

GetBinProperty

public byte[] GetBinProperty(Video.PROPERTY prop)

SetScreen

public void SetScreen(int windowh)
Parameters:
windowh -

Start

public void Start()
This method starts either video send or video receive, depending on whether the video object is sender or receiver. In case of desktop video, the receiver side needs to instantiate a renderer object and associate it with the receiveing video (Video.SetRemoteRendererId).


Stop

public void Stop()
This method stops either video send or video receive, depending on whether the video object is sender or receiver. In case of desktop video, the receiver side needs to dis-associate the video object from the renderer, by calling Video.SetRemoteRendererId(0).


SubmitCaptureRequest

public Video.SubmitCaptureRequestResult SubmitCaptureRequest()
Returns:
SubmitCaptureRequestResult

SetScreenCaptureRectangle

public void SetScreenCaptureRectangle(int x0,
                                      int y0,
                                      int width,
                                      int height,
                                      int monitorNumber,
                                      int windowHandle)
This method has no known effect in current version.

Parameters:
x0 -
y0 -
width -
height -
monitorNumber -
windowHandle -

SetRenderRectangle

public void SetRenderRectangle(int x0,
                               int y0,
                               int width,
                               int height)
Parameters:
x0 -
y0 -
width -
height -

SelectVideoSource

public void SelectVideoSource(Video.MEDIATYPE mediaType,
                              java.lang.String webcamName,
                              java.lang.String devicePath,
                              boolean updateSetup)
This method has no effect in current version.

Parameters:
mediaType -
webcamName -
devicePath -
updateSetup -

GetCurrentVideoDevice

public Video.GetCurrentVideoDeviceResult GetCurrentVideoDevice()
Returns:
GetCurrentVideoDeviceResult


Copyright © 2010, 2011 Skype Technologies. All Rights Reserved.