LinkVisual Media SDK for Android V2.0.0 has introduced major changes to operations, methods, and classes. If your SDK version is earlier than 2.0.0, we recommend that you follow the instructions in this topic to upgrade your SDK.
Major changes
Feature | V1.x.x | V2.x.x |
Rendering components | The TextureView and GLSurfaceView components are supported. | Only the TextureView component is supported. The GLSurfaceView component is no longer supported. |
Live players | LivePlayer | The class used to create live players is renamed LVLivePlayer. |
Video-on-demand (VOD) players | The class used to create VOD players for on-premises recordings is renamed VodPlayer. The class used to create VOD players for cloud recordings is renamed HlsPlayer. | The class used to create VOD players for on-premises recordings and the class used to create VOD players for cloud recordings are merged into one class named LVVodPlayer. The LVVodPlayer class automatically identifies the specified data source and creates a VOD player of a type that corresponds to the data source. |
Voice intercom | LiveIntercomV2. | The class used to create voice intercom sessions is renamed LVLiveIntercom. |
Procedure
The method used to integrate LinkVisual Media SDK for Android by using Gradle is similar between versions. You need to only specify the corresponding version number. The obfuscation configuration remains unchanged.
In V2.0.0 and later, ExoPlayer is no longer integrated into LinkVisual Media SDK for Android by default. If you want to use ExoPlayer, add the following code to import the required dependencies:
implementation('com.google.android.exoplayer:exoplayer-core:2.10.5')
implementation('com.google.android.exoplayer:exoplayer-ui:2.8.3')
implementation('com.google.android.exoplayer:exoplayer-hls:2.10.5')Add the following code to the obfuscation configuration:
-dontwarn com.google.android.exoplayer2.**API changes (search for changes by keyword)
Global components
Change | 1.x.x | 2.x.x | Usage notes |
The SDK and the class are renamed. |
|
| Rename the SDK and the class. |
Live players
Change | 1.x.x | 2.x.x | Usage notes |
The SDK and the class are renamed. |
|
| Rename the SDK and the class. |
The values of the decryptIv and decryptKey parameters of the operation that encrypts the data of a data source that stores streaming data are changed from the binary data after Base64 decoding to the original Base64-encoded strings. |
|
| Important Decode Base64-encoded strings by using the SDK. |
The operations that make preparations are removed. |
| N/A | After you specify a data source, you can call the |
Return values are added to operations, such as | N/A | Enumerated return values:
| Check whether an operation is successful based on the return values. |
The operations that obtain the height and width of a streaming video are added. | N/A |
| None |
The classes that configure decoding policies and enumerate decoding types are renamed. |
|
| Rename the classes. |
The operations that configure and cancel volume settings are replaced by the mute and unmute operations. |
|
| You cannot separately control player volume in an app. The system performs volume control in a centralized manner. |
The operations that manage audio focuses are added. | N/A |
| In V2.0.0 and later, the SDK cannot simultaneously play multiple audio streams but can play only one audio stream. For example, if multiple audio streams are simultaneously played on multiple views of a network video recorder (NVR), you can call the |
The operation that configures a channel for audio streams is removed. |
| N/A | Live players use only the |
The operations that support the GLSurfaceView component are removed. |
| N/A | Replace the GLSurfaceView component with the TextureView component. Compared with the GLSurfaceView component, the TextureView component provides the following advantages:
|
The operation that configures the scaling mode of videos is replaced by a new operation. The parameter is renamed and a new class is added. |
|
| Rename the operation and the parameter, and add the new class. |
The operations that configure recording for the playing content are replaced by new operations. |
|
|
|
The operations that configure display behaviors when a playback stops are removed. |
| N/A | None |
The operation that obtains the status of a player is replaced by a new operation. |
|
| The type of the returned status value is changed from INTEGER to ENUM. This helps you understand and maintain the code with ease. |
The operation that obtains the stream connection type of a player is replaced by a new operation and a new class is added. |
|
| Rename the operation and add the new class. |
The operation that obtains information about the frame rate or bitrate of a player is replaced by a new operation and a new class is added. |
|
| Rename the operation and add the new class. |
The operations that configure callbacks for live players are replaced by a new operation. |
|
| Merge multiple listeners into one listener. |
The operations that configure external rendering for players are replaced by a new operation. |
|
| In V2.0.0 and later, LinkVisual Media SDK for Android supports callbacks for video data in the YUV format and callbacks for audio data in the PCM format. |
The operation that obtains a frame of YUV data is replaced by a new operation. |
|
| Rename the operation. |
VOD players
Change | 1.x.x | 2.x.x | Usage notes |
The SDK and the classes are renamed. |
|
| Rename the SDK and the classes. In V2.0.0 and later, LinkVisual Media SDK for Android merges VOD players that play recordings in the storage cards of IP cameras and VOD players that play cloud recordings into only one type of VOD players. |
The values of the decryptIv and decryptKey parameters of the operation that encrypts the data of a data source that stores the VOD recordings of the storage cards of an IP camera are changed from the binary data after Base64 decoding to the original Base64-encoded strings. |
|
| Important Decode Base64-encoded strings by using the SDK. |
The operations that make preparations are removed. |
| N/A | After you specify a data source, you can call the |
Return values are added to specific operations, such as | None | Enumerated return values:
| Check whether an operation is successful based on the return value. |
A separate operation that resumes a playback is added. |
|
| In V2.0.0 and later, the resume operation of VOD players is no longer integrated with the |
The operations that obtain the playback duration of a VOD player are replaced by new operations. |
|
| Rename the operations. |
The operations that obtain the height and width of a streaming video are added. | N/A |
| None |
The classes that enumerate decoding policies and types are renamed. |
|
| Rename the classes. |
The operations that configure and cancel volume settings are replaced by the mute and unmute operations. |
|
| You cannot separately control player volume in an app. The system performs volume control in a centralized manner. |
Operations that manage audio focuses are added. | N/A |
| In V2.0.0 and later, the SDK cannot simultaneously play multiple audio streams but can play only one audio stream. For example, if multiple audio streams are simultaneously played on multiple views of a NVR, you can call the |
The operation that configures a channel for audio streams is removed. |
| N/A | Live players use only the |
The operations that support the GLSurfaceView component are removed. |
| N/A | Replace the GLSurfaceView component with the TextureView component. Compared with the GLSurfaceView component, the TextureView component provides the following advantages:
|
The operation that configures the scaling mode of videos is replaced by a new operation. The parameter is renamed and a new class is added. |
|
| Rename the operation and the parameter, and add the new class. |
The operations that configure recording for the playing content are replaced by new operations. |
|
|
|
The operations that configure display behaviors when a playback stops are removed. |
| N/A | None |
The operation that obtains the status of a player is replaced by a new operation. |
|
| The type of the returned status value is changed from INTEGER to ENUM. This helps you understand and maintain the code with ease. |
The operation that obtains the stream connection type of a player is replaced by a new operation and a new class is added. |
|
| Rename the operation and add the new class. |
The operation that obtains information about the frame rate or bitrate of a player is replaced by a new operation and a new class is added. |
|
| Rename the operation and add the new class. |
The operations that configure callbacks for VOD players are replaced by new operations. |
|
LVPlayerCode setVodCompletionListener(ILVVodPlayerCompletionListener listener) | Merge multiple listeners into two listeners. |
The operations that configure external rendering for players are replaced by a new operation. |
|
| In V2.0.0 and later, LinkVisual Media SDK for Android supports callbacks for video data in the YUV format and callbacks for audio data in the PCM format. |
The operation that obtains a frame of YUV data is replaced by a new operation. |
|
| Rename the operation. |
Voice intercom
Change | 1.x.x | 2.x.x | Usage notes |
The SDK and the class are renamed. |
|
| Rename the SDK and the class. |
The operation that initializes a voice intercom session is replaced by a new operation. |
|
| In V2.0.0 and later, you do not need to specify an IoT device ID and voice intercom mode during the initialization of the SDK. You can specify an IoT device ID for the |
Return values are added to operations, such as | N/A | Enumerated return values:
| Check whether an operation is successful based on the return value. |
An operation that specifies a voice intercom mode is added. | None |
| In V2.0.0 and later, the DoubleTalkWithLive mode is added to voice intercom. In this mode, an IP camera must support acoustic echo cancellation (AEC), and the IP camera and the related app simultaneously collect and play audio. This mode requires live streaming channels with live streams because the audio is played over a live streaming channel of the IP camera. To select a live streaming channel before the voice intercom session starts, you canYou can call the |
The operation that starts a voice intercom session with an IP camera that is specified by a URL is replaced by a new operation. |
|
| Rename the operation. The values of the decryptIvBase64 and decryptKeyBase64 parameters are Base64-encoded strings. |
The operation that configures a listener for a voice intercom session is replaced by a new operation. |
|
| Rename the operation. |
The operation that implements the external voice change feature is replaced by a new operation. |
|
| Rename the operation. |
The operation that specifies an internal voice change type is replaced by a new operation. |
|
| Rename the operation. |