Reference of PTTChannel

Description of PTTChannel

PTTClient Group VideoChannel

Properties

nametypeattributesdescription
ChannelIDintreadonlyChannel ID
ChannelNostringreadonlyChannel number
ChannelNamestringreadonlyChannel name
ChannelDescriptionstringreadonlyChannel description
ChannelNotificationstringreadonlyChannel notification
TOTintreadonlyTime Out Timer, second
RecordablebooleanreadonlyIs a recordable channel. Client app can save PTTs on device. An adminitsrator can select it on adminWeb.
EncryptedbooleanreadonlyIs a encrypted channel. PTT data is encrypted. An adminitsrator can select it on adminWeb.
OwnerIDstringreadonlyChannel Owner ID
OwnerNamestringreadonlyChannel Owner Name
FunctionstringreadonlyFunction Key names
StatusintreadonlyStatus joined the Channel
10: Invited, 20:request subscribe, 30: subscribed
TypestringreadonlyChannel Type
'S'ystem,'F'ree,'P'rivate,'C'ompany,'G'roup,'1':1
ForegroundbooleanChannel's focus status
UseVoxbooleanWhether to use vox for lock
UseBluetoothbooleanWhether to use bluetooth for lock
LockMediaProfileIDintMedia Profile ID when locked
Belows are defined as constant.

PROFILE_ID_OPUS8_ONLY : Audio PTT(Middle)
PROFILE_ID_OPUS16_ONLY : Audio PTT(High)
PROFILE_ID_OPUS8_MJPEG_LOW : Video PTT(Low)
PROFILE_ID_OPUS8_MJPEG_MID : Video PTT(Middle)
PROFILE_ID_OPUS8_MJPEG_HIGH : Video PTT(High)
PROFILE_ID_OPUS16_MJPEG_LOW : Video PTT(Low)
PROFILE_ID_OPUS16_MJPEG_MID : Video PTT(Middle)
PROFILE_ID_OPUS16_MJPEG_HIGH : Video PTT(High)
LockStatusint Status for PTT lock
0 : unlocked
1 : request unlock
2 : request lock
3 : locked by me
4 : locked by someone
JoinStatusint Status for channel join
0 : leaved
1 : joined
PlayAmplificationint -50~100, default 0
EnablePlayAudioboolean Audio play status
EnableSendAudioboolean Audio send status
EnablePlayVideoboolean Video play status
EnableSendVideoboolean Video send status

Methods

Delete

int Delete()
ReturnRequest Sequence ID. If less then 0, ErrorCode.
Expected EventsOnChannelDeleted
DescriptionDelete PTT channel
SDK version1.1.1

Update

int Update(string ChannelAttributesJson)
ReturnRequest Sequence ID. If less then 0, ErrorCode.
Expected EventsOnChannelUpdated
DescriptionUpdate PTT channel informations.
SDK version1.1.1

Join

int Join()
ReturnRequest Sequence ID. If less then 0, ErrorCode.
Expected EventsOnJoined()
DescriptionStart PTT channel
SDK version1.1.1

Leave

int Leave()
ReturnRequest Sequence ID. If less then 0, ErrorCode.
Expected EventsOnLeaved
DescriptionStop PTT channel
SDK version1.1.1

AcceptSubscribe

int AcceptSubscribe(string RequesterID, string RequesterName)
RequesterIDRequester's ID
RequesterNameRequester's Name
ReturnRequest Sequence ID. If less then 0, ErrorCode.
Expected Events
DescriptionAccept requester's subscription
SDK version1.1.1

DenySubscribe

int DenySubscribe(string RequesterID, string RequesterName)
RequesterIDRequester's ID
RequesterNameRequester's Name
ReturnRequest Sequence ID. If less then 0, ErrorCode.
Expected Events
DescriptionDeny requester's subscription
SDK version1.1.1

Unsubscribe

int Unsubscribe()
ReturnRequest Sequence ID. If less then 0, ErrorCode.
Expected Events
DescriptionUnsubscribe to channel
SDK version1.1.1

CancelSubscribe

int CancelSubscribe()
ReturnRequest Sequence ID. If less then 0, ErrorCode.
Expected Events
DescriptionRequest Cancel of subscribe to channel
SDK version1.1.1

Invite

int Invite(string ReceiverID)
ReceiverIDReceiver ID
ReturnRequest Sequence ID. If less then 0, ErrorCode.
Expected Events
DescriptionInvite Receiver
SDK version1.1.1

