Reference of VideoChannel

Description of VideoChannel

PTTClient PTTChannel Group

VideoChannel Class

nametypeattributesdescription
channelIDintreadonlyChannel ID
channelNamestringreadonlyChannel name
channelDescriptionstringreadonlyChannel description
channelTypeintreadonlyChannel type (1:Announcer, 2:Player)
encryptedbooleanreadonlyIs a encrypted channel
ownerIDstringreadonlyChannel Owner ID
ownerNamestringreadonlyChannel Owner Name
mediaProfileIDintreadonlyMedia Profile ID
videoBitrateintreadonlyVideo announce bitrate (kbps)
videoFPSintreadonlyVideo announce FPS (count)
videoKeyFramerateintreadonlyVideo announce key frame interval (sec)
videoQualityint0:Highest 1: High 2 : Medium 3 : Low 4 : Custom
foregroundboolean Channel's focus status
enablePlayVideoboolean Video Play Status
useSoftwareDecoderboolean use Software Decoder(default no)
orientationint Video's rotation, 0, 90, 180, 270
Methods
Events

Methods

createChannel

int createChannel(string ChannelAttributesJson)
ChannelAttributesJsonVideoChannelAttributesJson
ReturnRequest Sequence ID. If less then 0, ErrorCode.
Expected EventsonVideoChannelCreated()
DescriptionCreate a PTT channel
Android SDK2.1.1
iOS SDK2.1.1
Windows SDK2.1.1
Linux SDKNot supported yet
< VideoChannelAttributesJson >
fieldtypeDescriptionDefaultCRUD
ChannelNamestringURLEncode(Channel name)MMO
DescriptionstringURLEncode(Description)OOO
IsOwnerbooleanChannel’s ownerO

startPreview

int startPreview()
Return0:Call Success, 0<ErrorCode
Expected EventsonVideoChannelPrivewStarted()
DescriptionStart video preview
Android SDK2.1.1
iOS SDK2.1.1
Windows SDK2.1.1
Linux SDKNot supported yet

stopPreview

int stopPreview()
Return0:Call Success, 0<ErrorCode
Expected EventsonVideoChannelPreviewStopped()
DescriptionStop video preview
Android SDK2.1.1
iOS SDK2.1.1
Windows SDK2.1.1
Linux SDKNot supported yet

startStream

int startStream()
Return0:Call Success, 0<ErrorCode
Expected EventsonVideoChannelStreamStarted()
DescriptionStart video stream
Android SDK2.1.1
iOS SDK2.1.1
Windows SDK2.1.1
Linux SDKNot supported yet

stopStream

int stopStream()
Return0:Call Success, 0<ErrorCode
Expected EventsonVideoChannelStreamStopped()
DescriptionStop video stream
Android SDK2.1.1
iOS SDK2.1.1
Windows SDK2.1.1
Linux SDKNot supported yet

setCamera

int setCamera(string CameraName)
CameraNameCamera Name to be used
Return0:Success, 0<ErrorCode
Expected Events
DescriptionUse camera. default rear camera
Android SDK2.1.1
iOS SDK2.1.1
Windows SDK2.1.1
Linux SDKNot supported yet
Sample(Android)
private boolean isCameraFront = false;
cameraList = client.getCameraList();
list = cameraList.split(","); 
if(list.length == 1) {
    videoChannel.setCamera(list[0]);
} else if(list.length > 0) {
    if (!isCameraFront) {
          videoChannel.setCamera(list[0]);
    } else {
          videoChannel.setCamera(list[1]);
    }
}

setCustomVideoQuality

int setCustomVideoQuality(int Width, int Height, int Bitrate, int FPS, int KeyFrameRate)
int setCustomVideoQuality(int Width, int Height, int Bitrate, int FPS, int KeyFrameRate, int KeyColorFormat)
WidthVideo width
Height Video height
Bitrate Video bitrate(kbps)
FPS Video FPS
KeyFrameRateVideo key frame interval(sec)
KeyColorFormatVideo keyColorFormat
Return0:Call Success, 0<ErrorCode
Expected Events
Descriptionset video custom configuration
Android SDK2.1.1
iOS SDK2.1.1
Windows SDK2.1.1
Linux SDKNot supported yet

setCameraPreview

