/APIExample_370_MPK_MediaIO

APIExample 370 with MPK using MediaIO to push video

Primary LanguageC++

API Example Android

English | 中文

Overview

This repository contains sample projects using the Agora RTC Java SDK for Android.

image

Project structure

The project uses a single app to combine a variety of functionalities. Each function is loaded as a fragment for you to play with.

Function Location
Audio live streaming JoinChannelAudio.java
Video live streaming JoinChannelVideo.java
Custom audio capture CustomAudioSource.java
Custom video renderer CustomRemoteVideoRender.java
Raw audio and video frames (JNI interface) ProcessRawData.java
Raw audio frames (Native Java interface) ProcessAudioRawData.java
Custom video capture (Push) PushExternalVideo.java
Switch a channel VideoQuickSwitch.java
Join multiple channels JoinMultipleChannel.java
Set Audio profile SetAudioProfile.java
Set Video profile SetVideoProfile.java
Play audio files and audio mixing PlayAudioFiles.java
Voice effects VoiceEffects.java
MediaPlayer Kit MediaPlayerKit.java
Geofencing GeoFencing.java
RTMP streaming RTMPStreaming.java
Audio/video stream custom encryption StreamEncrypt.java
Switch between custom video capture (MediaIO) and screen sharing SwitchExternalVideo.java
Video metadata VideoMetadata.java
Report call status InCallReport.java
Adjust volume AdjustVolume.java
Pre-call test PreCallTest.java
Channel media relay HostAcrossChannel.java
Super resolution SuperResolution.java
Audio/video stream encryption with methods provided by the SDK ChannelEncryption.java
Use multi-processing to send video streams from screen sharing and local camera MultiProcess.java
Switch role in live streaming LiveStreaming.java
Use custom video source (mediaIO) to implement AR function ARCore.java
Send data stream SendDataStream.java

How to run the sample project

Prerequisites

  • Physical Android device or Android simulator with Android 4.1+
  • Android Studio (latest version recommended)

Steps to run

  1. In Android Studio, open /Android/APIExample.

  2. Sync the project with Gradle files.

  3. Edit the /Android/APIExample/app/src/main/res/values/string_configs.xml file.

    • Replace YOUR APP ID with your App ID.
    • Replace YOUR ACCESS TOKEN with the Access Token.
    <string name="agora_app_id" translatable="false">YOUR APP ID</string>
    <string name="agora_access_token" translatable="false">YOUR ACCESS TOKEN</string>

    See Get Started with Agora to learn how to get an App ID and access token. You can get a temporary access token to quickly try out this sample project.

    The Channel name you used to generate the token must be the same as the channel name you use to join a channel.

    To ensure communication security, Agora uses access tokens (dynamic keys) to authenticate users joining a channel.

    Temporary access tokens are for demonstration and testing purposes only and remain valid for 24 hours. In a production environment, you need to deploy your own server for generating access tokens. See Generate a Token for details.

  4. Make the project and run the app in the simulator or connected physical Android device.

You are all set! Feel free to play with this sample project and explore features of the Agora RTC SDK.

Feedback

If you have any problems or suggestions regarding the sample projects, feel free to file an issue.

Reference

Related resources

  • Check our FAQ to see if your issue has been recorded.
  • Dive into Agora SDK Samples to see more tutorials
  • Take a look at Agora Use Case for more complicated real use case
  • Repositories managed by developer communities can be found at Agora Community
  • If you encounter problems during integration, feel free to ask questions in Stack Overflow

License

The sample projects are under the MIT license.