AcceptInvite

int AcceptInvite(string RequesterID)
ReceiverIDRequester's ID
ReturnRequest Sequence ID. If less then 0, ErrorCode.
Expected Events
DescriptionResponse of PTTClient's invitation
SDK version1.1.1

DenyInvite

int DenyInvite(string RequesterID)
ReceiverIDRequester's ID
ReturnRequest Sequence ID. If less then 0, ErrorCode.
Expected Events
DescriptionResponse of PTTClient's invitation
SDK version1.1.1

CancelInvite

int CancelInvite(string RequesterID)
RequesterIDRequester's ID
ReturnRequest Sequence ID. If less then 0, ErrorCode.
Expected Events
DescriptionRequest Cancel of invite
SDK version1.1.1

Lock

int Lock()
int Lock(boolean Emergency)
EmergencyIf other user have a lock, break the lock and make a new lock for user
ReturnRequest Sequence ID. If less then 0, ErrorCode.
Expected EventsOnLocked
DescriptionRequest Channel lock to server
SDK version1.1.1, Lock(boolean Emergency) is in 1.2.0

Unlock

int Unlock()
ReturnRequest Sequence ID. If less then 0, ErrorCode.
Expected EventsOnUnlocked
DescriptionRequest Channel unlock to server
SDK version1.1.1

SendPublicMessage

int SendPublicMessage(string Message)
MessageMax 200 characters
ReturnRequest Sequence ID. If less then 0, ErrorCode.
Expected Events
DescriptionSend a Message to all in same PTTChannel. Notice: Message's sequence is not guaranteed.
SDK version1.1.1

SendPrivateMessage

int SendPrivateMessage(string ReceiverID, string Message)
ReceiverIDReceiver ID
MessageMax 200 characters
ReturnRequest Sequence ID. If less then 0, ErrorCode.
Expected Events
DescriptionSend a Private Message to Receiver. Notice: Message's sequence is not guaranteed.
SDK version1.1.1

SendPublicCustomMessage

int SendPublicCustomMessage(byte[] DataBuffer, int DataLength)
DataBufferBuffer of data
DataLengthData size. Max size is 30KB.
ReturnRequest Sequence ID. If less then 0, ErrorCode.
Expected Events
DescriptionSend a CustomMessage to all. Notice: Message's sequence is not guaranteed.
Server version1.2.x~
SDK version1.1.1

SendPrivateCustomMessage

int SendPrivateCustomMessage(string ReceiverID, byte[] DataBuffer, int DataLength)
ReceiverIDReceiver ID
DataBufferBuffer of data
DataLengthData size. Max size is 30KB.
ReturnRequest Sequence ID. If less then 0, ErrorCode.
Expected Events
DescriptionSend a CustomMessage to Receiver. Notice: Message's sequence is not guaranteed.
Server version1.2.x~
SDK version1.1.1

CallFunction

int CallFunction(string FunctionName, string Parameter)
FunctionNameFunction's Name
ParameterFunction's Parameter
ReturnRequest Sequence ID. If less then 0, ErrorCode.
Expected EventsOnCallFunction
DescriptionCall channel's function
SDK version1.1.1

SetEnableSendAudio

int SetEnableSendAudio(boolean Enable)
EnableSend silent audio
Return
Expected Events
Description

This is removed at 1.2.0. Please use property EnableSendAudio.

Send silent audios to server.
SDK version1.1.1

SetEnablePlayVideo

int SetEnablePlayVideo(boolean Enable)
EnableStop or not
Return
Expected Events
Description

This is removed at 1.2.0. Please use property EnablePlayVideo.

No play videos. (But onTrackDataRendered deliver real video)
SDK version1.1.1

SetEnableSendVideo

int SetEnableSendVideo(boolean Enable)
EnableStop or not
Return
Expected Events
Description

This is removed at 1.2.0. Please use property EnableSendVideo.

Send no video to server.
SDK version1.1.1

ShareVideo

int ShareVideo(int VideoChannelID)
VideoChannelIDShared VideoChannel's ID
ReturnRequest Sequence ID. If less then 0, ErrorCode.
Expected EventsOnVideoShared
DescriptionShare video with members
SDK version1.1.1

UnshareVideo

int UnshareVideo(int VideoChannelID)
VideoChannelIDUnshared VideoChannel's ID
ReturnRequest Sequence ID. If less then 0, ErrorCode.
Expected EventsOnVideoUnshared
DescriptionUnshare video with members
SDK version1.1.1

