Reference of PTTChannel
Description of PTTChannel
PTTClient Group VideoChannel
Properties
| name | type | attributes | description |
| ChannelID | int | readonly | Channel ID |
| ChannelNo | string | readonly | Channel number |
| ChannelName | string | readonly | Channel name |
| ChannelDescription | string | readonly | Channel description |
| ChannelNotification | string | readonly | Channel notification |
| TOT | int | readonly | Time Out Timer, second |
| Recordable | boolean | readonly | Is a recordable channel. Client app can save PTTs on device. An adminitsrator can select it on adminWeb. |
| Encrypted | boolean | readonly | Is a encrypted channel. PTT data is encrypted. An adminitsrator can select it on adminWeb. |
| OwnerID | string | readonly | Channel Owner ID |
| OwnerName | string | readonly | Channel Owner Name |
| Function | string | readonly | Function Key names |
| Status | int | readonly | Status joined the Channel
10: Invited, 20:request subscribe, 30: subscribed |
| Type | string | readonly | Channel Type
'S'ystem,'F'ree,'P'rivate,'C'ompany,'G'roup,'1':1 |
| Foreground | boolean | | Channel's focus status |
| UseVox | boolean | | Whether to use vox for lock |
| UseBluetooth | boolean | | Whether to use bluetooth for lock |
| LockMediaProfileID | int | | Media 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)
|
| LockStatus | int | |
Status for PTT lock
0 : unlocked
1 : request unlock
2 : request lock
3 : locked by me
4 : locked by someone |
| JoinStatus | int | |
Status for channel join
0 : leaved
1 : joined |
| PlayAmplification | int | | -50~100, default 0 |
| EnablePlayAudio | boolean | | Audio play status |
| EnableSendAudio | boolean | | Audio send status |
| EnablePlayVideo | boolean | | Video play status |
| EnableSendVideo | boolean | | Video send status |
Methods
Delete
| int Delete() |
| Return | Request Sequence ID. If less then 0, ErrorCode. |
| Expected Events | OnChannelDeleted |
| Description | Delete PTT channel |
| SDK version | 1.1.1 |
Update
| int Update(string ChannelAttributesJson) |
| Return | Request Sequence ID. If less then 0, ErrorCode. |
| Expected Events | OnChannelUpdated |
| Description | Update PTT channel informations. |
| SDK version | 1.1.1 |
Join
| int Join() |
| Return | Request Sequence ID. If less then 0, ErrorCode. |
| Expected Events | OnJoined() |
| Description | Start PTT channel |
| SDK version | 1.1.1 |
Leave
| int Leave() |
| Return | Request Sequence ID. If less then 0, ErrorCode. |
| Expected Events | OnLeaved |
| Description | Stop PTT channel |
| SDK version | 1.1.1 |
AcceptSubscribe
| int AcceptSubscribe(string RequesterID, string RequesterName) |
| RequesterID | Requester's ID |
| RequesterName | Requester's Name |
| Return | Request Sequence ID. If less then 0, ErrorCode. |
| Expected Events | |
| Description | Accept requester's subscription |
| SDK version | 1.1.1 |
DenySubscribe
| int DenySubscribe(string RequesterID, string RequesterName) |
| RequesterID | Requester's ID |
| RequesterName | Requester's Name |
| Return | Request Sequence ID. If less then 0, ErrorCode. |
| Expected Events | |
| Description | Deny requester's subscription |
| SDK version | 1.1.1 |
Unsubscribe
| int Unsubscribe() |
| Return | Request Sequence ID. If less then 0, ErrorCode. |
| Expected Events | |
| Description | Unsubscribe to channel |
| SDK version | 1.1.1 |
CancelSubscribe
| int CancelSubscribe() |
| Return | Request Sequence ID. If less then 0, ErrorCode. |
| Expected Events | |
| Description | Request Cancel of subscribe to channel |
| SDK version | 1.1.1 |
Invite
| int Invite(string ReceiverID) |
| ReceiverID | Receiver ID |
| Return | Request Sequence ID. If less then 0, ErrorCode. |
| Expected Events | |
| Description | Invite Receiver |
| SDK version | 1.1.1 |
AcceptInvite
| int AcceptInvite(string RequesterID) |
| ReceiverID | Requester's ID |
| Return | Request Sequence ID. If less then 0, ErrorCode. |
| Expected Events | |
| Description | Response of PTTClient's invitation |
| SDK version | 1.1.1 |
DenyInvite
| int DenyInvite(string RequesterID) |
| ReceiverID | Requester's ID |
| Return | Request Sequence ID. If less then 0, ErrorCode. |
| Expected Events | |
| Description | Response of PTTClient's invitation |
| SDK version | 1.1.1 |
CancelInvite
| int CancelInvite(string RequesterID) |
| RequesterID | Requester's ID |
| Return | Request Sequence ID. If less then 0, ErrorCode. |
| Expected Events | |
| Description | Request Cancel of invite |
| SDK version | 1.1.1 |
Lock
int Lock() int Lock(boolean Emergency) |
| Emergency | If other user have a lock, break the lock and make a new lock for user |
| Return | Request Sequence ID. If less then 0, ErrorCode. |
| Expected Events | OnLocked |
| Description | Request Channel lock to server |
| SDK version | 1.1.1, Lock(boolean Emergency) is in 1.2.0 |
Unlock
| int Unlock() |
| Return | Request Sequence ID. If less then 0, ErrorCode. |
| Expected Events | OnUnlocked |
| Description | Request Channel unlock to server |
| SDK version | 1.1.1 |
SendPublicMessage
| int SendPublicMessage(string Message) |
| Message | Max 200 characters |
| Return | Request Sequence ID. If less then 0, ErrorCode. |
| Expected Events | |
| Description | Send a Message to all in same PTTChannel. Notice: Message's sequence is not guaranteed. |
| SDK version | 1.1.1 |
SendPrivateMessage
| int SendPrivateMessage(string ReceiverID, string Message) |
| ReceiverID | Receiver ID |
| Message | Max 200 characters |
| Return | Request Sequence ID. If less then 0, ErrorCode. |
| Expected Events | |
| Description | Send a Private Message to Receiver. Notice: Message's sequence is not guaranteed. |
| SDK version | 1.1.1 |
SendPublicCustomMessage
| int SendPublicCustomMessage(byte[] DataBuffer, int DataLength) |
| DataBuffer | Buffer of data |
| DataLength | Data size. Max size is 30KB. |
| Return | Request Sequence ID. If less then 0, ErrorCode. |
| Expected Events | |
| Description | Send a CustomMessage to all. Notice: Message's sequence is not guaranteed. |
| Server version | 1.2.x~ |
| SDK version | 1.1.1 |
SendPrivateCustomMessage
| int SendPrivateCustomMessage(string ReceiverID, byte[] DataBuffer, int DataLength) |
| ReceiverID | Receiver ID |
| DataBuffer | Buffer of data |
| DataLength | Data size. Max size is 30KB. |
| Return | Request Sequence ID. If less then 0, ErrorCode. |
| Expected Events | |
| Description | Send a CustomMessage to Receiver. Notice: Message's sequence is not guaranteed. |
| Server version | 1.2.x~ |
| SDK version | 1.1.1 |
CallFunction
| int CallFunction(string FunctionName, string Parameter) |
| FunctionName | Function's Name |
| Parameter | Function's Parameter |
| Return | Request Sequence ID. If less then 0, ErrorCode. |
| Expected Events | OnCallFunction |
| Description | Call channel's function |
| SDK version | 1.1.1 |
SetEnableSendAudio
| int SetEnableSendAudio(boolean Enable) |
| Enable | Send silent audio |
| Return | |
| Expected Events | |
| Description | This is removed at 1.2.0. Please use property EnableSendAudio. Send silent audios to server. |
| SDK version | 1.1.1 |
SetEnablePlayVideo
| int SetEnablePlayVideo(boolean Enable) |
| Enable | Stop 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 version | 1.1.1 |
SetEnableSendVideo
| int SetEnableSendVideo(boolean Enable) |
| Enable | Stop or not |
| Return | |
| Expected Events | |
| Description | This is removed at 1.2.0. Please use property EnableSendVideo. Send no video to server. |
| SDK version | 1.1.1 |
ShareVideo
| int ShareVideo(int VideoChannelID) |
| VideoChannelID | Shared VideoChannel's ID |
| Return | Request Sequence ID. If less then 0, ErrorCode. |
| Expected Events | OnVideoShared |
| Description | Share video with members |
| SDK version | 1.1.1 |
UnshareVideo
| int UnshareVideo(int VideoChannelID) |
| VideoChannelID | Unshared VideoChannel's ID |
| Return | Request Sequence ID. If less then 0, ErrorCode. |
| Expected Events | OnVideoUnshared |
| Description | Unshare video with members |
| SDK version | 1.1.1 |
setCameraPreview
| int setCameraPreview(View preview) |
| preview | Camera 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 version | 1.1.1 |
setPlayView
| int setPlayView(View playView) |
| playView | Video 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 version | 1.1.1 |
setAudioManager
| void setAudioManager(IAudioManager audioManager) |
| audioManager | AudioManager instance |
| Description | Can use for external audio devices
Please refer to IAudioManager. |
| SDK version | 1.3.0 |
Events
OnPTTChannelError
| OnPTTChannelError(PTTChannel ChannelInstance, int ErrorCode, string ErrorMesssage) |
| ChannelInstance | PTTChannel instance of event |
| ErrorCode | Error code. see Main 6 |
| ErrorMesssage | Error message |
| Description | Errer event |
| SDK version | 1.1.1 |
OnPTTChannelResult
| OnPTTChannelResult(PTTChannel ChannelInstance,int Seq, int ResultCode, string ResultMesssage) |
| ChannelInstance | PTTChannel instance of event |
| Seq | Requested Sequence ID |
| ResultCode | Error code. see Main 7 |
| ResultMesssage | Error message |
| Description | Result event for request |
| SDK version | 1.1.1 |
OnJoined
OnJoined(PTTChannel ChannelInstance, string MemberJson,int TotalUserCount)
OnJoined(PTTChannel ChannelInstance, string MemberID, string MemberName, int TotalUserCount) |
| ChannelInstance | Channel instance of event |
| MemberJson | Joined Member ID JsonArray |
| MemberID | Joined Member's ID |
| MemberName | Joined Member's Name for a guest |
| TotalUserCount | Total user count in channel |
| Description | User is joined into a PTT channel. |
| SDK version | 1.1.1 |
OnLeaved
| OnLeaved(PTTChannel ChannelInstance, string MemberID) |
| ChannelInstance | Channel instance of event |
| MemeberID | Leaved Member's ID |
| Description | User is leaved from a PTT channel |
| SDK version | 1.1.1 |
OnNotifyReceived
| OnNotifyReceived(PTTChannel ChannelInstance, int NotifiedCode, string NotifiedData) |
| ChannelInstance | PTTChannel instance of event |
| NotifiedCode | Notified code |
| NotifiedData | Notified data |
| Description | Notified from server. |
| SDK version | 1.1.1 |
OnPublicMessageReceived
| OnPublicMessageReceived(PTTChannel ChannelInstance, string SenderID, string SenderName, string Message) |
| ChannelInstance | PTTChannel instance of event |
| SenderID | Sender ID |
| SenderName | Sender Name |
| Message | Message |
| Description | A public message is received from sender |
| SDK version | 1.1.1 |
OnPrivateMessageReceived
| OnPrivateMessageReceived(PTTChannel ChannelInstance, string SenderID, string SenderName, string Message) |
| ChannelInstance | PTTChannel instance of event |
| SenderID | Sender ID |
| SenderName | Sender Name |
| Message | Message |
| Description | A private message is received from sender. |
| SDK version | 1.1.1 |
OnLocked
| OnLocked(PTTChannel ChannelInstance, string Location, unsigned int MediaProfileID, string LockerID, string LockerName) |
| ChannelInstance | Channel instance of event |
| Location | Locked user's location. If "", unknown |
| MediaProfileID | |
| LockerID | Locker's ID |
| LockerName | Locker's Name for a guest |
| Description | Channel is locked by me or peer. |
| SDK version | 1.1.1 |
OnUnlocked
| OnUnlocked(PTTChannel ChannelInstance, string LockerID) |
| ChannelInstance | Channel instance of event |
| LockerID | Locker's ID |
| Description | Channel is unlocked by me or peer. |
| SDK version | 1.1.1 |
OnTrackDataCaptured
| OnTrackDataCaptured(PTTChannel ChannelInstance, int TrackType, byte[] TrackDataBuffer, int DataLength, unsigned int Timestamp) |
| ChannelInstance | PTTChannel instance of event |
| TrackType | 0:Audio, 1:Video, 1>Others |
| TrackDataBuffer | Buffer of data. Video: no event Audio: RAW, 1 frame |
| DataLength | Data size |
| Timestamp | Timestamp of data |
| Description | Track data is captured from device. |
| SDK version | 1.1.1 |
OnTrackDataEncoded
| OnTrackDataEncoded(PTTChannel ChannelInstance, int TrackType, byte[] TrackDataBuffer, int DataLength, unsigned int Timestamp) |
| ChannelInstance | PTTChannel instance of event |
| TrackType | 0:Audio, 1:Video, 1>Others |
| TrackDataBuffer | Buffer of data. Video: JPEG, 1 frame Audio: OPUS, 1 frame |
| DataLength | Data size |
| Timestamp | Timestamp of data |
| Description | Track data is encoded by encoder. |
| SDK version | 1.1.1 |
OnTrackDataReceived
| OnTrackDataReceived(PTTChannel ChannelInstance, int TrackType, byte[] TrackDataBuffer, int DataLength, unsigned int Timestamp) |
| ChannelInstance | PTTChannel instance of event |
| TrackType | 0:Audio, 1:Video, 1>Others |
| TrackDataBuffer | Buffer of data. Video: JPEG, 1 frame Audio: OPUS, 1 frame |
| DataLength | Data size |
| Timestamp | Timestamp of data |
| Description | Track data is received from server. If you save the PTT, you can wite this frame into Opus or your defined file. |
| SDK version | 1.1.1 |
OnTrackDataRendered
| OnTrackDataRendered(PTTChannel ChannelInstance, int TrackType, byte[] TrackDataBuffer, int DataLength, unsigned int Timestamp) |
| ChannelInstance | PTTChannel instance of event |
| TrackType | 0:Audio, 1:Video, 1>Others |
| TrackDataBuffer | Buffer of data. Video: no event Audio: RAW, 1 frame |
| DataLength | Data size |
| Timestamp | Timestamp of data |
| Description | Track data is rendered to device. If you save the PTT, you can wite this frame into wave file. |
| SDK version | 1.1.1 |
OnPublicCustomMessageReceived
| OnPublicCustomMessageReceived(PTTChannel ChannelInstance, string SenderID, string SenderName, byte[] DataBuffer, int DataLength) |
| ChannelInstance | PTTChannel instance of event |
| SenderID | Sender ID |
| SenderName | Sender Name |
| DataBuffer | Buffer of data |
| DataLength | Data size |
| Description | Public custom message is received. |
| SDK version | 1.1.1 |
OnPrivateCustomMessageReceived
| OnPrivateCustomMessageReceived(PTTChannel ChannelInstance, string SenderID, string SenderName, byte[] DataBuffer, int DataLength) |
| ChannelInstance | PTTChannel instance of event |
| SenderID | Sender ID |
| SenderName | Sender Name |
| DataBuffer | Buffer of data |
| DataLength | Data size |
| Description | Private custom message is received. |
| SDK version | 1.1.1 |
OnVideoShared
| OnVideoShared(PTTChannel ChannelInstance, int VideoChannelID, int MediaProfileID, string VideoUploader) |
| ChannelInstance | Channel instance of event |
| VideoChannelID | Shared VideoChannel's ID |
| MediaProfileID | Video Profile ID |
| VideoUploader | Uploader ID |
| Description | Video channel is shared |
| SDK version | 1.1.1 |
OnVideoUnshared
| OnVideoUnshared(PTTChannel ChannelInstance, int VideoChannelID, string VideoUploader) |
| ChannelInstance | Channel instance of event |
| VideoChannelID | Unshared VideoChannel's ID |
| VideoUploader | Uploader ID |
| Description | Video channel is unshared |
| SDK version | 1.1.1 |
OnCallFunction
| OnCallFunction(PTTChannel ChannelInstance,int functionID, string parameter, string senderID, string senderName, string location) |
| ChannelInstance | Channel instance of event |
| functionID | 1:SOS |
| parameter | Function's Parameter |
| senderID | Sender's ID |
| senderName | Sender's Name |
| location | user's location. If "", unknown |
| Description | Call function received |
| Server version | 1.4.x~ |
| SDK version | 1.3.0 |
OnAlert
| OnAlert(PTTChannel ChannelInstance,string senderID, string senderName, int type, string message) |
| ChannelInstance | Channel instance of event |
| senderID | Sender's ID |
| senderName | Sender's Name |
| type | 0:Normal |
| message | message |
| Description | Alert received |
| Server version | 1.4.x~ |
| SDK version | 1.3.0 |