This topic describes how to upgrade ApsaraVideo Player SDK for Android from V4.5.0 to V5.1.4 and later and describes the changes and updates in ApsaraVideo Player SDK for Android V5.1.4 and later.

Background information

Versions of Player SDK V4.5.0 and later differ only in class names, methods, and version numbers.

Upgrade path

If you want to upgrade ApsaraVideo Player SDK for Android from V4.5.0 to V5.1.4 and later, directly change the version number in the SDK dependency package. For more information, see Upgrade method. If you want to upgrade V4.5.0 or earlier to V5.1.4, submit a ticket to contact Alibaba Cloud technical support.

Upgrade method

If you use V4.5.0, change the version number 4.5.0 to the version number to which you want to upgrade in the dependency packages com.aliyun.sdk.android:AliyunPlayer:4.5.0-full and com.alivc.conan:AlivcConan:4.5.0 of ApsaraVideo Player SDK in build.gradle. For more information, see Release notes of ApsaraVideo Player SDK for Android.
Note For ApsaraVideo Player SDK for Android V5.3.0 or later, you do not need to add the AlivcConan dependency. You need only to add the AliyunPlayer dependency and then change the version number to the version number to which you want to upgrade.

Changes to class names and methods

The API operations for logs of Player SDK for Android V4.5.0 are ported to the com.cicada.player.utils.Logger class in V5.1.4 and later. In V5.1.4 and later, you must use Logger.getInstance(context) to obtain the Logger object before you can call other methods for logs. The following table describes the changes to class names and methods.
Note minSDKVersion 16 or earlier is supported in V4.5.0. minSDKVersion 18 or earlier is supported in V5.1.4 and later.
4.5.0 5.1.4 and later Description
VcPlayerLog Related code is deleted. Specifies the log-related content.
Note In V5.1.4 and later, you can call methods such as getInstance(Context context), enableConsoleLog(boolean bEnabled), setLogCallback(Logger.OnLogCallback callback), and setLogLevel(Logger.LogLevel logLevel) to manage logs.
None getInstance(Context context) is added. Obtains a Logger singleton object.
enableLog(boolean enable) enableConsoleLog(boolean bEnabled) Enables the log feature for the player.
setLogCallback(LogLevel logLevel, IPlayer.OnLogCallback callback) setLogCallback(Logger.OnLogCallback callback) Configures log callbacks.
com.aliyun.player.LogLevel setLogLevel(Logger.LogLevel logLevel) Configures the log level.