setCameraPreview

int setCameraPreview(View preview)
previewCamera Preview
ios : UIView*
android : SurfaceView
window : HWND(C++),IntPtr(C#)
Sample(Android)
In Layout,
<SurfaceView 
  android:id="@+id/surface_preview"
  android:layout_width="match_parent"
  android:layout_height="match_parent"
/>

In Code,
SurfaceView surfacePreview = 
	(SurfaceView) findViewById(R.id.surface_preview); 
channel.setCameraPreview(surfacePreview);
channel.startPreview();
Sample(C#)
var wih = new WindowInteropHelper(window);
IntPtr hWnd = wih.Handle;
channel.SetVideoWindow(hWnd);
SDK version1.1.1

setPlayView

int setPlayView(View playView)
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_video"
	android:layout_width="match_parent"
	android:layout_height="match_parent"
/>

In Code,
VideoView shareVideoPlayView = 
	(VideoView) findViewById(R.id.surface_play_video); 
channel.setPlayView(shareVideoPlayView); 
Sample(C#)
var wih = new WindowInteropHelper(window);
IntPtr hWnd = wih.Handle;
channel.SetVideoWindow(hWnd);
SDK version1.1.1

setAudioManager

void setAudioManager(IAudioManager audioManager)
audioManagerAudioManager instance
DescriptionCan use for external audio devices
Please refer to IAudioManager.
SDK version1.3.0

Events

OnPTTChannelError

OnPTTChannelError(PTTChannel ChannelInstance, int ErrorCode, string ErrorMesssage)
ChannelInstancePTTChannel instance of event
ErrorCodeError code. see Main 6
ErrorMesssageError message
DescriptionErrer event
SDK version1.1.1

OnPTTChannelResult

OnPTTChannelResult(PTTChannel ChannelInstance,int Seq, int ResultCode, string ResultMesssage)
ChannelInstancePTTChannel instance of event
SeqRequested Sequence ID
ResultCodeError code. see Main 7
ResultMesssageError message
DescriptionResult event for request
SDK version1.1.1

OnJoined

OnJoined(PTTChannel ChannelInstance, string MemberJson,int TotalUserCount)
OnJoined(PTTChannel ChannelInstance, string MemberID, string MemberName, int TotalUserCount)
ChannelInstanceChannel instance of event
MemberJsonJoined Member ID JsonArray
MemberIDJoined Member's ID
MemberNameJoined Member's Name for a guest
TotalUserCountTotal user count in channel
DescriptionUser is joined into a PTT channel.
SDK version1.1.1

OnLeaved

OnLeaved(PTTChannel ChannelInstance, string MemberID)
ChannelInstanceChannel instance of event
MemeberIDLeaved Member's ID
DescriptionUser is leaved from a PTT channel
SDK version1.1.1

OnNotifyReceived

OnNotifyReceived(PTTChannel ChannelInstance, int NotifiedCode, string NotifiedData)
ChannelInstancePTTChannel instance of event
NotifiedCodeNotified code
NotifiedDataNotified data
DescriptionNotified from server.
SDK version1.1.1

OnPublicMessageReceived

OnPublicMessageReceived(PTTChannel ChannelInstance, string SenderID, string SenderName, string Message)
ChannelInstancePTTChannel instance of event
SenderIDSender ID
SenderNameSender Name
MessageMessage
DescriptionA public message is received from sender
SDK version1.1.1

OnPrivateMessageReceived

OnPrivateMessageReceived(PTTChannel ChannelInstance, string SenderID, string SenderName, string Message)
ChannelInstancePTTChannel instance of event
SenderIDSender ID
SenderNameSender Name
MessageMessage
DescriptionA private message is received from sender.
SDK version1.1.1

OnLocked

OnLocked(PTTChannel ChannelInstance, string Location, unsigned int MediaProfileID, string LockerID, string LockerName)
ChannelInstanceChannel instance of event
LocationLocked user's location. If "", unknown
MediaProfileID
LockerIDLocker's ID
LockerNameLocker's Name for a guest
DescriptionChannel is locked by me or peer.
SDK version1.1.1

OnUnlocked

OnUnlocked(PTTChannel ChannelInstance, string LockerID)
ChannelInstanceChannel instance of event
LockerIDLocker's ID
DescriptionChannel is unlocked by me or peer.
SDK version1.1.1

OnTrackDataCaptured

OnTrackDataCaptured(PTTChannel ChannelInstance, int TrackType, byte[] TrackDataBuffer, int DataLength, unsigned int Timestamp)
ChannelInstancePTTChannel instance of event
TrackType0:Audio, 1:Video, 1>Others
TrackDataBufferBuffer of data.
Video: no event
Audio: RAW, 1 frame
DataLengthData size
TimestampTimestamp of data
DescriptionTrack data is captured from device.
SDK version1.1.1

OnTrackDataEncoded

OnTrackDataEncoded(PTTChannel ChannelInstance, int TrackType, byte[] TrackDataBuffer, int DataLength, unsigned int Timestamp)
ChannelInstancePTTChannel instance of event
TrackType0:Audio, 1:Video, 1>Others
TrackDataBufferBuffer of data.
Video: JPEG, 1 frame
Audio: OPUS, 1 frame
DataLengthData size
TimestampTimestamp of data
DescriptionTrack data is encoded by encoder.
SDK version1.1.1

OnTrackDataReceived

OnTrackDataReceived(PTTChannel ChannelInstance, int TrackType, byte[] TrackDataBuffer, int DataLength, unsigned int Timestamp)
ChannelInstancePTTChannel instance of event
TrackType0:Audio, 1:Video, 1>Others
TrackDataBufferBuffer of data.
Video: JPEG, 1 frame
Audio: OPUS, 1 frame
DataLengthData size
TimestampTimestamp of data
DescriptionTrack data is received from server. If you save the PTT, you can wite this frame into Opus or your defined file.
SDK version1.1.1

OnTrackDataRendered

OnTrackDataRendered(PTTChannel ChannelInstance, int TrackType, byte[] TrackDataBuffer, int DataLength, unsigned int Timestamp)
ChannelInstancePTTChannel instance of event
TrackType0:Audio, 1:Video, 1>Others
TrackDataBufferBuffer of data.
Video: no event
Audio: RAW, 1 frame
DataLengthData size
TimestampTimestamp of data
DescriptionTrack data is rendered to device. If you save the PTT, you can wite this frame into wave file.
SDK version1.1.1

OnPublicCustomMessageReceived

OnPublicCustomMessageReceived(PTTChannel ChannelInstance, string SenderID, string SenderName, byte[] DataBuffer, int DataLength)
ChannelInstancePTTChannel instance of event
SenderIDSender ID
SenderNameSender Name
DataBufferBuffer of data
DataLengthData size
DescriptionPublic custom message is received.
SDK version1.1.1

OnPrivateCustomMessageReceived

OnPrivateCustomMessageReceived(PTTChannel ChannelInstance, string SenderID, string SenderName, byte[] DataBuffer, int DataLength)
ChannelInstancePTTChannel instance of event
SenderIDSender ID
SenderNameSender Name
DataBufferBuffer of data
DataLengthData size
DescriptionPrivate custom message is received.
SDK version1.1.1

OnVideoShared

OnVideoShared(PTTChannel ChannelInstance, int VideoChannelID, int MediaProfileID, string VideoUploader)
ChannelInstanceChannel instance of event
VideoChannelIDShared VideoChannel's ID
MediaProfileIDVideo Profile ID
VideoUploaderUploader ID
DescriptionVideo channel is shared
SDK version1.1.1

OnVideoUnshared

OnVideoUnshared(PTTChannel ChannelInstance, int VideoChannelID, string VideoUploader)
ChannelInstanceChannel instance of event
VideoChannelIDUnshared VideoChannel's ID
VideoUploaderUploader ID
DescriptionVideo channel is unshared
SDK version1.1.1

OnCallFunction

OnCallFunction(PTTChannel ChannelInstance,int functionID, string parameter, string senderID, string senderName, string location)
ChannelInstanceChannel instance of event
functionID1:SOS
parameterFunction's Parameter
senderIDSender's ID
senderNameSender's Name
locationuser's location. If "", unknown
DescriptionCall function received
Server version1.4.x~
SDK version1.3.0

OnAlert

OnAlert(PTTChannel ChannelInstance,string senderID, string senderName, int type, string message)
ChannelInstanceChannel instance of event
senderIDSender's ID
senderNameSender's Name
type0:Normal
messagemessage
DescriptionAlert received
Server version1.4.x~
SDK version1.3.0