This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// The AppID you get from ZEGOCLOUD Admin Console. | |
long appID = 214124124L; | |
// Initialize the SDK. We recommend you call this method when the application starts. | |
// The last parameter refers to the Application object of the ZEGOlive SDK. | |
ZegoRoomManager.getInstance().init(appID, this); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** Destroy the ZegoExpressEngine instance */ | |
ZegoExpressEngine.destroyEngine(null); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** Log out of a room */ | |
engine.logoutRoom("room1"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** Stop playing a stream*/ | |
engine.stopPlayingStream(streamID); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** Stop local video preview */ | |
engine.stopPreview(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** Stop publishing a stream */ | |
engine.stopPublishingStream(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
* Start playing a remote stream with the SDK's default view mode (AspectFill). | |
* The play_view below is a SurfaceView/TextureView/SurfaceTexture object on UI. | |
*/ | |
engine.startPlayingStream("stream1", new ZegoCanvas(play_view)); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
engine.setEventHandler(new IZegoEventHandler() { | |
/** Common event callbacks related to stream publishing. */ | |
/** Callback for updates on stream publishing status. */ | |
@Override | |
public void onPublisherStateUpdate(String streamID, ZegoPublisherState state, int errorCode, JSONObject extendedData){ | |
/** Implement the callback handling logic as needed. */ | |
} | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** Start publishing a stream */ | |
engine.startPublishingStream("stream1"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
* Set up a view for the local video preview and start the preview with SDK's default view mode (AspectFill). | |
* The following play_view is a SurfaceView, TextureView, or SurfaceTexture object on the UI. | |
*/ | |
engine.startPreview(new ZegoCanvas(preview_view)); |
NewerOlder