SDK integration FAQ

Updated at:

This topic provides solutions for common issues encountered when integrating the ApsaraVideo Live push streaming SDK or player SDK on Android, iOS, Flutter, and Web platforms.

Why is the AlivcLivePushInfoListener callback not triggered?

If the AlivcLivePushInfoListener push streaming callback is not triggered, troubleshoot the issue in the following order:

  1. Verify callback registration order. Register the callback by calling setLivePushInfoListener() before you call startPush(). If you register the callback after push streaming starts, events that occurred before registration are not delivered.

  2. Verify License registration. Call AlivcLiveBase.registerSDK() to complete License registration before you use the push streaming SDK. If this step is skipped, push streaming fails and callbacks may behave abnormally.

  3. Check the error listener. Error events are delivered through AlivcLivePushErrorListener, not AlivcLivePushInfoListener. Call getLastError() to retrieve the details of the most recent error.

How do I match Flutter plugin versions?

flutter_livepush_plugin and flutter_aliplayer must be used with matching versions. For example, version 7.11.0 must be paired with version 7.11.0-interactivelive. A version mismatch causes compilation or runtime failures.

Recommended Flutter version range: 2.8.0 to 3.22.2.

If integration fails, verify your environment by running the official demo with the recommended version combination first, then gradually replace the demo code with your own business logic.

What do I do if the Android stream ingest SDK demo has Java or Gradle compatibility issues?

When you run the official demo project for the Android stream ingest SDK, resolve compatibility issues in the following order:

  1. If the JDK version is incompatible, downgrade the JDK to version 17.

  2. If the error persists after you change the JDK, upgrade Gradle in the official demo project to version 8.5 or 8.9.

  3. If you cannot change the Gradle version in the official demo project, download and use the official demo APK to test stream ingest.

When you integrate the SDK into your own project, keep the existing Gradle configuration unchanged. The Gradle adjustment applies only to the official demo project.

Which Android versions does the player SDK support, and how do I troubleshoot a black screen on earlier Android versions?

The ApsaraVideo Live player SDK supports Android 9 and later. A black screen on an earlier Android version or an older device is usually not caused by an operating system version that is too low.

Possible causes include incomplete H.265 hardware decoding support on older devices and timing sensitivity during rendering view initialization. Focus troubleshooting on the H.265 hardware decoding capabilities of the device and the rendering view initialization sequence.

Can I dynamically switch between landscape and portrait mode during push streaming?

Dynamically switching between landscape and portrait mode is not supported during preview or push streaming.

To change the screen orientation, follow these steps:

  1. Call stopPreview to stop the current preview.

  2. Call setPreviewOrientation to set the target orientation.

  3. Call startPreview to restart the preview.

Note

If the video appears stretched after switching to landscape mode, add a delay of approximately 100 milliseconds before calling startPreview after setting the orientation.

If orientation settings have no effect in a cross-platform framework such as Flutter or UniApp, also check the following two items:

  • In hardcoded mode, set both the width and the height of the push streaming resolution to a multiple of 16. Otherwise, the video may appear stretched or encoding may fail.

  • Do not mix preview views with playback views. For push streaming preview, use the preview view type provided by the push streaming SDK. For playback, use the player's own view. Mixing them causes abnormal display or rendering failure.

What platforms does live interactive messaging support?

Live interactive messaging (IM) supports the following platforms:

  • Android

  • iOS

  • WeChat Mini Program

  • Web H5 (compatible with uni-app)

No Flutter SDK is available for live interactive messaging. For Flutter applications that require interactive messaging capabilities, you can implement this by bridging through a native plugin.

Do I need to use await when setting configuration parameters in the Flutter push streaming SDK?

No. You do not need to use await when you set pusherConfig parameters or call related methods.

How do I switch or adjust the preview view in the Android push streaming SDK?

You can call mAlivcLivePushConfig.setPreviewDisplayMode() to set the preview display mode. This method supports the following modes: fill the window, keep the aspect ratio, and crop to fit.

To dynamically change the preview view while push streaming is in progress, adjust the layout of the preview view's child views. For example, iterate over the subviews of the SurfaceView that was passed in startPreview and modify their frame values.

What should I do if the push streaming demo app does not work after installation?

  • Check whether your phone allows the installation of apps from unknown sources. If this permission is disabled, the app may be installed incompletely and fail to start.

  • The basic edition and the interactive edition are two separate installation packages with different feature scopes. Install the package that matches the scenario you want to verify. The two packages are not interchangeable.

  • If the problem persists, download the latest installation package from the help documentation, install it over the existing one, and confirm that the operating system version of your device is within the range supported by the SDK.