Talking about Anychat audio and video solution for Android video display problem

Source: Internet
Author: User

Recently, found that there are more friends feedback in the use of Anychat audio and video solutions, especially in the standard Android demo videoactivity video part of the code porting to its own project encountered local video black screen or remote video display can not be a problem. These problems were also encountered during the course of my development, where I made a simple summary and a corresponding solution to my own problem-solving experience.


1, local video black screen, not display


problem possible cause: no audio and video parameters are set, no Java acquisition mode

Workaround: Put the standard demo inside hallactivity The applyvideoconfig function in the class is ported to the project and is called after the SDK is initialized, as shown below

    1. Initializing the SDK

    2. Anychat. INITSDK (Android.os.Build.VERSION.SDK_INT, 0);

    3. Setting audio and Video parameters

    4. Applyvideoconfig ();

Copy Code

(Note: You need to set parameters after initialization to be valid)


2, local video can be displayed, remote video black screen, not display


possible causes of the problem: The remote video binding is not Surfaceview

Workaround: Call the binding code before requesting a remote video operation, as shown below

    1. If you are using Java video display, you need to set the callback of your surface

    2. if (Anychatcoresdk.getsdkoptionint (anychatdefine.brac_so_videoshow_driverctrl) = = Anychatdefine.videoshow_driver_ JAVA) {

    3. int index = Anychat.mVideoHelper.bindVideo (Otherview.getholder ());

    4. Anychat.mVideoHelper.SetVideoUser (index, UserID);

    5. }


    6. Request Remote Video

    7. Anychat. Usercameracontrol (UserID, 1);

    8. Anychat. Userspeakcontrol (UserID, 1);


Copy Code

(Note: This code needs to be called if there are multiple places to request remote video.) If you have a remote audio and video operation in both Onanychatonlineusermessage and onanychatuseratroommessage, you need to call the code above)


Talking about Anychat audio and video solution for Android video display problem

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.