Reference of IPTTPlugin3
Description of IPTTPlugin3
Depreciated
IVideoPlugin of V3
ICallback3
In plug-in3, developer can use internal API of PTT server.
getDBConnection
Connection getDBConnection() |
Return | java.sql.Connection |
Description | Get DB connection from DB connection pool in server. |
Common library version | 3.0.x |
writeLog
void writeLog(String message) |
message | log message |
Description | Write log in {ProPTT server dir}/logs/service/PTT.service.log |
Common library version | 3.0.x |
writeErrorLog
void writeErrorLog(String message) |
message | log message |
Description | Write error log in {ProPTT server dir}/logs/service/PTT.service.log |
Common library version | 3.0.x |
OnInitialized
void OnInitialized() |
Description | Notify initialized to PTT server. |
Common library version | 3.0.x |
IPTTPlugin3
getInterfaceVersion
int getInterfaceVersion() |
Return | most be retured INTERFACE_VERSION |
Description | Notify plug-in's INTERFACE version |
Common library version | 3.0.x |
getType
int getType() |
Return | most be retured TYPE_GENERAL_PLUGIN |
Description | Notify plug-in's type |
Common library version | 3.0.x |
initialize
boolean initialize(String arg) |
arg | argument for initialization. It is on arg tag in system.xml. |
Return | result of initialize |
Description | initialize plug-in |
Common library version | 3.0.x |
OnConnected
void OnConnected(String userId, String jsonParams) |
userId | connected user's id |
jsonParams | extended parameters |
Description | User connected event |
Common library version | 3.0.x |
OnJoined
void OnJoined(String userId, int channelId) |
userId | joined user's id |
channelId | joined channel id |
Description | Channel joined event |
Common library version | 3.0.x |
OnLocked
void OnLocked(String userId, int channelId, int lockIndex, int mediaProfileId, String userLocation, String audioCodec, String videoCodec, String encKey, String jsonParams) |
userId | joined user's id |
channelId | joined channel id |
lockIndex | lock index, 0:mormal,1:master's lock |
mediaProfileId | audio ptt or video ptt |
userLocation | locked location |
audioCodec | audio codec config |
videoCodec | video codec condig |
encKey | if an encrypted channel, encKey is required to decrypt |
jsonParams | extended parameters |
Description | Channel locked event |
Common library version | 3.0.x |
OnPTT
OnPTT(int channelId, int lockIndex, byte[] frames) |
channelId | joined channel id |
lockIndex | lock index, 0:mormal,1:master's lock |
frames | media frame |
Description | each ptt packet event |
Common library version | 3.0.x |
< frames format >
field | type | bytes | Description |
MediaTrackID | unsigned short | 2 | Media Track |
FarmID | short | 2 | Farm’s ID |
ChannelID | int | 4 | Channel’s ID |
Timestamp | unsigned int | 4 | Timestamp |
FrameType | byte | 1 | 0: Media, 1: CodecInfo |
FrameInfo | byte | 1 | Audio(Frame Count) Video(0x1X:R-0, 0x2X:R-90, 0x3X: R-180, 0x4X:R-270 | 0xX0: Mid, 0xX1:End) |
PadCount | byte | 1 | Padding size |
Reserved | byte | 1 | Reserved |
FrameData | byte[] | | Frame's data |
OnUnLocked
void OnUnLocked(String userId, int channelId, int lockIndex) |
userId | unlocked user's id |
channelId | unlocked channel id |
lockIndex | lock index, 0:mormal,1:master's lock |
Description | Channel unlocked event |
Common library version | 3.0.x |
OnVideoShare
void OnVideoShare(String userId, int channelId, int videoChannelId, String jsonParams) |
userId | shared user's id |
channelId | shared channel id |
videoChannelId | shared video channel id |
jsonParams | extended parameters |
Description | In channel, video share event from sharer. |
Common library version | 3.0.x |
OnVideoShared
void OnVideoShared(String userId, int channelId, int videoChannelId) |
userId | shared user's id |
channelId | shared channel id |
videoChannelId | shared video channel id |
Description | In channel, video shared event from system. |
Common library version | 3.0.x |
OnVideoUnshare
void OnVideoUnshared(String userId, int channelId, int videoChannelId, String jsonParams) |
userId | unshared user's id |
channelId | unshared channel id |
videoChannelId | unshared video channel id |
jsonParams | extended parameters |
Description | In channel, video unshare event from sharer. |
Common library version | 3.0.x |
OnVideoUnshared
void OnVideoUnshared(String userId, int channelId, int videoChannelId) |
userId | unshared user's id |
channelId | unshared channel id |
videoChannelId | unshared video channel id |
Description | In channel, video unshared event from system. |
Common library version | 3.0.x |
OnFileShare
void OnFileShare(String userId, int channelId, int fileChannelId, String jsonParams) |
userId | shared user's id |
channelId | shared channel id |
videoChannelId | shared file channel id |
jsonParams | extended parameters |
Description | In channel, file share event from sharer. Not supported yet |
Common library version | 3.0.x |
OnFileShared
void OnFileShared(String userId, int channelId, int fileChannelId) |
userId | shared user's id |
channelId | shared channel id |
videoChannelId | shared file channel id |
Description | In channel, file shared event from system. Not supported yet |
Common library version | 3.0.x |
OnFileUnshare
void OnFileUnshared(String userId, int channelId, int fileChannelId, String jsonParams) |
userId | unshared user's id |
channelId | unshared channel id |
videoChannelId | unshared video channel id |
jsonParams | extended parameters |
Description | In channel, file unshare event from sharer. Not supported yet |
Common library version | 3.0.x |
OnFileUnshared
void OnFileUnshared(String userId, int channelId, int fileChannelId) |
userId | unshared user's id |
channelId | unshared channel id |
videoChannelId | unshared file channel id |
Description | In channel, file unshared event from system. Not supported yet |
Common library version | 3.0.x |
OnText
void OnText(String userId, int channelId, int messageId, String base64Message) |
userId | user's id |
channelId | channel id |
messageId | message's id. it is not unique |
base64Message | base64(message) |
Description | In channel, sent text message |
Common library version | 3.0.x |
OnCustomMessage
void OnCustomMessage(String userId, int channelId, int messageId, String base64Message) |
userId | user's id |
channelId | channel id |
messageId | message's id. it is not unique |
base64Message | base64(message) |
Description | In channel, sent custom message |
Common library version | 3.0.x |
OnFunction
OnFunction(String userId, int channelId, String latitude, String longitude, String functionName, String jsonParams) |
userId | user's id |
channelId | channel id |
messageId | message's id. it is not unique |
latitude | latitude |
longitude | longitude |
functionName | function's name. "sos"|"message:base64(message)"|"call-event"|and so on |
jsonParams | extended parameters |
Description | In channel, sent function call |
Common library version | 3.0.x |
OnLocation
void OnLocation(String userId, String latitude, String longitude) |
userId | user's id |
latitude | latitude |
longitude | longitude |
Description | User location is updated. |
Common library version | 3.0.x |
OnLeaved
void OnLeaved(String userId, int channelId) |
userId | user's id |
channelId | channel id |
Description | User leaved channel |
Common library version | 3.0.x |
OnDisconnected
void OnDisconnected(String userId) |
userId | user's id |
Description | User disconnected |
Common library version | 3.0.x |
OnError
void OnError(int errCode, String jsonParams) |
errCode | error code. not defined |
jsonParams | extended parameters |
Description | fired error |
Common library version | 3.0.x |
OnExtenedEvent
void OnExtenedEvent(String cmdName, String jsonParams) |
cmdName | commend name. not defined |
jsonParams | extended parameters |
Description | Fired an extended event |
Common library version | 3.0.x |