Stopping the Video Stream Engine Object
Application Scenario
To exit the cloud phone or reconnect to the cloud phone, stop the video stream engine and then call the stop interface function.
End the activity and activity thread before exiting the cloud phone.
Prerequisites
The video stream engine is started successfully.
Development Process
- Start the thread to stop logic threads such as recvData.
- Call the stop interface function of the video stream engine.
Encoding Instance
public class Activity implements BaseActivity {
protected void StopCloudPhone() {
threadPool.submit(new StopPhoneRunnable());
}
}
public class StopPhoneRunnable {
@Override
public void run() {
// Stop logic threads such as the receive thread.
upstreamReceiveDispatcher.stopBlocked();
// Stop the engine.
engine.stop();
runOnUiThread(new Runnable() {
@Override
public void run() {
finish();
android.os.Process.killProcess(android.os.Process.myPid());
}
});
}
}
Parent topic: Development Process of the Video Stream Engine Client