Reference of VideoChannel

Description of VideoChannel

PTTClient PTTChannel Group

Properties

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 when locked by vox or bluetooth
VideoBitrateintreadonlyVideo announce bitrate (kbps)
VideoFPSintreadonlyVideo announce FPS (sec)
VideoKeyFramerateintreadonlyVideo announce key frame interval (sec)
VideoQualityint
Foregroundboolean Channel's focus status
EnablePlayVideoboolean Video Play Status

Methods

CreateChannel

int CreateChannel(string ChannelAttributesJson)
ChannelAttributesJsonVideoChannelAttributesJson
ReturnRequest Sequence ID. If less then 0, ErrorCode.
Expected EventsOnVideoChannelCreated()
DescriptionCreate a PTT channel
SDK version1.1.1
< 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
SDK version1.1.1

StopPreview

int StopPreview()
Return0:Call Success, 0<ErrorCode
Expected EventsOnVideoChannelPreviewStopped()
DescriptionStop video preview
SDK version1.1.1

StartStream

int StartStream()
Return0:Call Success, 0<ErrorCode
Expected EventsOnVideoChannelStreamStarted()
DescriptionStart video stream
SDK version1.1.1

StopStream

int StopStream()
Return0:Call Success, 0<ErrorCode
Expected EventsOnVideoChannelStreamStopped()
DescriptionStop video stream
SDK version1.1.1

SetCamera

int SetCamera(string CameraName)
CameraNameCamera Name to be used
Return0:Success, 0<ErrorCode
Expected Events
DescriptionUse camera. default face camera
SDK version1.1.1

SetCustomVideoQuality

int SetCustomVideo(int Width, int Height, int Bitrate, int FPS, int KeyFrameRate)
Return0:Call Success, 0<ErrorCode
WidthVideo width
Height Video height
Bitrate Video bitrate(kbps)
FPS Video FPS
KeyFrameRateVideo key frame interval(sec)
Expected Events
Descriptionvideo custom configuration
SDK version1.1.1

SetCameraPreview

int SetCameraPreview(View preview)
Return0:Call Success, 0<ErrorCode
previewCamera Preview
ios : UIView*
android : SurfaceView
window : HWND(C++),IntPtr(C#)
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);
SDK version1.1.1

SetPlayView

int SetPlayView(View playView)
Return0:Call Success, 0<ErrorCode
playViewVideo PlayView
ios : UIView*
android : com.imptt.propttsdk.media.view.VideoView

PGLSurfaceView is removed at 1.2.0.


window : HWND(C++),IntPtr(C#)
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);
SDK version1.1.1

SetCameraZoom

int SetCameraZoom(int level)
Return0:Call Success, 0<ErrorCode
levelzoom level ( 0 ~ 4 )
SDK version1.1.1

SetCameraFlash

int SetCameraFlash(bool on)
Return0:Call Success, 0<ErrorCode
onon / off
SDK version1.1.1

Events

OnVideoChannelError

OnVideoChannelError(VideoChannel ChannelInstance, int ErrorCode, string ErrorMesssage)
ChannelInstanceVideoChannel instance of event
ErrorCodeError code. see Main 6
ErrorMesssageError message
DescriptionErrer event
SDK version1.1.1

OnVideoChannelResult

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
SDK version1.1.1

OnVideoChannelCreated

OnVideoChannelCreated(VideoChannel ChannelInstance, int ChannelID)
ChannelInstanceVideoChannel instance of event
ChannelID Created VideoChannel's ID
DescriptionVideo Channel is created
SDK version1.1.1

OnVideoChannelDeleted

OnVideoChannelDeleted(VideoChannel ChannelInstance)
ChannelInstanceVideoChannel instance of event
DescriptionVideo Channel is deleted
SDK version1.1.1

OnVideoChannelJoined

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.
SDK version1.1.1

OnVideoChannelLeaved

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.
SDK version1.1.1

OnVideoChannelPreviewStarted

OnVideoChannelPreviewStarted(VideoChannel ChannelInstance)
ChannelInstanceVideoChannel instance of event
DescriptionVideo preview is started.
SDK version1.1.1

OnVideoChannelPreviewStopped

OnVideoChannelPreviewStopped(VideoChannel ChannelInstance)
ChannelInstanceVideoChannel instance of event
DescriptionVideo preview is stopped.
SDK version1.1.1

OnVideoChannelStreamStarted

OnVideoChannelStreamStarted(VideoChannel ChannelInstance)
ChannelInstanceVideoChannel instance of event
DescriptionVideo stream is started.
SDK version1.1.1

OnVideoChannelStreamStopped

OnVideoChannelStreamStopped(VideoChannel ChannelInstance)
ChannelInstanceVideoChannel instance of event
DescriptionVideo stream is stopped.
SDK version1.1.1

OnVideoChannelTrackDataCaptured

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.
SDK version1.1.1

OnVideoChannelTrackDataEncoded

OnVideoChannelTrackDataEncoded(VideoChannel ChannelInstance, int TrackType, byte[] TrackDataBuffer, int DataLength, unsigned int Timestamp, int FrameType)
ChannelInstanceVideoChannel instance of event
TrackType0:Audio, 1:Video, 1
TrackDataBufferBuffer of data.
Video: H.264, 1 frame
Audio: no event
DataLengthData size
TimestampTimestamp of data
FrameType0: Info, 1: Media-Key frame, 2: Media
DescriptionTrack data is encoded by encoder.
SDK version1.1.1

OnVideoChannelTrackDataReceived

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.
SDK version1.1.1

OnVideoChannelTrackDataRendered

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.
Video: no event
Audio: no event
DataLengthData size
FrameType0: Info, 1: Media-Key frame, 2: Media
TimestampTimestamp of data
DescriptionTrack data is rendered to device.
SDK version1.1.1, This event would be not fired.