Notifying the Video Stream Engine of Events
Application Scenario
Notify the video stream engine of internal client UI events.
Prerequisites
The video stream engine is started successfully.
Development Process
Process different error codes in the onVmiEngineEvent callback function.
Encoding Instance
public void onVmiEngineEventt (int event, int reserved0, int reserved1, int reserved2, int reserved3, String additionInfo) {
if (event == VideoEngine.VMI_ENGINE_EVENT_SOCK_DISCONN) {
// The network is disconnected.
runOnUiThread(new Runnable() {
@Override
public void run() {
// Stop logic threads.
stopMonitorBlocked();
if (upstreamReceiveDispatcher != null) {
upstreamReceiveDispatcher.stopBlocked();
upstreamReceiveDispatcher = null;
}
// Reconnect to the video stream cloud phone.
// Alternatively, exit the cloud phone.
}
});
}
}
Parent topic: Development Process of the Video Stream Engine Client