Video Call
  • iOS
  • Android
  • Web
  • Flutter
  • React Native
  • Electron
  • Unity3D : C#
  • Cocos Creator
  • Windows
  • macOS
  • Linux
  • Overview
  • Develop your app
    • Integrate the SDK
    • Implement a basic video call
    • Enhance basic feature
      • Use Tokens for authentication
      • Check the room connection status
  • Resources & Reference
    • SDK
    • Sample codes
    • API reference
      • Client APIs
      • Server APIs
    • Debugging
      • Error codes
    • Key concepts
  • Documentation
  • Video Call
  • Resources & Reference
  • SDK
  • Upgrade guide
  • Upgrade guide v3.0.0+

upgrade guide v3.0.0+

Last updated:2023-09-27 14:34

  • If your current SDK version is lower than 3.0.0, when you need to upgrade to any version of 3.0.0 or above. Please make sure to read this document.
  • In addition, it is recommended that you refer to the business-related interfaces changes in the Release notes between the current version and the target version.

This article will introduce the instructions and precautions when upgrading the Express SDK version to version 3.0.0 or later.

Deprecation notes

  1. Discard the three scenarios of General, Communication, and Live in the ZegoScenario scene enumeration. Please refer to the Scenario Audio and Video Configuration document for adaptation.

  2. From version 3.0.0, the Express iOS SDK no longer supports bitcode. For details, please refer to Xcode 14 Release Notes for instructions on deprecating bitcode.

Adaptation method: Open the configuration page of the Xcode project, find the "Enable Bitcode" option in the "Build Settings" page of the App Target, and set it to "No".

delete description

Removed the following interfaces that were deprecated in previous versions.

method name Description
SetDebugVerbose Set debug detail switch and Language. This function is deprecated in version 2.3.0, please use EnableDebugAssistant to implement the original function.
LoginMultiRoom Multiple Rooms to MultiRoom. This method is deprecated after version 2.9.0. To implement multi-room function, please call SetRoomMode function to set multi-room mode before engine initialization, and then use LoginRoom to Multiple Rooms. If calling LoginRoom function to Multiple Rooms , please make sure to pass in the same user information.
SetPlayStreamVideoLayer Set to select the Video layer for play streams video. This function is deprecated after version 2.3.0, please use SetPlayStreamVideoType instead.
EnableAudioDataCallback Enable additional callback for receiving Audio data. This function is deprecated since version 2.7.0, please use StartAudioDataObserver and StopAudioDataObserver instead.
SetBuiltInSpeakerOn Whether to use the built-in speaker to play sound. This function is deprecated after version 2.3.0, please use SetAudioRouteToSpeaker instead.
OnDeviceError Device exception notification. This function is deprecated in version 2.15.0 and above, please use OnLocalDeviceExceptionOccurred instead.

Change the sample code

You can refer to the following sample code to make interface changes.

SetDebugVerbose

Before version 3.0.0

ZegoExpressEngine.GetEngine().SetDebugVerbose(true, ZegoLanguage.English);

Version 3.0.0 or later

// Note, do not enable this feature in the online version! Use only during development phase!
// Note, do not enable this feature in the online version! Use only during development phase!"
ZegoExpressEngine.GetEngine().EnableDebugAssistant(true);

LoginMultiRoom

Before version 3.0.0

ZegoExpressEngine.CreateEngine(profile, null);

ZegoUser user = new ZegoUser("user1");
ZegoExpressEngine.GetEngine().LoginRoom("first_room", user);
ZegoExpressEngine.GetEngine().LoginMultiRoom("second_room", null);

Version 3.0.0 or later

For related interface usage, please refer to the Multiple Rooms documentation.

// Must be set before calling [createEngine] to take effect, otherwise it will fail.
// Must be set before calling [createEngine] to take effect, otherwise it will fail.
ZegoExpressEngine.SetRoomMode(ZegoRoomMode.MULTI_ROOM);

ZegoExpressEngine.CreateEngine(profile, null);

ZegoUser user = new ZegoUser("user1");
ZegoExpressEngine.GetEngine().LoginRoom("first_room", user);
ZegoExpressEngine.GetEngine().LoginRoom("second_room", user);

SetPlayStreamVideoLayer

Before version 3.0.0

ZegoExpressEngine.GetEngine().SetPlayStreamVideoLayer("stream1", ZegoPlayerVideoLayer.Auto);

Version 3.0.0 or later

For related interface usage, please refer to the Set Video Encoding Method document.

ZegoExpressEngine.GetEngine().SetPlayStreamVideoType("stream1", ZegoVideoStreamType.Default);

EnableAudioDataCallback

Before version 3.0.0

int bitmask = ZegoAudioDataCallbackBitMask.Captured | ZegoAudioDataCallbackBitMask.Player;
ZegoAudioFrameParam param = new ZegoAudioFrameParam();
param.sampleRate = ZegoAudioSampleRate.ZegoAudioSampleRate48K;
param.channel = ZegoAudioChannel.Mono;

// Start
ZegoExpressEngine.GetEngine().SetAudioDataHandler(handler);
ZegoExpressEngine.GetEngine().EnableAudioDataCallback(true, bitmask, param);

// Stop
ZegoExpressEngine.GetEngine().SetAudioDataHandler(null);
ZegoExpressEngine.GetEngine().EnableAudioDataCallback(false, bitmask, param);

Version 3.0.0 or later

int bitmask = ZegoAudioDataCallbackBitMask.Captured | ZegoAudioDataCallbackBitMask.Player;
ZegoAudioFrameParam param = new ZegoAudioFrameParam();
param.sampleRate = ZegoAudioSampleRate.ZegoAudioSampleRate48K;
param.channel = ZegoAudioChannel.Mono;

// Start
ZegoExpressEngine.getEngine().SetAudioDataHandler(handler);
ZegoExpressEngine.getEngine().StartAudioDataObserver(bitmask, param);

// Stop
ZegoExpressEngine.getEngine().SetAudioDataHandler(null);
ZegoExpressEngine.getEngine().StopAudioDataObserver();

SetBuiltInSpeakerOn

Before version 3.0.0

ZegoExpressEngine.GetEngine().SetBuiltInSpeakerOn(true);

Version 3.0.0 or later

ZegoExpressEngine.GetEngine().SetAudioRouteToSpeaker(true);

OnDeviceError

Before version 3.0.0

public void OnDeviceError(int errorCode, string deviceName) {
    // Handle device error
    // Handling device errors
}
engine.onDeviceError = OnDeviceError;

Version 3.0.0 or later

public void OnLocalDeviceExceptionOccurred(ZegoDeviceExceptionType exceptionType, ZegoDeviceType deviceType, string deviceID) {
    // Handle device error
    // Handling device errors
}

engine.onLocalDeviceExceptionOccurred = OnLocalDeviceExceptionOccurred;
Page Directory