int setCameraPreview(View Preview)
PreviewCamera Preview
ios : UIView*
android : SurfaceView
window : HWND(C++),IntPtr(C#)
Return0:Call Success, 0<ErrorCode
Android SDK2.1.1
iOS SDK2.1.1
Windows SDK2.1.1
Linux SDKNot supported yet
Sample(Android)
In Layout,
<SurfaceView 
  android:id="@+id/surface_preview_share_video"
  android:layout_width="match_parent"
  android:layout_height="match_parent"
/>

In Code,
SurfaceView surfacePreview = 
	(SurfaceView) findViewById(R.id.surface_preview_share_video); 
videoChannel.setCameraPreview(surfacePreview);
videoChannel.startPreview();
Sample(C#)
var wih = new WindowInteropHelper(window);
IntPtr hWnd = wih.Handle;
channel.SetCameraPreview(hWnd);

setPlayView

int setPlayView(View PlayView)
PlayViewVideo PlayView
ios : UIView*
android : com.imptt.propttsdk.media.view.VideoView
window : HWND(C++),IntPtr(C#)
Return0:Call Success, 0<ErrorCode
Android SDK2.1.1
iOS SDK2.1.1
Windows SDK2.1.1
Linux SDKNot supported yet
Sample(Android)
In Layout,
<com.imptt.propttsdk.media.view.VideoView
	android:id="@+id/surface_play_share_video"
	android:layout_width="match_parent"
	android:layout_height="match_parent"
/>

In Code,
VideoView shareVideoPlayView = 
	(VideoView) findViewById(R.id.surface_play_share_video); 
videoChannel.setPlayView(shareVideoPlayView); 
Sample(C#)
var wih = new WindowInteropHelper(window);
IntPtr hWnd = wih.Handle;
channel.SetPlayView(hWnd);

setCameraZoom

int setCameraZoom(int Level)
Levelzoom level ( 0 ~ 4 )
Return0:Call Success, 0<ErrorCode
Android SDK2.1.1
iOS SDK2.1.1
Windows SDKNot supported
Linux SDKNot supported yet

setVideoShareManager

int setVideoShareManager(IVideoShareManager VideoShareManager)
VideoShareManagerVideoShareManager instance
Return0:Call Success, 0<ErrorCode
Android SDK2.1.1
iOS SDKNot supported
Windows SDK2.1.1
Linux SDKNot supported yet

Events

onVideoChannelError

void onVideoChannelError(VideoChannel ChannelInstance, int ErrorCode, string ErrorMesssage)
ChannelInstanceVideoChannel instance of event
ErrorCodeError code. see Main 6
ErrorMesssageError message
DescriptionErrer event
Android SDK2.1.1
iOS SDK2.1.1
Windows SDK2.1.1
Linux SDKNot supported yet

onVideoChannelResult

void onVideoChannelResult(VideoChannel ChannelInstance, int Seq, int ResultCode, string ResultMesssage)
ChannelInstanceVideoChannel instance of event
SeqRequested Sequence ID
ResultCodeError code. see Main 7
ResultMesssageError message
DescriptionResult event for request
Android SDK2.1.1
iOS SDK2.1.1
Windows SDK2.1.1
Linux SDKNot supported yet

onVideoChannelCreated

void onVideoChannelCreated(VideoChannel ChannelInstance, int ChannelID)
ChannelInstanceVideoChannel instance of event
ChannelID Created VideoChannel's ID
DescriptionVideo Channel is created
Android SDK2.1.1
iOS SDK2.1.1
Windows SDK2.1.1
Linux SDKNot supported yet

onVideoChannelDeleted

void onVideoChannelDeleted(VideoChannel ChannelInstance)
ChannelInstanceVideoChannel instance of event
DescriptionVideo Channel is deleted
Android SDK2.1.1
iOS SDK2.1.1
Windows SDK2.1.1
Linux SDKNot supported yet

onVideoChannelJoined

void onVideoChannelJoined(VideoChannel ChannelInstance, string Member, int MemberType, int TotalUserCount)
ChannelInstanceVideoChannel instance of event
Member Joined Member's Information
MemberType0: MemberID, 1: MemberJson
TotalUserCountTotal user count in channel
DescriptionUser is joined into a Video channel.
Android SDK2.1.1
iOS SDK2.1.1
Windows SDK2.1.1
Linux SDKNot supported yet

onVideoChannelLeaved

void onVideoChannelLeaved(VideoChannel ChannelInstance, string MemberID, int TotalUserCount)
ChannelInstanceVideoChannel instance of event
MemberIDLeaved Member's ID
TotalUserCountTotal user count in channel
DescriptionUser is leaved from a Video channel.
Android SDK2.1.1
iOS SDK2.1.1
Windows SDK2.1.1
Linux SDKNot supported yet

onVideoChannelPreviewStarted

void onVideoChannelPreviewStarted(VideoChannel ChannelInstance)
ChannelInstanceVideoChannel instance of event
DescriptionVideo preview is started.
Android SDK2.1.1
iOS SDK2.1.1
Windows SDK2.1.1
Linux SDKNot supported yet

onVideoChannelPreviewStopped

void onVideoChannelPreviewStopped(VideoChannel ChannelInstance)
ChannelInstanceVideoChannel instance of event
DescriptionVideo preview is stopped.
Android SDK2.1.1
iOS SDK2.1.1
Windows SDK2.1.1
Linux SDKNot supported yet

onVideoChannelStreamStarted

void onVideoChannelStreamStarted(VideoChannel ChannelInstance)
ChannelInstanceVideoChannel instance of event
DescriptionVideo stream is started.
Android SDK2.1.1
iOS SDK2.1.1
Windows SDK2.1.1
Linux SDKNot supported yet

onVideoChannelStreamStopped

void onVideoChannelStreamStopped(VideoChannel ChannelInstance)
ChannelInstanceVideoChannel instance of event
DescriptionVideo stream is stopped.
Android SDK2.1.1
iOS SDK2.1.1
Windows SDK2.1.1
Linux SDKNot supported yet

onVideoChannelTrackDataCaptured

void onVideoChannelTrackDataCaptured(VideoChannel ChannelInstance, int TrackType, byte[] TrackDataBuffer, int DataLength, unsigned int Timestamp)
ChannelInstanceVideoChannel instance of event
TrackType0:Audio, 1:Video, 1>Others
TrackDataBufferBuffer of data.
Video: no event
Audio: no event
DataLengthData size
TimestampTimestamp of data
DescriptionTrack data is captured from device.
Android SDK2.1.1, This event would be not fired.
iOS SDK2.1.1, This event would be not fired.
Windows SDK2.1.1, This event would be not fired.
Linux SDKNot supported yet

onVideoChannelTrackDataEncoded

void onVideoChannelTrackDataEncoded(VideoChannel ChannelInstance, int TrackType, byte[] TrackDataBuffer, int DataLength, unsigned int Timestamp, int FrameType)
ChannelInstanceVideoChannel instance of event
TrackType0:Audio, 1:Video, 1<Others
TrackDataBufferBuffer of data.
Video: H.264, 1 frame
Audio: There is no event.
DataLengthData size
TimestampTimestamp of data
FrameType0: Info, 1: Media-Key frame, 2: Media
DescriptionTrack data is encoded by encoder.
Android SDK2.1.1
iOS SDK2.1.1
Windows SDK2.1.1
Linux SDKNot supported yet

onVideoChannelTrackDataReceived

void onVideoChannelTrackDataReceived(VideoChannel ChannelInstance, int TrackType, byte[] TrackDataBuffer, int DataLength, unsigned int Timestamp, int FrameType)
ChannelInstanceVideoChannel instance of event
TrackType0:Audio, 1:Video, 1>Others
TrackDataBufferBuffer of data.
Video: H.264, 1 frame
Audio: There is no event.
DataLengthData size
TimestampTimestamp of data
FrameType0: Info, 1: Media-Key frame, 2: Media
DescriptionTrack data is received from server.
Android SDK2.1.1
iOS SDK2.1.1
Windows SDK2.1.1
Linux SDKNot supported yet

onVideoChannelTrackDataRendered

void onVideoChannelTrackDataRendered(VideoChannel ChannelInstance, int TrackType, byte[] TrackDataBuffer, int DataLength, unsigned int Timestamp)
ChannelInstanceVideoChannel instance of event
TrackType0:Audio, 1:Video, 1>Others
TrackDataBufferBuffer of data.
DataLengthData size
FrameType0: Info, 1: Media-Key frame, 2: Media
TimestampTimestamp of data
DescriptionTrack data is rendered to device.
Android SDK2.1.1, This event would be not fired.
iOS SDK2.1.1, This event would be not fired.
Windows SDK2.1.1, This event would be not fired.
Linux SDKNot supported yet