Skip to content

Latest commit

 

History

History
199 lines (139 loc) · 8.59 KB

v3.0.0+_upgrade_guide.md

File metadata and controls

199 lines (139 loc) · 8.59 KB

Version 3.0.0 or above Upgrade Guide

This article details the instructions and precautions for upgrading the Express Flutter SDK version 3.0.0 or above+.

If you are upgrading from version 2.22.0 or earlier, please refer to v2.23.0_upgrade_guide.md

Disposal Instructions

  • [General], [Communication], and [Live] three scenarios in ZegoScenario scenario enumeration are discarded. For details, please refer to Scenario Audio and video configuration document for adaptation.

  • Starting with this release, the Express iOS SDK no longer supports bitcode.

    Please refer to Apple's Xcode 14 Release Notes notes on deprecating bitcode.

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

Change Description

Changed usage of the following interfaces and objects.

method name/object Describe
isVideoEncoderSupported Add an optional parameter codecBackend for the specified backend implementation, and modify the return value type to int; 0 means not supported, and this encoding format cannot be used for streaming; 1 means supported, and this encoding format can be used for streaming; 2 means Unconfirmed, it is recommended to call this interface later.
isVideoDecoderSupported Add an optional parameter codecBackend for the specified backend implementation, and modify the return value type to int; 0 means not supported, and this encoding format cannot be used for streaming; 1 means supported, and this encoding format can be used for streaming; 2 means Unconfirmed, it is recommended to call this interface later.
ZegoCDNConfig The authParam parameter is changed to an optional parameter, and the optional parameter protocol is added to specify the protocol supported by the URL. If there are more than one, separate them with English commas and try them in order; add an optional parameter quicVersion to indicate the QUIC version. If [protocol] has a QUIC protocol, this information needs to be filled in. If there are multiple version numbers, separate them with English commas.

Sample Code

You can refer to the following sample code for interface and object changes.

isVideoEncoderSupported

Below version 3.0.0

bool isSupport = await ZegoExpressEngine.instance.isVideoEncoderSupported(ZegoVideoCodecID.H265);
if (isSupport) {
    // Support H265
}

Version 3.0.0 or above

// Check whether the current device supports H265 hardcoding
int result = await ZegoExpressEngine.instance.isVideoEncoderSupported(ZegoVideoCodecID.H265, codecBackend: ZegoVideoCodecBackend.Hardware);
if (result == 1) {
    // Support H265 hardcoded
} else if (result == 2) {
    // Indicates unconfirmed, it is recommended to call this interface later. The flexible configuration has not been pulled successfully inside the sdk. It is recommended to call this interface later.
} else if (result == 0) {
    // Not support
}

isVideoDecoderSupported

Below version 3.0.0

bool isSupport = await ZegoExpressEngine.instance.isVideoDecoderSupported(ZegoVideoCodecID.H265);
if (isSupport) {
    // Support H265
}

Version 3.0.0 or above

// Check whether the current device supports H265 hard decoding
int result = await ZegoExpressEngine.instance.isVideoDecoderSupported(ZegoVideoCodecID.H265, codecBackend: ZegoVideoCodecBackend.Hardware);
if (result == 1) {
    // Support H265 hard decoding
} else if (result == 2) {
    // Indicates unconfirmed, it is recommended to call this interface later. The flexible configuration has not been pulled successfully inside the sdk. It is recommended to call this interface later.
} else if (result == 0) {
    // Not support
}

ZegoCDNConfig

Below version 3.0.0

var config = ZegoCDNConfig('url', 'authParam');

Version 3.0.0 or above

var config = ZegoCDNConfig('url');
// or
var config = ZegoCDNConfig('url', authParam: 'authParam');
// or
var config = ZegoCDNConfig('url', authParam: 'authParam', protocol: 'protocol', quicVersion: 'quicVersion');

Delete Instructions

Remove the following interfaces that were deprecated in previous versions.

method name Describe
setDebugVerbose Set the debug details switch and language. This function is deprecated in version 2.3.0, please use enableDebugAssistant to realize the original function.
loginMultiRoom Sign in to multiroom. This method is obsolete after version 2.9.0. If you need to implement multi-room function, please call [setRoomMode](https://pub.dev/documentation/zego_express_engine/latest/zego_express_engine/ZegoExpressEngine/setRoomMode.html before engine initialization ) function to set the multi-room mode, and then use loginRoom to log in to the multi-room, if calling [loginRoom](https://pub .dev/documentation/zego_express_engine/latest/zego_express_engine/ZegoExpressEngineRoom/loginRoom.html) function to log in to multi-room, please make sure to pass in the same user information.
setPlayStreamVideoLayer Set the option to pull the streaming video layer. This function is deprecated after version 2.3.0, please use setPlayStreamVideoType 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.

Sample Code

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

setDebugVerbose

Below version 3.0.0

ZegoExpressEngine.instance.setDebugVerbose(true, ZegoLanguage.English);

Version 3.0.0 or above

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

loginMultiRoom

Below version 3.0.0

ZegoExpressEngine.createEngineWithProfile(profile);

var user = ZegoUser.id("user1");
ZegoExpressEngine.instance.loginRoom("first_room", user);
ZegoExpressEngine.instance.loginMultiRoom("second_room");

Version 3.0.0 or above

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

ZegoExpressEngine.createEngineWithProfile(profile);

var user = ZegoUser.id("user1");
ZegoExpressEngine.instance.loginRoom("first_room", user);
ZegoExpressEngine.instance.loginRoom("second_room", user);

setPlayStreamVideoLayer

Below version 3.0.0

ZegoExpressEngine.instance.setPlayStreamVideoLayer("stream1", ZegoPlayerVideoLayer.Auto);

Version 3.0.0 or above

ZegoExpressEngine.instance.setPlayStreamVideoType("stream1", ZegoVideoStreamType.Default);

setBuiltInSpeakerOn

Below version 3.0.0

ZegoExpressEngine.instance.setBuiltInSpeakerOn(true);

Version 3.0.0 or above

ZegoExpressEngine.instance.setAudioRouteToSpeaker(true);

onDeviceError

Below version 3.0.0

ZegoExpressEngine.onDeviceError(int errorCode, String deviceName) {
    // Handle device error
}

Version 3.0.0 or above

ZegoExpressEngine.onLocalDeviceExceptionOccurred(ZegoDeviceExceptionType exceptionType, ZegoDeviceType deviceType, String deviceID) {
    // Handle device error
}