├── MLVB-API-Example
├── .gitignore
├── Advanced
│ ├── CustomVideoCapture
│ │ ├── .gitignore
│ │ ├── build.gradle
│ │ ├── proguard-rules.pro
│ │ └── src
│ │ │ └── main
│ │ │ ├── AndroidManifest.xml
│ │ │ ├── java
│ │ │ └── com
│ │ │ │ └── tencent
│ │ │ │ └── mlvb
│ │ │ │ └── customvideocapture
│ │ │ │ ├── CustomVideoCaptureActivity.java
│ │ │ │ └── helper
│ │ │ │ ├── CustomCameraCapture.java
│ │ │ │ ├── CustomFrameRender.java
│ │ │ │ ├── basic
│ │ │ │ ├── Frame.java
│ │ │ │ ├── FrameBuffer.java
│ │ │ │ ├── Size.java
│ │ │ │ └── TextureFrame.java
│ │ │ │ └── render
│ │ │ │ ├── EGL10Helper.java
│ │ │ │ ├── EGL14Helper.java
│ │ │ │ ├── EGLHelper.java
│ │ │ │ ├── EglCore.java
│ │ │ │ └── opengl
│ │ │ │ ├── GPUImageFilter.java
│ │ │ │ ├── GPUImageFilterGroup.java
│ │ │ │ ├── GpuImageI420Filter.java
│ │ │ │ ├── OesInputFilter.java
│ │ │ │ ├── OpenGlUtils.java
│ │ │ │ ├── Program.java
│ │ │ │ ├── Rotation.java
│ │ │ │ └── TextureRotationUtils.java
│ │ │ └── res
│ │ │ ├── layout
│ │ │ └── customvideocaptureactivity_activity_custom_video_capture.xml
│ │ │ ├── values-en
│ │ │ └── strings.xml
│ │ │ └── values
│ │ │ ├── strings.xml
│ │ │ └── styles.xml
│ ├── HlsAutoBitrate
│ │ ├── .gitignore
│ │ ├── build.gradle
│ │ ├── proguard-rules.pro
│ │ └── src
│ │ │ └── main
│ │ │ ├── AndroidManifest.xml
│ │ │ ├── java
│ │ │ └── com
│ │ │ │ └── tencent
│ │ │ │ └── mlvb
│ │ │ │ └── hlsautobitrate
│ │ │ │ └── HlsAutoBitrateActivity.java
│ │ │ └── res
│ │ │ ├── layout
│ │ │ └── hlsautobitrate_activity_hls_auto_bitrate.xml
│ │ │ ├── values-en
│ │ │ └── strings.xml
│ │ │ └── values
│ │ │ ├── colors.xml
│ │ │ ├── strings.xml
│ │ │ └── styles.xml
│ ├── LebAutoBitrate
│ │ ├── .gitignore
│ │ ├── build.gradle
│ │ ├── proguard-rules.pro
│ │ └── src
│ │ │ └── main
│ │ │ ├── AndroidManifest.xml
│ │ │ ├── java
│ │ │ └── com
│ │ │ │ └── tencent
│ │ │ │ └── mlvb
│ │ │ │ └── lebautobitrate
│ │ │ │ └── LebAutoBitrateActivity.java
│ │ │ └── res
│ │ │ ├── layout
│ │ │ └── lebautobitrate_activity_leb_auto_bitrate.xml
│ │ │ ├── values-en
│ │ │ └── strings.xml
│ │ │ └── values
│ │ │ ├── colors.xml
│ │ │ ├── strings.xml
│ │ │ └── styles.xml
│ ├── NewTimeShiftSprite
│ │ ├── .gitignore
│ │ ├── build.gradle
│ │ ├── consumer-rules.pro
│ │ ├── proguard-rules.pro
│ │ └── src
│ │ │ └── main
│ │ │ ├── AndroidManifest.xml
│ │ │ ├── java
│ │ │ └── com
│ │ │ │ └── tencent
│ │ │ │ └── mlvb
│ │ │ │ └── newtimeshiftspriite
│ │ │ │ ├── NewTimeShiftSpriteActivity.java
│ │ │ │ └── TXSpriteImageFetcher.java
│ │ │ └── res
│ │ │ ├── layout
│ │ │ └── activity_new_time_shift_sprite.xml
│ │ │ ├── values-en
│ │ │ └── strings.xml
│ │ │ └── values
│ │ │ ├── colors.xml
│ │ │ ├── strings.xml
│ │ │ └── styles.xml
│ ├── PictureInPicture
│ │ ├── .gitignore
│ │ ├── build.gradle
│ │ ├── proguard-rules.pro
│ │ └── src
│ │ │ └── main
│ │ │ ├── AndroidManifest.xml
│ │ │ ├── java
│ │ │ └── com
│ │ │ │ └── tencent
│ │ │ │ └── mlvb
│ │ │ │ └── pictureinpicture
│ │ │ │ └── PictureInPictureActivity.java
│ │ │ └── res
│ │ │ ├── layout
│ │ │ └── activity_picture_in_picture.xml
│ │ │ ├── values-en
│ │ │ └── strings.xml
│ │ │ └── values
│ │ │ ├── color.xml.xml
│ │ │ ├── strings.xml
│ │ │ └── styles.xml
│ ├── RTCPushAndPlay
│ │ ├── .gitignore
│ │ ├── build.gradle
│ │ ├── proguard-rules.pro
│ │ └── src
│ │ │ └── main
│ │ │ ├── AndroidManifest.xml
│ │ │ ├── java
│ │ │ └── com
│ │ │ │ └── tencent
│ │ │ │ └── mlvb
│ │ │ │ └── rtcpushandplay
│ │ │ │ ├── RTCPushAndPlayAnchorActivity.java
│ │ │ │ ├── RTCPushAndPlayAudienceActivity.java
│ │ │ │ └── RTCPushAndPlayEnterActivity.java
│ │ │ └── res
│ │ │ ├── layout
│ │ │ ├── rtcpushandplay_activity_rtc_push_and_play_anchor.xml
│ │ │ ├── rtcpushandplay_activity_rtc_push_and_play_audience.xml
│ │ │ └── rtcpushandplay_activity_rtc_push_and_play_enter.xml
│ │ │ ├── values-en
│ │ │ └── strings.xml
│ │ │ └── values
│ │ │ ├── strings.xml
│ │ │ └── styles.xml
│ ├── SwitchRenderView
│ │ ├── .gitignore
│ │ ├── build.gradle
│ │ ├── proguard-rules.pro
│ │ └── src
│ │ │ └── main
│ │ │ ├── AndroidManifest.xml
│ │ │ ├── java
│ │ │ └── com
│ │ │ │ └── tencent
│ │ │ │ └── mlvb
│ │ │ │ └── switchrenderview
│ │ │ │ └── SwitchRenderViewActivity.java
│ │ │ └── res
│ │ │ ├── layout
│ │ │ └── switchrenderview_activity_switch_render_view.xml
│ │ │ ├── values-en
│ │ │ └── strings.xml
│ │ │ └── values
│ │ │ ├── colors.xml
│ │ │ ├── strings.xml
│ │ │ └── styles.xml
│ ├── ThirdBeauty
│ │ ├── .gitignore
│ │ ├── build.gradle
│ │ ├── proguard-rules.pro
│ │ └── src
│ │ │ └── main
│ │ │ ├── AndroidManifest.xml
│ │ │ ├── java
│ │ │ └── com
│ │ │ │ └── tencent
│ │ │ │ └── mlvb
│ │ │ │ └── thirdbeauty
│ │ │ │ ├── ThirdBeautyEntranceActivity.java
│ │ │ │ ├── ThirdBeautyFaceUnityActivity.java
│ │ │ │ └── ThirdBeautyTencentEffectActivity.java
│ │ │ └── res
│ │ │ ├── drawable
│ │ │ └── button_bg.xml
│ │ │ ├── layout
│ │ │ ├── activity_third_beauty_entrance.xml
│ │ │ ├── activity_third_beauty_tencent_effect.xml
│ │ │ └── thirdbeauty_activity_third_beauty.xml
│ │ │ ├── values-en
│ │ │ └── strings.xml
│ │ │ └── values
│ │ │ ├── colors.xml
│ │ │ ├── strings.xml
│ │ │ └── styles.xml
│ └── TimeShift
│ │ ├── .gitignore
│ │ ├── build.gradle
│ │ ├── consumer-rules.pro
│ │ ├── proguard-rules.pro
│ │ └── src
│ │ └── main
│ │ ├── AndroidManifest.xml
│ │ ├── java
│ │ └── com
│ │ │ └── tencent
│ │ │ └── mlvb
│ │ │ └── timeshift
│ │ │ ├── TimeShiftActivity.java
│ │ │ └── TimeShiftHelper.java
│ │ └── res
│ │ ├── layout
│ │ └── activity_time_shift.xml
│ │ ├── values-en
│ │ └── strings.xml
│ │ └── values
│ │ ├── colors.xml
│ │ ├── strings.xml
│ │ └── styles.xml
├── App
│ ├── .gitignore
│ ├── build.gradle
│ ├── proguard-rules.pro
│ └── src
│ │ └── main
│ │ ├── AndroidManifest.xml
│ │ ├── java
│ │ └── com
│ │ │ └── tencent
│ │ │ └── mlvb
│ │ │ └── apiexample
│ │ │ ├── MLVBApplication.java
│ │ │ └── MainActivity.java
│ │ └── res
│ │ ├── drawable
│ │ ├── button_bg.xml
│ │ └── ic_launcher.png
│ │ ├── layout
│ │ └── activity_main.xml
│ │ ├── mipmap-hdpi
│ │ └── ic_launcher.png
│ │ ├── mipmap-mdpi
│ │ └── ic_launcher.png
│ │ ├── mipmap-xhdpi
│ │ └── ic_launcher.png
│ │ ├── mipmap-xxhdpi
│ │ ├── ic_appicon.png
│ │ ├── ic_launch_image.png
│ │ └── ic_launcher.png
│ │ ├── mipmap-xxxhdpi
│ │ └── ic_launcher.png
│ │ ├── values-en
│ │ └── strings.xml
│ │ └── values
│ │ ├── colors.xml
│ │ ├── strings.xml
│ │ └── styles.xml
├── Basic
│ ├── LebPlay
│ │ ├── .gitignore
│ │ ├── build.gradle
│ │ ├── proguard-rules.pro
│ │ └── src
│ │ │ └── main
│ │ │ ├── AndroidManifest.xml
│ │ │ ├── java
│ │ │ └── com
│ │ │ │ └── tencent
│ │ │ │ └── liteav
│ │ │ │ └── sdk
│ │ │ │ └── lebplay
│ │ │ │ ├── LebPlayActivity.java
│ │ │ │ └── LebPlayEnterActivity.java
│ │ │ └── res
│ │ │ ├── layout
│ │ │ ├── lebplay_activity_leb_play.xml
│ │ │ └── lebplay_activity_leb_play_enter.xml
│ │ │ ├── values-en
│ │ │ └── strings.xml
│ │ │ └── values
│ │ │ ├── colors.xml
│ │ │ ├── strings.xml
│ │ │ └── styles.xml
│ ├── LiveLink
│ │ ├── .gitignore
│ │ ├── build.gradle
│ │ ├── proguard-rules.pro
│ │ └── src
│ │ │ └── main
│ │ │ ├── AndroidManifest.xml
│ │ │ ├── java
│ │ │ └── com
│ │ │ │ └── tencent
│ │ │ │ └── mlvb
│ │ │ │ └── livelink
│ │ │ │ ├── LiveLinkAnchorActivity.java
│ │ │ │ ├── LiveLinkAudienceActivity.java
│ │ │ │ └── LiveLinkEnterActivity.java
│ │ │ └── res
│ │ │ ├── drawable
│ │ │ ├── livelink_selector_role_btn_bg.xml
│ │ │ ├── livelink_start_link.png
│ │ │ └── livelink_stop_link.png
│ │ │ ├── layout
│ │ │ ├── livelink_activity_live_link_anchor.xml
│ │ │ ├── livelink_activity_live_link_audience.xml
│ │ │ └── livelink_activity_live_link_enter.xml
│ │ │ ├── values-en
│ │ │ └── strings.xml
│ │ │ └── values
│ │ │ ├── colors.xml
│ │ │ ├── strings.xml
│ │ │ └── styles.xml
│ ├── LivePK
│ │ ├── .gitignore
│ │ ├── build.gradle
│ │ ├── proguard-rules.pro
│ │ └── src
│ │ │ └── main
│ │ │ ├── AndroidManifest.xml
│ │ │ ├── java
│ │ │ └── com
│ │ │ │ └── tencent
│ │ │ │ └── mlvb
│ │ │ │ └── linkpk
│ │ │ │ ├── LivePKAnchorActivity.java
│ │ │ │ ├── LivePKAudienceActivity.java
│ │ │ │ └── LivePKEnterActivity.java
│ │ │ └── res
│ │ │ ├── drawable
│ │ │ ├── livepk_selector_role_btn_bg.xml
│ │ │ ├── livepk_start_link.png
│ │ │ └── livepk_stop_link.png
│ │ │ ├── layout
│ │ │ ├── livepk_activity_live_pk_anchor.xml
│ │ │ ├── livepk_activity_live_pk_audience.xml
│ │ │ └── livepk_activity_live_pk_enter.xml
│ │ │ ├── values-en
│ │ │ └── strings.xml
│ │ │ └── values
│ │ │ ├── colors.xml
│ │ │ ├── strings.xml
│ │ │ └── styles.xml
│ ├── LivePlay
│ │ ├── .gitignore
│ │ ├── build.gradle
│ │ ├── proguard-rules.pro
│ │ └── src
│ │ │ └── main
│ │ │ ├── AndroidManifest.xml
│ │ │ ├── java
│ │ │ └── com
│ │ │ │ └── tencent
│ │ │ │ └── mlvb
│ │ │ │ └── liveplay
│ │ │ │ ├── LivePlayActivity.java
│ │ │ │ └── LivePlayEnterActivity.java
│ │ │ └── res
│ │ │ ├── layout
│ │ │ ├── liveplay_activity_live_play.xml
│ │ │ └── liveplay_activity_live_play_enter.xml
│ │ │ ├── values-en
│ │ │ └── strings.xml
│ │ │ └── values
│ │ │ ├── colors.xml
│ │ │ ├── strings.xml
│ │ │ └── styles.xml
│ ├── LivePushCamera
│ │ ├── .gitignore
│ │ ├── build.gradle
│ │ ├── proguard-rules.pro
│ │ └── src
│ │ │ └── main
│ │ │ ├── AndroidManifest.xml
│ │ │ ├── java
│ │ │ └── com
│ │ │ │ └── tencent
│ │ │ │ └── mlvb
│ │ │ │ └── livepushcamera
│ │ │ │ ├── LivePushCameraActivity.java
│ │ │ │ └── LivePushCameraEnterActivity.java
│ │ │ └── res
│ │ │ ├── drawable
│ │ │ └── livepusher_content_bg.xml
│ │ │ ├── layout
│ │ │ ├── livepushcamera_activity_push_camera.xml
│ │ │ └── livepushcamera_activity_push_camera_enter.xml
│ │ │ ├── menu
│ │ │ ├── livepushcamera_mirror.xml
│ │ │ ├── livepushcamera_resolution.xml
│ │ │ └── livepushcamera_rotate.xml
│ │ │ ├── mipmap-xxhdpi
│ │ │ ├── app_ic_bottom_camera_back.png
│ │ │ ├── app_ic_bottom_camera_front.png
│ │ │ ├── app_ic_bottom_mic_off.png
│ │ │ ├── app_ic_bottom_mic_on.png
│ │ │ ├── app_ic_close.png
│ │ │ ├── app_ic_ic_back.png
│ │ │ ├── app_ic_plus.png
│ │ │ ├── app_ic_remote_video_off.png
│ │ │ └── app_ic_remote_video_on.png
│ │ │ ├── values-en
│ │ │ └── strings.xml
│ │ │ └── values
│ │ │ ├── colors.xml
│ │ │ ├── strings.xml
│ │ │ └── styles.xml
│ └── LivePushScreen
│ │ ├── .gitignore
│ │ ├── build.gradle
│ │ ├── proguard-rules.pro
│ │ └── src
│ │ └── main
│ │ ├── AndroidManifest.xml
│ │ ├── java
│ │ └── com
│ │ │ └── tencent
│ │ │ └── mlvb
│ │ │ └── livepushscreen
│ │ │ ├── LivePushScreenActivity.java
│ │ │ └── LivePushScreenEnterActivity.java
│ │ └── res
│ │ ├── drawable
│ │ └── livepusher_content_bg.xml
│ │ ├── layout
│ │ ├── livepushscreen_activity_push_screen.xml
│ │ └── livepushscreen_activity_push_screen_enter.xml
│ │ ├── values-en
│ │ └── strings.xml
│ │ └── values
│ │ ├── strings.xml
│ │ └── styles.xml
├── Common
│ ├── .gitignore
│ ├── build.gradle
│ ├── proguard-rules.pro
│ └── src
│ │ └── main
│ │ ├── AndroidManifest.xml
│ │ ├── java
│ │ └── com
│ │ │ └── tencent
│ │ │ └── mlvb
│ │ │ └── common
│ │ │ ├── FlowRadioGroup.java
│ │ │ ├── MLVBBaseActivity.java
│ │ │ └── URLUtils.java
│ │ └── res
│ │ ├── drawable
│ │ ├── common_arrow_above.png
│ │ ├── common_button_bg.xml
│ │ ├── common_button_grey_bg.xml
│ │ ├── common_edit_bg.xml
│ │ ├── common_ic_select_off.png
│ │ ├── common_ic_select_on.png
│ │ ├── common_rb_icon_selector.xml
│ │ ├── common_seekbar_style.xml
│ │ ├── common_seekbar_thumb.xml
│ │ └── common_selector_radio_bg.xml
│ │ ├── mipmap-xxhdpi
│ │ ├── common_ic_back.png
│ │ └── common_user_portrait.png
│ │ ├── values-en
│ │ └── strings.xml
│ │ └── values
│ │ ├── colors.xml
│ │ └── strings.xml
├── Debug
│ ├── build.gradle
│ ├── proguard-rules.pro
│ └── src
│ │ └── main
│ │ ├── AndroidManifest.xml
│ │ └── java
│ │ └── com
│ │ └── tencent
│ │ └── mlvb
│ │ └── debug
│ │ └── GenerateTestUserSig.java
├── README-zh_CN.md
├── README.md
├── build.gradle
├── gradle.properties
├── gradle
│ └── wrapper
│ │ ├── gradle-wrapper.jar
│ │ └── gradle-wrapper.properties
├── gradlew
├── gradlew.bat
└── settings.gradle
├── README.md
└── SDK
├── README-zh_CN.md
└── README.md
/MLVB-API-Example/.gitignore:
--------------------------------------------------------------------------------
1 | *.iml
2 | *.gradle/
3 | /local.properties
4 | *.idea/
5 | .DS_Store
6 | /build
7 | /build.yml
--------------------------------------------------------------------------------
/MLVB-API-Example/Advanced/CustomVideoCapture/.gitignore:
--------------------------------------------------------------------------------
1 | /build
--------------------------------------------------------------------------------
/MLVB-API-Example/Advanced/CustomVideoCapture/build.gradle:
--------------------------------------------------------------------------------
1 | apply plugin: 'com.android.library'
2 |
3 | android {
4 | compileSdkVersion rootProject.ext.compileSdkVersion
5 | buildToolsVersion rootProject.ext.buildToolsVersion
6 |
7 | defaultConfig {
8 | minSdkVersion rootProject.ext.minSdkVersion
9 | targetSdkVersion rootProject.ext.targetSdkVersion
10 | versionCode 1
11 | versionName "1.0"
12 | ndk {
13 | abiFilters "armeabi-v7a", "arm64-v8a"
14 | }
15 | }
16 |
17 | buildTypes {
18 | release {
19 | minifyEnabled false
20 | proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
21 | }
22 | }
23 | }
24 |
25 | dependencies {
26 | implementation fileTree(dir: "libs", include: ["*.jar"])
27 | implementation rootProject.ext.liteavSdk
28 | implementation 'androidx.appcompat:appcompat:1.1.0'
29 | implementation project(':Debug')
30 | implementation project(':Common')
31 | }
--------------------------------------------------------------------------------
/MLVB-API-Example/Advanced/CustomVideoCapture/proguard-rules.pro:
--------------------------------------------------------------------------------
1 | # Add project specific ProGuard rules here.
2 | # You can control the set of applied configuration files using the
3 | # proguardFiles setting in build.gradle.
4 | #
5 | # For more details, see
6 | # http://developer.android.com/guide/developing/tools/proguard.html
7 |
8 | # If your project uses WebView with JS, uncomment the following
9 | # and specify the fully qualified class name to the JavaScript interface
10 | # class:
11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview {
12 | # public *;
13 | #}
14 |
15 | # Uncomment this to preserve the line number information for
16 | # debugging stack traces.
17 | #-keepattributes SourceFile,LineNumberTable
18 |
19 | # If you keep the line number information, uncomment this to
20 | # hide the original source file name.
21 | #-renamesourcefileattribute SourceFile
--------------------------------------------------------------------------------
/MLVB-API-Example/Advanced/CustomVideoCapture/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
10 |
11 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/MLVB-API-Example/Advanced/CustomVideoCapture/src/main/java/com/tencent/mlvb/customvideocapture/helper/basic/Frame.java:
--------------------------------------------------------------------------------
1 | package com.tencent.mlvb.customvideocapture.helper.basic;
2 |
3 | import android.media.MediaCodec;
4 | import android.media.MediaCodec.BufferInfo;
5 |
6 | import java.nio.ByteBuffer;
7 |
8 | public class Frame {
9 | /**
10 | * The data contained in this frame, this buffer may be returned from {@link MediaCodec#getInputBuffers()},
11 | * Needs to be returned to MediaCodec after use is completed.
12 | */
13 | public ByteBuffer buffer;
14 |
15 | /**
16 | * If {@link Frame#buffer} is returned from another module, this member records its index.
17 | */
18 | public int bufferIndex;
19 |
20 | /**
21 | * Identifies which byte in the cache starts to be valid data.
22 | */
23 | public int offset;
24 |
25 | /**
26 | * Identifies the length of valid data in the cache.
27 | */
28 | public int size;
29 |
30 | /**
31 | * The display time corresponding to this data
32 | */
33 | public long presentationTimeUs;
34 |
35 | /**
36 | * Some flags, see {@link BufferInfo#flags} for details
37 | */
38 | public int flags;
39 | }
40 |
--------------------------------------------------------------------------------
/MLVB-API-Example/Advanced/CustomVideoCapture/src/main/java/com/tencent/mlvb/customvideocapture/helper/basic/FrameBuffer.java:
--------------------------------------------------------------------------------
1 | package com.tencent.mlvb.customvideocapture.helper.basic;
2 |
3 | import android.opengl.GLES20;
4 | import android.util.Log;
5 |
6 | import com.tencent.mlvb.customvideocapture.helper.render.opengl.OpenGlUtils;
7 |
8 |
9 | public class FrameBuffer {
10 | private static final String TAG = "FrameBuffer";
11 |
12 | private final int mWidth;
13 | private final int mHeight;
14 | private int mTextureId;
15 | private int mFrameBufferId;
16 |
17 | public FrameBuffer(int width, int height) {
18 | mWidth = width;
19 | mHeight = height;
20 | }
21 |
22 | public void initialize() {
23 | mTextureId = OpenGlUtils.loadTexture(GLES20.GL_RGBA, null, mWidth, mHeight, OpenGlUtils.NO_TEXTURE);
24 | mFrameBufferId = OpenGlUtils.generateFrameBufferId();
25 | Log.i(TAG, String.format("create frameBufferId: %d, textureId: %d", mFrameBufferId, mTextureId));
26 |
27 | GLES20.glBindTexture(GLES20.GL_TEXTURE_2D, mTextureId);
28 | GLES20.glBindFramebuffer(GLES20.GL_FRAMEBUFFER, mFrameBufferId);
29 | GLES20.glFramebufferTexture2D(GLES20.GL_FRAMEBUFFER, GLES20.GL_COLOR_ATTACHMENT0,
30 | GLES20.GL_TEXTURE_2D, mTextureId, 0);
31 | GLES20.glBindTexture(GLES20.GL_TEXTURE_2D, 0);
32 | GLES20.glBindFramebuffer(GLES20.GL_FRAMEBUFFER, 0);
33 | }
34 |
35 | public int getTextureId() {
36 | return mTextureId;
37 | }
38 |
39 | public int getFrameBufferId() {
40 | return mFrameBufferId;
41 | }
42 |
43 | public void uninitialize() {
44 | Log.i(TAG, String.format("destroy frameBufferId: %d, textureId: %d", mFrameBufferId, mTextureId));
45 | OpenGlUtils.deleteTexture(mTextureId);
46 | mTextureId = OpenGlUtils.NO_TEXTURE;
47 | OpenGlUtils.deleteFrameBuffer(mFrameBufferId);
48 | mFrameBufferId = OpenGlUtils.NO_TEXTURE;
49 | }
50 | }
51 |
--------------------------------------------------------------------------------
/MLVB-API-Example/Advanced/CustomVideoCapture/src/main/java/com/tencent/mlvb/customvideocapture/helper/basic/Size.java:
--------------------------------------------------------------------------------
1 | package com.tencent.mlvb.customvideocapture.helper.basic;
2 |
3 | public class Size {
4 | public int width;
5 | public int height;
6 |
7 | public Size() {
8 | }
9 |
10 | public Size(int width, int height) {
11 | this.width = width;
12 | this.height = height;
13 | }
14 |
15 | @SuppressWarnings("SuspiciousNameCombination")
16 | public void swap() {
17 | int temp = width;
18 | width = height;
19 | height = temp;
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/MLVB-API-Example/Advanced/CustomVideoCapture/src/main/java/com/tencent/mlvb/customvideocapture/helper/basic/TextureFrame.java:
--------------------------------------------------------------------------------
1 | package com.tencent.mlvb.customvideocapture.helper.basic;
2 |
3 | import android.opengl.EGLContext;
4 |
5 | public class TextureFrame {
6 | public EGLContext eglContext;
7 |
8 | public int textureId;
9 |
10 | public int width;
11 |
12 | public int height;
13 |
14 | public long timestampMs;
15 | }
16 |
--------------------------------------------------------------------------------
/MLVB-API-Example/Advanced/CustomVideoCapture/src/main/java/com/tencent/mlvb/customvideocapture/helper/render/EGLHelper.java:
--------------------------------------------------------------------------------
1 | package com.tencent.mlvb.customvideocapture.helper.render;
2 |
3 | /**
4 | * Android has two sets of EGL classes.
5 | * For convenience of use, they are abstracted and only the following interfaces are provided.
6 | *
7 | * @param
8 | */
9 | public interface EGLHelper {
10 | /**
11 | * Returns EGLContext, used to create shared EGLContext, etc.
12 | */
13 | T getContext();
14 |
15 | /**
16 | * Bind EGLContext to the current thread, as well as the draw Surface and read Surface saved in Helper.
17 | */
18 | void makeCurrent();
19 |
20 | /**
21 | * Unbind the EGLContext, draw Surface, and read Surface bound to the current thread.
22 | */
23 | void unmakeCurrent();
24 |
25 | /**
26 | * Brush rendered content onto the bound draw target.
27 | */
28 | boolean swapBuffers();
29 |
30 | /**
31 | * Destroy the created EGLContext and related resources.
32 | */
33 | void destroy();
34 | }
35 |
--------------------------------------------------------------------------------
/MLVB-API-Example/Advanced/CustomVideoCapture/src/main/java/com/tencent/mlvb/customvideocapture/helper/render/EglCore.java:
--------------------------------------------------------------------------------
1 | package com.tencent.mlvb.customvideocapture.helper.render;
2 |
3 | import android.annotation.TargetApi;
4 | import android.view.Surface;
5 |
6 | /**
7 | * When eglMakeCurrent, you need to associate the Context and the window (or Surface), so combine the two.
8 | */
9 | public class EglCore {
10 | private EGLHelper mEglHelper;
11 |
12 | /**
13 | * Create an EglCore, in which the window is an off-screen Surface and does not share other EGLContext
14 | *
15 | * @param width The width of the off-screen Surface
16 | * @param height The height of the off-screen Surface
17 | */
18 | public EglCore(int width, int height) {
19 | this((android.opengl.EGLContext) null, width, height);
20 | }
21 |
22 | /**
23 | * Create an EglCore, the window is the incoming Surface, and do not share other EGLContext
24 | *
25 | * @param surface The rendering target of the newly created EGLContext
26 | */
27 | public EglCore(Surface surface) {
28 | this((android.opengl.EGLContext) null, surface);
29 | }
30 |
31 | /**
32 | * Create an EglCore and associate it with an off-screen surface
33 | *
34 | * @param sharedContext used for shared OpenGL Context, can be null
35 | * @param width The width of the off-screen surface
36 | * @param height The height of the off-screen surface
37 | */
38 | public EglCore(android.opengl.EGLContext sharedContext, int width, int height) {
39 | mEglHelper = EGL14Helper.createEGLSurface(null, sharedContext, null, width, height);
40 | }
41 |
42 | /**
43 | * Create an EglCore and associate it with an off-screen surface
44 | *
45 | * @param sharedContext used for shared OpenGL Context, can be null
46 | * @param width The width of the off-screen surface
47 | * @param height The height of the off-screen surface
48 | */
49 | public EglCore(javax.microedition.khronos.egl.EGLContext sharedContext, int width, int height) {
50 | mEglHelper = EGL10Helper.createEGLSurface(null, sharedContext, null, width, height);
51 | }
52 |
53 | /**
54 | * Create an EglCore and associate it with the incoming surface
55 | *
56 | * @param sharedContext used for shared OpenGL Context, can be null
57 | * @param surface rendering target
58 | */
59 | public EglCore(android.opengl.EGLContext sharedContext, Surface surface) {
60 | mEglHelper = EGL14Helper.createEGLSurface(null, sharedContext, surface, 0, 0);
61 | }
62 |
63 | /**
64 | * Create an EglCore and associate it with the incoming surface
65 | *
66 | * @param sharedContext used for shared OpenGL Context, can be null
67 | * @param surface rendering target
68 | */
69 | public EglCore(javax.microedition.khronos.egl.EGLContext sharedContext, Surface surface) {
70 | mEglHelper = EGL10Helper.createEGLSurface(null, sharedContext, surface, 0, 0);
71 | }
72 |
73 | public void makeCurrent() {
74 | mEglHelper.makeCurrent();
75 | }
76 |
77 | public void unmakeCurrent() {
78 | mEglHelper.unmakeCurrent();
79 | }
80 |
81 | public void swapBuffer() {
82 | mEglHelper.swapBuffers();
83 | }
84 |
85 | public Object getEglContext() {
86 | return mEglHelper.getContext();
87 | }
88 |
89 | public void destroy() {
90 | mEglHelper.destroy();
91 | mEglHelper = null;
92 | }
93 |
94 | @TargetApi(18)
95 | public void setPresentationTime(long nsecs) {
96 | if (mEglHelper instanceof EGL14Helper) {
97 | ((EGL14Helper) mEglHelper).setPresentationTime(nsecs);
98 | }
99 | }
100 | }
101 |
102 |
--------------------------------------------------------------------------------
/MLVB-API-Example/Advanced/CustomVideoCapture/src/main/java/com/tencent/mlvb/customvideocapture/helper/render/opengl/OesInputFilter.java:
--------------------------------------------------------------------------------
1 | package com.tencent.mlvb.customvideocapture.helper.render.opengl;
2 |
3 | import android.opengl.GLES11Ext;
4 | import android.opengl.GLES20;
5 |
6 | public class OesInputFilter extends GPUImageFilter {
7 | private static final String OES_INPUT_VERTEX_SHADER = ""
8 | + "attribute vec4 position;\n"
9 | + "attribute vec4 inputTextureCoordinate;\n"
10 | + "uniform mat4 textureTransform;\n"
11 | + "\n"
12 | + "varying highp vec2 textureCoordinate;\n"
13 | + "void main()\n"
14 | + "{\n"
15 | + " gl_Position = position;\n"
16 | + " textureCoordinate = (textureTransform * inputTextureCoordinate).xy;\n"
17 | + "}\n";
18 |
19 | private static final String OES_INPUT_FRAGMENT_SHADER = ""
20 | + "#extension GL_OES_EGL_image_external : require\n"
21 | + "precision mediump float;\n"
22 | + "varying highp vec2 textureCoordinate;\n"
23 | + " \n"
24 | + "uniform samplerExternalOES inputImageTexture;\n"
25 | + " \n"
26 | + "void main()\n"
27 | + "{\n"
28 | + " gl_FragColor = texture2D(inputImageTexture, textureCoordinate);\n"
29 | + "}";
30 |
31 | protected int mTextureTransform;
32 |
33 | public OesInputFilter() {
34 | super(OES_INPUT_VERTEX_SHADER, OES_INPUT_FRAGMENT_SHADER);
35 | }
36 |
37 | public OesInputFilter(final String vertexShader, final String fragmentShader) {
38 | super(vertexShader, fragmentShader);
39 | }
40 |
41 | @Override
42 | public int getTarget() {
43 | return GLES11Ext.GL_TEXTURE_EXTERNAL_OES;
44 | }
45 |
46 | @Override
47 | public void onInit() {
48 | super.onInit();
49 | mTextureTransform = GLES20.glGetUniformLocation(mProgram.getProgramId(), "textureTransform");
50 | }
51 |
52 | @Override
53 | protected void beforeDrawArrays(int textureId) {
54 | super.beforeDrawArrays(textureId);
55 | GLES20.glUniformMatrix4fv(mTextureTransform, 1, false, mTextureMatrix, 0);
56 | }
57 | }
58 |
--------------------------------------------------------------------------------
/MLVB-API-Example/Advanced/CustomVideoCapture/src/main/java/com/tencent/mlvb/customvideocapture/helper/render/opengl/Program.java:
--------------------------------------------------------------------------------
1 | package com.tencent.mlvb.customvideocapture.helper.render.opengl;
2 |
3 | import android.opengl.GLES20;
4 | import android.util.Log;
5 |
6 | public class Program {
7 | private static final String TAG = "Program";
8 | private static final int INVALID_PROGRAM_ID = -1;
9 |
10 | private final String mVertexShader;
11 | private final String mFragmentShader;
12 | private int mProgramId;
13 |
14 | public Program(String vertexShader, String fragmentShader) {
15 | mVertexShader = vertexShader;
16 | mFragmentShader = fragmentShader;
17 | mProgramId = INVALID_PROGRAM_ID;
18 | }
19 |
20 | /**
21 | * create programId 。
22 | */
23 | public void build() {
24 | int vertexShaderId = loadShader(mVertexShader, GLES20.GL_VERTEX_SHADER);
25 | if (vertexShaderId == 0) {
26 | Log.e(TAG, "load vertex shader failed.");
27 | return;
28 | }
29 |
30 | int fragmentShaderId = loadShader(mFragmentShader, GLES20.GL_FRAGMENT_SHADER);
31 | if (fragmentShaderId == 0) {
32 | Log.e(TAG, "load fragment shader failed.");
33 | return;
34 | }
35 |
36 | int programId = GLES20.glCreateProgram();
37 | GLES20.glAttachShader(programId, vertexShaderId);
38 | GLES20.glAttachShader(programId, fragmentShaderId);
39 | GLES20.glLinkProgram(programId);
40 |
41 | int[] link = new int[1];
42 | GLES20.glGetProgramiv(programId, GLES20.GL_LINK_STATUS, link, 0);
43 | if (link[0] <= 0) {
44 | Log.e(TAG, "link program failed. status: " + link[0]);
45 | return;
46 | }
47 |
48 | GLES20.glDeleteShader(vertexShaderId);
49 | GLES20.glDeleteShader(fragmentShaderId);
50 | mProgramId = programId;
51 | }
52 |
53 | public int getProgramId() {
54 | return mProgramId;
55 | }
56 |
57 | public void destroy() {
58 | GLES20.glDeleteProgram(mProgramId);
59 | mProgramId = INVALID_PROGRAM_ID;
60 | }
61 |
62 | private int loadShader(final String strSource, final int iType) {
63 | int[] compiled = new int[1];
64 | int iShader = GLES20.glCreateShader(iType);
65 | GLES20.glShaderSource(iShader, strSource);
66 | GLES20.glCompileShader(iShader);
67 | GLES20.glGetShaderiv(iShader, GLES20.GL_COMPILE_STATUS, compiled, 0);
68 | if (compiled[0] == 0) {
69 | OpenGlUtils.checkGlError("glCompileShader");
70 | return 0;
71 | }
72 | return iShader;
73 | }
74 | }
75 |
--------------------------------------------------------------------------------
/MLVB-API-Example/Advanced/CustomVideoCapture/src/main/java/com/tencent/mlvb/customvideocapture/helper/render/opengl/Rotation.java:
--------------------------------------------------------------------------------
1 | package com.tencent.mlvb.customvideocapture.helper.render.opengl;
2 |
3 | public enum Rotation {
4 | NORMAL, ROTATION_90, ROTATION_180, ROTATION_270;
5 |
6 | /**
7 | * Create a Rotation from an integer. Needs to be either 0, 90, 180 or 270.
8 | *
9 | * @param rotation 0, 90, 180 or 270
10 | * @return Rotation object
11 | */
12 | public static Rotation fromInt(int rotation) {
13 | switch (rotation) {
14 | case 0:
15 | return NORMAL;
16 | case 90:
17 | return ROTATION_90;
18 | case 180:
19 | return ROTATION_180;
20 | case 270:
21 | return ROTATION_270;
22 | case 360:
23 | return NORMAL;
24 | default:
25 | return NORMAL;
26 | }
27 | }
28 |
29 | /**
30 | * Retrieves the int representation of the Rotation.
31 | *
32 | * @return 0, 90, 180 or 270
33 | */
34 | public int asInt() {
35 | switch (this) {
36 | case NORMAL:
37 | return 0;
38 | case ROTATION_90:
39 | return 90;
40 | case ROTATION_180:
41 | return 180;
42 | case ROTATION_270:
43 | return 270;
44 | default:
45 | return 0;
46 | }
47 | }
48 | }
49 |
--------------------------------------------------------------------------------
/MLVB-API-Example/Advanced/CustomVideoCapture/src/main/java/com/tencent/mlvb/customvideocapture/helper/render/opengl/TextureRotationUtils.java:
--------------------------------------------------------------------------------
1 | package com.tencent.mlvb.customvideocapture.helper.render.opengl;
2 |
3 | public class TextureRotationUtils {
4 | public static final float[] TEXTURE_NO_ROTATION = {0.0f, 1.0f, 1.0f, 1.0f, 0.0f, 0.0f, 1.0f, 0.0f};
5 | public static final float[] TEXTURE_ROTATED_90 = {1.0f, 1.0f, 1.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f};
6 | public static final float[] TEXTURE_ROTATED_180 = {1.0f, 0.0f, 0.0f, 0.0f, 1.0f, 1.0f, 0.0f, 1.0f};
7 | public static final float[] TEXTURE_ROTATED_270 = {0.0f, 0.0f, 0.0f, 1.0f, 1.0f, 0.0f, 1.0f, 1.0f};
8 |
9 | private TextureRotationUtils() {
10 | }
11 |
12 | /**
13 | * Gets the rotation direction of the Texture.
14 | */
15 | public static float[] getRotation(final Rotation rotation,
16 | final boolean flipHorizontal,
17 | final boolean flipVertical) {
18 | float[] rotatedTex;
19 | switch (rotation) {
20 | case ROTATION_90:
21 | rotatedTex = TEXTURE_ROTATED_90;
22 | break;
23 | case ROTATION_180:
24 | rotatedTex = TEXTURE_ROTATED_180;
25 | break;
26 | case ROTATION_270:
27 | rotatedTex = TEXTURE_ROTATED_270;
28 | break;
29 | case NORMAL:
30 | default:
31 | rotatedTex = TEXTURE_NO_ROTATION;
32 | break;
33 | }
34 |
35 | if (flipHorizontal) {
36 | rotatedTex = new float[]{
37 | flip(rotatedTex[0]), rotatedTex[1],
38 | flip(rotatedTex[2]), rotatedTex[3],
39 | flip(rotatedTex[4]), rotatedTex[5],
40 | flip(rotatedTex[6]), rotatedTex[7]};
41 | }
42 | if (flipVertical) {
43 | rotatedTex = new float[]{
44 | rotatedTex[0], flip(rotatedTex[1]),
45 | rotatedTex[2], flip(rotatedTex[3]),
46 | rotatedTex[4], flip(rotatedTex[5]),
47 | rotatedTex[6], flip(rotatedTex[7])};
48 | }
49 | return rotatedTex;
50 | }
51 |
52 | private static float flip(final float i) {
53 | if (i == 0.0f) {
54 | return 1.0f;
55 | }
56 | return 0.0f;
57 | }
58 | }
59 |
--------------------------------------------------------------------------------
/MLVB-API-Example/Advanced/CustomVideoCapture/src/main/res/layout/customvideocaptureactivity_activity_custom_video_capture.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
11 |
12 |
15 |
16 |
23 |
24 |
32 |
33 |
34 |
41 |
42 |
47 |
48 |
54 |
55 |
63 |
64 |
65 |
78 |
79 |
80 |
81 |
--------------------------------------------------------------------------------
/MLVB-API-Example/Advanced/CustomVideoCapture/src/main/res/values-en/strings.xml:
--------------------------------------------------------------------------------
1 |
2 | live
3 | Stream ID
4 | Stop
5 | Publish
6 |
7 |
--------------------------------------------------------------------------------
/MLVB-API-Example/Advanced/CustomVideoCapture/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 | live
3 | 请输入streamId
4 | 停止推流
5 | 开始推流
6 |
7 |
--------------------------------------------------------------------------------
/MLVB-API-Example/Advanced/CustomVideoCapture/src/main/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
5 |
7 |
8 |
17 |
18 |
22 |
23 |
24 |
--------------------------------------------------------------------------------
/MLVB-API-Example/Advanced/HlsAutoBitrate/.gitignore:
--------------------------------------------------------------------------------
1 | /build
--------------------------------------------------------------------------------
/MLVB-API-Example/Advanced/HlsAutoBitrate/build.gradle:
--------------------------------------------------------------------------------
1 | apply plugin: 'com.android.library'
2 |
3 | android {
4 | compileSdkVersion rootProject.ext.compileSdkVersion
5 | buildToolsVersion rootProject.ext.buildToolsVersion
6 |
7 | defaultConfig {
8 | minSdkVersion rootProject.ext.minSdkVersion
9 | targetSdkVersion rootProject.ext.targetSdkVersion
10 | versionCode 1
11 | versionName "1.0"
12 | ndk {
13 | abiFilters "armeabi-v7a", "arm64-v8a"
14 | }
15 | }
16 |
17 | buildTypes {
18 | release {
19 | minifyEnabled false
20 | proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
21 | }
22 | }
23 | }
24 |
25 | dependencies {
26 | implementation fileTree(dir: "libs", include: ["*.jar"])
27 | implementation rootProject.ext.liteavSdk
28 | implementation 'androidx.appcompat:appcompat:1.1.0'
29 | implementation project(':Debug')
30 | implementation project(':Common')
31 | }
--------------------------------------------------------------------------------
/MLVB-API-Example/Advanced/HlsAutoBitrate/proguard-rules.pro:
--------------------------------------------------------------------------------
1 | # Add project specific ProGuard rules here.
2 | # You can control the set of applied configuration files using the
3 | # proguardFiles setting in build.gradle.
4 | #
5 | # For more details, see
6 | # http://developer.android.com/guide/developing/tools/proguard.html
7 |
8 | # If your project uses WebView with JS, uncomment the following
9 | # and specify the fully qualified class name to the JavaScript interface
10 | # class:
11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview {
12 | # public *;
13 | #}
14 |
15 | # Uncomment this to preserve the line number information for
16 | # debugging stack traces.
17 | #-keepattributes SourceFile,LineNumberTable
18 |
19 | # If you keep the line number information, uncomment this to
20 | # hide the original source file name.
21 | #-renamesourcefileattribute SourceFile
--------------------------------------------------------------------------------
/MLVB-API-Example/Advanced/HlsAutoBitrate/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
7 |
11 |
12 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/MLVB-API-Example/Advanced/HlsAutoBitrate/src/main/res/layout/hlsautobitrate_activity_hls_auto_bitrate.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
10 |
11 |
18 |
19 |
28 |
29 |
30 |
36 |
37 |
38 |
45 |
46 |
47 |
58 |
59 |
71 |
72 |
84 |
85 |
86 |
98 |
99 |
--------------------------------------------------------------------------------
/MLVB-API-Example/Advanced/HlsAutoBitrate/src/main/res/values-en/strings.xml:
--------------------------------------------------------------------------------
1 |
2 | live
3 | HLS Auto Bitrate Play
4 | Switch To 1080P
5 | Switch To 720P
6 | Switch To 540P
7 | Start Auto Bitrate
8 |
9 |
--------------------------------------------------------------------------------
/MLVB-API-Example/Advanced/HlsAutoBitrate/src/main/res/values/colors.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | #FFFFFF
4 | #000000
5 |
6 |
--------------------------------------------------------------------------------
/MLVB-API-Example/Advanced/HlsAutoBitrate/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 | live
3 | HLS自适应播放
4 | 无缝切流到1080P
5 | 无缝切流到720P
6 | 无缝切流到540P
7 | 开启自适应播放
8 |
9 |
--------------------------------------------------------------------------------
/MLVB-API-Example/Advanced/HlsAutoBitrate/src/main/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
5 |
7 |
8 |
17 |
18 |
22 |
23 |
24 |
--------------------------------------------------------------------------------
/MLVB-API-Example/Advanced/LebAutoBitrate/.gitignore:
--------------------------------------------------------------------------------
1 | /build
--------------------------------------------------------------------------------
/MLVB-API-Example/Advanced/LebAutoBitrate/build.gradle:
--------------------------------------------------------------------------------
1 | apply plugin: 'com.android.library'
2 |
3 | android {
4 | compileSdkVersion rootProject.ext.compileSdkVersion
5 | buildToolsVersion rootProject.ext.buildToolsVersion
6 |
7 | defaultConfig {
8 | minSdkVersion rootProject.ext.minSdkVersion
9 | targetSdkVersion rootProject.ext.targetSdkVersion
10 | versionCode 1
11 | versionName "1.0"
12 | ndk {
13 | abiFilters "armeabi-v7a", "arm64-v8a"
14 | }
15 | }
16 |
17 | buildTypes {
18 | release {
19 | minifyEnabled false
20 | proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
21 | }
22 | }
23 | }
24 |
25 | dependencies {
26 | implementation fileTree(dir: "libs", include: ["*.jar"])
27 | implementation rootProject.ext.liteavSdk
28 | implementation 'androidx.appcompat:appcompat:1.1.0'
29 | implementation project(':Debug')
30 | implementation project(':Common')
31 | }
--------------------------------------------------------------------------------
/MLVB-API-Example/Advanced/LebAutoBitrate/proguard-rules.pro:
--------------------------------------------------------------------------------
1 | # Add project specific ProGuard rules here.
2 | # You can control the set of applied configuration files using the
3 | # proguardFiles setting in build.gradle.
4 | #
5 | # For more details, see
6 | # http://developer.android.com/guide/developing/tools/proguard.html
7 |
8 | # If your project uses WebView with JS, uncomment the following
9 | # and specify the fully qualified class name to the JavaScript interface
10 | # class:
11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview {
12 | # public *;
13 | #}
14 |
15 | # Uncomment this to preserve the line number information for
16 | # debugging stack traces.
17 | #-keepattributes SourceFile,LineNumberTable
18 |
19 | # If you keep the line number information, uncomment this to
20 | # hide the original source file name.
21 | #-renamesourcefileattribute SourceFile
--------------------------------------------------------------------------------
/MLVB-API-Example/Advanced/LebAutoBitrate/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
7 |
11 |
12 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/MLVB-API-Example/Advanced/LebAutoBitrate/src/main/res/layout/lebautobitrate_activity_leb_auto_bitrate.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
10 |
11 |
18 |
19 |
28 |
29 |
30 |
36 |
37 |
38 |
45 |
46 |
47 |
58 |
59 |
71 |
72 |
84 |
85 |
86 |
98 |
99 |
--------------------------------------------------------------------------------
/MLVB-API-Example/Advanced/LebAutoBitrate/src/main/res/values-en/strings.xml:
--------------------------------------------------------------------------------
1 |
2 | live
3 | Webrtc Auto Bitrate Play
4 | Switch To 1080P
5 | Switch To 720P
6 | Switch To 540P
7 | Start Auto Bitrate
8 | Close Auto Bitrate
9 |
10 |
--------------------------------------------------------------------------------
/MLVB-API-Example/Advanced/LebAutoBitrate/src/main/res/values/colors.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | #FFFFFF
4 | #000000
5 |
6 |
--------------------------------------------------------------------------------
/MLVB-API-Example/Advanced/LebAutoBitrate/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 | live
3 | 快直播自适应播放
4 | 无缝切流到1080P
5 | 无缝切流到720P
6 | 无缝切流到540P
7 | 开启自适应播放
8 | 停止自适应播放
9 |
10 |
--------------------------------------------------------------------------------
/MLVB-API-Example/Advanced/LebAutoBitrate/src/main/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
5 |
7 |
8 |
17 |
18 |
22 |
23 |
24 |
--------------------------------------------------------------------------------
/MLVB-API-Example/Advanced/NewTimeShiftSprite/.gitignore:
--------------------------------------------------------------------------------
1 | /build
--------------------------------------------------------------------------------
/MLVB-API-Example/Advanced/NewTimeShiftSprite/build.gradle:
--------------------------------------------------------------------------------
1 | apply plugin: 'com.android.library'
2 |
3 | android {
4 | compileSdkVersion rootProject.ext.compileSdkVersion
5 | buildToolsVersion rootProject.ext.buildToolsVersion
6 |
7 | defaultConfig {
8 | minSdkVersion rootProject.ext.minSdkVersion
9 | targetSdkVersion rootProject.ext.targetSdkVersion
10 | versionCode 1
11 | versionName "1.0"
12 | ndk {
13 | abiFilters "armeabi-v7a", "arm64-v8a"
14 | }
15 | }
16 |
17 | buildTypes {
18 | release {
19 | minifyEnabled false
20 | proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
21 | }
22 | }
23 | }
24 |
25 | dependencies {
26 | implementation fileTree(dir: "libs", include: ["*.jar"])
27 | implementation rootProject.ext.liteavSdk
28 | implementation 'androidx.appcompat:appcompat:1.1.0'
29 | implementation 'com.squareup.okhttp3:okhttp:3.11.0'
30 | implementation project(':Debug')
31 | implementation project(':Common')
32 | }
--------------------------------------------------------------------------------
/MLVB-API-Example/Advanced/NewTimeShiftSprite/consumer-rules.pro:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LiteAVSDK/Live_Android/47797c0f61a54ec0173630200cb7147bb2d9eb82/MLVB-API-Example/Advanced/NewTimeShiftSprite/consumer-rules.pro
--------------------------------------------------------------------------------
/MLVB-API-Example/Advanced/NewTimeShiftSprite/proguard-rules.pro:
--------------------------------------------------------------------------------
1 | # Add project specific ProGuard rules here.
2 | # You can control the set of applied configuration files using the
3 | # proguardFiles setting in build.gradle.
4 | #
5 | # For more details, see
6 | # http://developer.android.com/guide/developing/tools/proguard.html
7 |
8 | # If your project uses WebView with JS, uncomment the following
9 | # and specify the fully qualified class name to the JavaScript interface
10 | # class:
11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview {
12 | # public *;
13 | #}
14 |
15 | # Uncomment this to preserve the line number information for
16 | # debugging stack traces.
17 | #-keepattributes SourceFile,LineNumberTable
18 |
19 | # If you keep the line number information, uncomment this to
20 | # hide the original source file name.
21 | #-renamesourcefileattribute SourceFile
--------------------------------------------------------------------------------
/MLVB-API-Example/Advanced/NewTimeShiftSprite/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/MLVB-API-Example/Advanced/NewTimeShiftSprite/src/main/res/values-en/strings.xml:
--------------------------------------------------------------------------------
1 |
2 | live
3 | New Time Shift Sprite
4 | Get Sprite Thumb
5 |
6 |
--------------------------------------------------------------------------------
/MLVB-API-Example/Advanced/NewTimeShiftSprite/src/main/res/values/colors.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | #FFFFFF
4 | #000000
5 |
6 |
--------------------------------------------------------------------------------
/MLVB-API-Example/Advanced/NewTimeShiftSprite/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 | live
3 | 新直播时移雪碧图
4 | 获取缩略图
5 |
6 |
--------------------------------------------------------------------------------
/MLVB-API-Example/Advanced/NewTimeShiftSprite/src/main/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
5 |
7 |
8 |
17 |
18 |
22 |
23 |
24 |
--------------------------------------------------------------------------------
/MLVB-API-Example/Advanced/PictureInPicture/.gitignore:
--------------------------------------------------------------------------------
1 | /build
--------------------------------------------------------------------------------
/MLVB-API-Example/Advanced/PictureInPicture/build.gradle:
--------------------------------------------------------------------------------
1 | apply plugin: 'com.android.library'
2 |
3 | android {
4 | compileSdkVersion rootProject.ext.compileSdkVersion
5 | buildToolsVersion rootProject.ext.buildToolsVersion
6 |
7 | defaultConfig {
8 | minSdkVersion 19
9 | targetSdkVersion rootProject.ext.targetSdkVersion
10 | ndk {
11 | abiFilters "armeabi-v7a", "arm64-v8a"
12 | }
13 | }
14 |
15 | buildTypes {
16 | release {
17 | minifyEnabled false
18 | proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
19 | }
20 | }
21 | namespace 'com.tencent.mlvb.pictureinpicture'
22 |
23 | }
24 |
25 | dependencies {
26 | implementation fileTree(dir: "libs", include: ["*.jar"])
27 | implementation rootProject.ext.liteavSdk
28 | implementation 'androidx.appcompat:appcompat:1.1.0'
29 | implementation project(':Debug')
30 | implementation project(':Common')
31 | implementation 'com.google.android.material:material:1.12.0'
32 | implementation 'androidx.activity:activity:1.9.0'
33 | implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
34 | }
--------------------------------------------------------------------------------
/MLVB-API-Example/Advanced/PictureInPicture/proguard-rules.pro:
--------------------------------------------------------------------------------
1 | # Add project specific ProGuard rules here.
2 | # You can control the set of applied configuration files using the
3 | # proguardFiles setting in build.gradle.
4 | #
5 | # For more details, see
6 | # http://developer.android.com/guide/developing/tools/proguard.html
7 |
8 | # If your project uses WebView with JS, uncomment the following
9 | # and specify the fully qualified class name to the JavaScript interface
10 | # class:
11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview {
12 | # public *;
13 | #}
14 |
15 | # Uncomment this to preserve the line number information for
16 | # debugging stack traces.
17 | #-keepattributes SourceFile,LineNumberTable
18 |
19 | # If you keep the line number information, uncomment this to
20 | # hide the original source file name.
21 | #-renamesourcefileattribute SourceFile
--------------------------------------------------------------------------------
/MLVB-API-Example/Advanced/PictureInPicture/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
14 |
15 |
16 |
--------------------------------------------------------------------------------
/MLVB-API-Example/Advanced/PictureInPicture/src/main/res/layout/activity_picture_in_picture.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
10 |
11 |
18 |
19 |
28 |
29 |
30 |
36 |
37 |
46 |
47 |
59 |
60 |
61 |
73 |
74 |
75 |
76 |
77 |
78 |
--------------------------------------------------------------------------------
/MLVB-API-Example/Advanced/PictureInPicture/src/main/res/values-en/strings.xml:
--------------------------------------------------------------------------------
1 |
2 | live
3 | MLVB API Example
4 | Enable
5 | Pause
6 | Disable
7 | Resume
8 |
--------------------------------------------------------------------------------
/MLVB-API-Example/Advanced/PictureInPicture/src/main/res/values/color.xml.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | #FFFFFF
4 | #000000
5 |
--------------------------------------------------------------------------------
/MLVB-API-Example/Advanced/PictureInPicture/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 | live
3 | 腾讯云MLVB API Example
4 | 开启画中画功能
5 | 暂停
6 | 关闭画中画功能
7 | 恢复
8 | 当前设备不支持画中画功能
9 |
--------------------------------------------------------------------------------
/MLVB-API-Example/Advanced/PictureInPicture/src/main/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
5 |
7 |
8 |
--------------------------------------------------------------------------------
/MLVB-API-Example/Advanced/RTCPushAndPlay/.gitignore:
--------------------------------------------------------------------------------
1 | /build
--------------------------------------------------------------------------------
/MLVB-API-Example/Advanced/RTCPushAndPlay/build.gradle:
--------------------------------------------------------------------------------
1 | apply plugin: 'com.android.library'
2 |
3 | android {
4 | compileSdkVersion rootProject.ext.compileSdkVersion
5 | buildToolsVersion rootProject.ext.buildToolsVersion
6 |
7 | defaultConfig {
8 | minSdkVersion rootProject.ext.minSdkVersion
9 | targetSdkVersion rootProject.ext.targetSdkVersion
10 | versionCode 1
11 | versionName "1.0"
12 | ndk {
13 | abiFilters "armeabi-v7a", "arm64-v8a"
14 | }
15 | }
16 |
17 | buildTypes {
18 | release {
19 | minifyEnabled false
20 | proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
21 | }
22 | }
23 | }
24 |
25 | dependencies {
26 | implementation fileTree(dir: "libs", include: ["*.jar"])
27 | implementation rootProject.ext.liteavSdk
28 | implementation 'androidx.appcompat:appcompat:1.1.0'
29 | implementation project(':Debug')
30 | implementation project(':Common')
31 | }
--------------------------------------------------------------------------------
/MLVB-API-Example/Advanced/RTCPushAndPlay/proguard-rules.pro:
--------------------------------------------------------------------------------
1 | # Add project specific ProGuard rules here.
2 | # You can control the set of applied configuration files using the
3 | # proguardFiles setting in build.gradle.
4 | #
5 | # For more details, see
6 | # http://developer.android.com/guide/developing/tools/proguard.html
7 |
8 | # If your project uses WebView with JS, uncomment the following
9 | # and specify the fully qualified class name to the JavaScript interface
10 | # class:
11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview {
12 | # public *;
13 | #}
14 |
15 | # Uncomment this to preserve the line number information for
16 | # debugging stack traces.
17 | #-keepattributes SourceFile,LineNumberTable
18 |
19 | # If you keep the line number information, uncomment this to
20 | # hide the original source file name.
21 | #-renamesourcefileattribute SourceFile
--------------------------------------------------------------------------------
/MLVB-API-Example/Advanced/RTCPushAndPlay/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
9 |
13 |
17 |
18 |
19 |
20 |
--------------------------------------------------------------------------------
/MLVB-API-Example/Advanced/RTCPushAndPlay/src/main/java/com/tencent/mlvb/rtcpushandplay/RTCPushAndPlayEnterActivity.java:
--------------------------------------------------------------------------------
1 | package com.tencent.mlvb.rtcpushandplay;
2 |
3 | import android.content.Intent;
4 | import android.os.Bundle;
5 | import android.text.TextUtils;
6 | import android.view.View;
7 | import android.widget.Button;
8 | import android.widget.EditText;
9 | import android.widget.RadioGroup;
10 | import android.widget.Toast;
11 | import androidx.annotation.Nullable;
12 | import com.tencent.mlvb.common.MLVBBaseActivity;
13 |
14 | /**
15 | * Entrance View for RTC Co-anchoring + Ultra-low-latency Playback
16 | *
17 | * - Enter as an anchor {@link RTCPushAndPlayAnchorActivity}
18 | * - Enter as audience {@link RTCPushAndPlayAudienceActivity}
19 | */
20 | public class RTCPushAndPlayEnterActivity extends MLVBBaseActivity {
21 |
22 | private EditText mEditStreamId;
23 | private Button mButtonCommit;
24 | private RadioGroup mRadioRole;
25 |
26 | @Override
27 | protected void onCreate(@Nullable Bundle savedInstanceState) {
28 | super.onCreate(savedInstanceState);
29 | setContentView(R.layout.rtcpushandplay_activity_rtc_push_and_play_enter);
30 | initView();
31 | }
32 |
33 | private void initView() {
34 | mEditStreamId = findViewById(R.id.et_stream_id);
35 | mRadioRole = findViewById(R.id.rg_role);
36 | mButtonCommit = findViewById(R.id.btn_commit);
37 |
38 | mEditStreamId.setText(generateStreamId());
39 | mRadioRole.setOnCheckedChangeListener(new RadioGroup.OnCheckedChangeListener() {
40 | @Override
41 | public void onCheckedChanged(RadioGroup radioGroup, int i) {
42 | if (i == R.id.rb_anchor) {
43 | mButtonCommit.setText(R.string.rtcpushandplay_rtc_push);
44 | } else if (i == R.id.rb_audience) {
45 | mButtonCommit.setText(R.string.rtcpushandplay_rtc_play);
46 | }
47 | }
48 | });
49 | mRadioRole.check(R.id.rb_anchor);
50 |
51 | findViewById(R.id.btn_commit).setOnClickListener(new View.OnClickListener() {
52 | @Override
53 | public void onClick(View view) {
54 | String streamId = mEditStreamId.getText().toString();
55 |
56 | if (TextUtils.isEmpty(streamId)) {
57 | Toast.makeText(RTCPushAndPlayEnterActivity.this,
58 | getString(R.string.rtcpushandplay_please_input_streamid), Toast.LENGTH_SHORT).show();
59 | return;
60 | }
61 |
62 | Intent intent = null;
63 | if (mRadioRole.getCheckedRadioButtonId() == R.id.rb_anchor) {
64 | intent = new Intent(RTCPushAndPlayEnterActivity.this, RTCPushAndPlayAnchorActivity.class);
65 | } else if (mRadioRole.getCheckedRadioButtonId() == R.id.rb_audience) {
66 | intent = new Intent(RTCPushAndPlayEnterActivity.this, RTCPushAndPlayAudienceActivity.class);
67 | }
68 | intent.putExtra("STREAM_ID", streamId);
69 | startActivity(intent);
70 | }
71 | });
72 | }
73 |
74 | @Override
75 | protected void onPermissionGranted() {
76 |
77 | }
78 | }
79 |
--------------------------------------------------------------------------------
/MLVB-API-Example/Advanced/RTCPushAndPlay/src/main/res/layout/rtcpushandplay_activity_rtc_push_and_play_anchor.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
11 |
12 |
20 |
21 |
24 |
25 |
32 |
33 |
41 |
42 |
43 |
44 |
50 |
51 |
56 |
57 |
63 |
64 |
71 |
72 |
73 |
86 |
87 |
88 |
--------------------------------------------------------------------------------
/MLVB-API-Example/Advanced/RTCPushAndPlay/src/main/res/layout/rtcpushandplay_activity_rtc_push_and_play_audience.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
11 |
12 |
20 |
23 |
24 |
31 |
32 |
40 |
41 |
42 |
48 |
49 |
54 |
55 |
61 |
62 |
69 |
70 |
71 |
84 |
85 |
86 |
--------------------------------------------------------------------------------
/MLVB-API-Example/Advanced/RTCPushAndPlay/src/main/res/values-en/strings.xml:
--------------------------------------------------------------------------------
1 |
2 | live
3 | Co-anchor
4 | RTC Playback
5 | RTC Co-anchoring + Ultra-low-latency Playback
6 | Stream Id
7 | Role
8 | Anchor
9 | Audience
10 | RTC Publishing
11 | Stop
12 | Stop
13 | RTC co-anchoring + ultra-low-latency playback: \n1. Anchor A\n1.1 Anchor A starts publishing streams.\n1.2 Anchor A’s audience play anchor A’s streams.\n\n2. Anchor B\n2.1 Anchor B starts publishing streams.\n2.2 Anchor B’s audience play anchor B’s streams.\n\n3. Co-anchoring\n3.1 Anchor A plays anchor B’s streams.\n3.2 Anchor B plays anchor A’s streams.\n\n4. Audience\n4.1 Anchor A’s audience play anchor B’s streams.\n4.2 Anchor B’s audience play anchor A’s streams.\n\nCurrently only supported in China, other regions are continuing to develop.
14 |
15 |
16 |
--------------------------------------------------------------------------------
/MLVB-API-Example/Advanced/RTCPushAndPlay/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 | live
3 | 开始连麦
4 | RTC拉流
5 | RTC连麦+超低延时播放
6 | 请输入streamId
7 | 请选择角色
8 | 主播
9 | 观众
10 | RTC推流
11 | 停止拉流
12 | 停止连麦
13 | RTC连麦+低延时拉流:\n1、主播A\n1.1、主播A开始推流\n1.2、主播A的观众拉主播A的流\n\n2、主播B\n2.1、主播B开始推流\n2.2、主播B的观众拉主播B的流\n\n3、主播A连麦主播B\n3.1、主播A拉主播B的流\n3.2、主播B拉主播A的流\n\n4、主播连麦后的观众端\n4.1、主播A的观众拉主播B的流\n4.2、主播B的观众拉主播A的流\n\n目前仅中国大陆支持,其他地区正陆续开发中。
14 |
15 |
--------------------------------------------------------------------------------
/MLVB-API-Example/Advanced/RTCPushAndPlay/src/main/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
5 |
7 |
8 |
17 |
18 |
22 |
23 |
24 |
--------------------------------------------------------------------------------
/MLVB-API-Example/Advanced/SwitchRenderView/.gitignore:
--------------------------------------------------------------------------------
1 | /build
--------------------------------------------------------------------------------
/MLVB-API-Example/Advanced/SwitchRenderView/build.gradle:
--------------------------------------------------------------------------------
1 | apply plugin: 'com.android.library'
2 |
3 | android {
4 | compileSdkVersion rootProject.ext.compileSdkVersion
5 | buildToolsVersion rootProject.ext.buildToolsVersion
6 |
7 | defaultConfig {
8 | minSdkVersion rootProject.ext.minSdkVersion
9 | targetSdkVersion rootProject.ext.targetSdkVersion
10 | versionCode 1
11 | versionName "1.0"
12 | ndk {
13 | abiFilters "armeabi-v7a", "arm64-v8a"
14 | }
15 | }
16 |
17 | buildTypes {
18 | release {
19 | minifyEnabled false
20 | proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
21 | }
22 | }
23 | }
24 |
25 | dependencies {
26 | implementation fileTree(dir: "libs", include: ["*.jar"])
27 | implementation rootProject.ext.liteavSdk
28 | implementation 'androidx.appcompat:appcompat:1.1.0'
29 | implementation project(':Debug')
30 | implementation project(':Common')
31 | }
--------------------------------------------------------------------------------
/MLVB-API-Example/Advanced/SwitchRenderView/proguard-rules.pro:
--------------------------------------------------------------------------------
1 | # Add project specific ProGuard rules here.
2 | # You can control the set of applied configuration files using the
3 | # proguardFiles setting in build.gradle.
4 | #
5 | # For more details, see
6 | # http://developer.android.com/guide/developing/tools/proguard.html
7 |
8 | # If your project uses WebView with JS, uncomment the following
9 | # and specify the fully qualified class name to the JavaScript interface
10 | # class:
11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview {
12 | # public *;
13 | #}
14 |
15 | # Uncomment this to preserve the line number information for
16 | # debugging stack traces.
17 | #-keepattributes SourceFile,LineNumberTable
18 |
19 | # If you keep the line number information, uncomment this to
20 | # hide the original source file name.
21 | #-renamesourcefileattribute SourceFile
--------------------------------------------------------------------------------
/MLVB-API-Example/Advanced/SwitchRenderView/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
7 |
11 |
12 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/MLVB-API-Example/Advanced/SwitchRenderView/src/main/res/values-en/strings.xml:
--------------------------------------------------------------------------------
1 |
2 | live
3 | Stream Id
4 | Publish
5 | Stop
6 | Stop and publish again.
7 | Switch Rendering View
8 |
9 |
--------------------------------------------------------------------------------
/MLVB-API-Example/Advanced/SwitchRenderView/src/main/res/values/colors.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | #FFFFFF
4 | #000000
5 |
6 |
--------------------------------------------------------------------------------
/MLVB-API-Example/Advanced/SwitchRenderView/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 | live
3 | 请输入streamId
4 | 开始推流
5 | 停止推流
6 | 请停止推流重新推流
7 | 切换渲染View
8 |
9 |
--------------------------------------------------------------------------------
/MLVB-API-Example/Advanced/SwitchRenderView/src/main/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
5 |
7 |
8 |
17 |
18 |
22 |
23 |
24 |
--------------------------------------------------------------------------------
/MLVB-API-Example/Advanced/ThirdBeauty/.gitignore:
--------------------------------------------------------------------------------
1 | /build
--------------------------------------------------------------------------------
/MLVB-API-Example/Advanced/ThirdBeauty/build.gradle:
--------------------------------------------------------------------------------
1 | apply plugin: 'com.android.library'
2 |
3 | android {
4 | compileSdkVersion rootProject.ext.compileSdkVersion
5 | buildToolsVersion rootProject.ext.buildToolsVersion
6 |
7 | defaultConfig {
8 | minSdkVersion rootProject.ext.minSdkVersion
9 | targetSdkVersion rootProject.ext.targetSdkVersion
10 | versionCode 1
11 | versionName "1.0"
12 | ndk {
13 | abiFilters "armeabi-v7a", "arm64-v8a"
14 | }
15 | }
16 |
17 | buildTypes {
18 | release {
19 | minifyEnabled false
20 | proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
21 | }
22 | }
23 | }
24 |
25 | dependencies {
26 | implementation fileTree(dir: "libs", include: ["*.jar"])
27 | implementation rootProject.ext.liteavSdk
28 | implementation 'androidx.appcompat:appcompat:1.1.0'
29 | implementation project(':Debug')
30 | implementation project(':Common')
31 | }
--------------------------------------------------------------------------------
/MLVB-API-Example/Advanced/ThirdBeauty/proguard-rules.pro:
--------------------------------------------------------------------------------
1 | # Add project specific ProGuard rules here.
2 | # You can control the set of applied configuration files using the
3 | # proguardFiles setting in build.gradle.
4 | #
5 | # For more details, see
6 | # http://developer.android.com/guide/developing/tools/proguard.html
7 |
8 | # If your project uses WebView with JS, uncomment the following
9 | # and specify the fully qualified class name to the JavaScript interface
10 | # class:
11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview {
12 | # public *;
13 | #}
14 |
15 | # Uncomment this to preserve the line number information for
16 | # debugging stack traces.
17 | #-keepattributes SourceFile,LineNumberTable
18 |
19 | # If you keep the line number information, uncomment this to
20 | # hide the original source file name.
21 | #-renamesourcefileattribute SourceFile
--------------------------------------------------------------------------------
/MLVB-API-Example/Advanced/ThirdBeauty/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
14 |
15 |
16 |
--------------------------------------------------------------------------------
/MLVB-API-Example/Advanced/ThirdBeauty/src/main/java/com/tencent/mlvb/thirdbeauty/ThirdBeautyEntranceActivity.java:
--------------------------------------------------------------------------------
1 | package com.tencent.mlvb.thirdbeauty;
2 |
3 | import androidx.appcompat.app.AppCompatActivity;
4 |
5 | import android.content.Intent;
6 | import android.os.Bundle;
7 | import android.view.View;
8 |
9 | public class ThirdBeautyEntranceActivity extends AppCompatActivity {
10 |
11 | @Override
12 | protected void onCreate(Bundle savedInstanceState) {
13 | super.onCreate(savedInstanceState);
14 | setContentView(R.layout.activity_third_beauty_entrance);
15 | getSupportActionBar().hide();
16 |
17 | findViewById(R.id.ll_third_beauty_tencent_effect).setOnClickListener(new View.OnClickListener() {
18 | @Override
19 | public void onClick(View view) {
20 | Intent intent = new Intent(ThirdBeautyEntranceActivity.this, ThirdBeautyTencentEffectActivity.class);
21 | startActivity(intent);
22 | }
23 | });
24 | findViewById(R.id.ll_third_beauty_faceunity).setOnClickListener(new View.OnClickListener() {
25 | @Override
26 | public void onClick(View view) {
27 | Intent intent = new Intent(ThirdBeautyEntranceActivity.this, ThirdBeautyFaceUnityActivity.class);
28 | startActivity(intent);
29 | }
30 | });
31 | }
32 | }
--------------------------------------------------------------------------------
/MLVB-API-Example/Advanced/ThirdBeauty/src/main/res/drawable/button_bg.xml:
--------------------------------------------------------------------------------
1 |
3 |
4 |
5 |
6 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/MLVB-API-Example/Advanced/ThirdBeauty/src/main/res/layout/activity_third_beauty_entrance.xml:
--------------------------------------------------------------------------------
1 |
2 |
10 |
11 |
22 |
23 |
29 |
30 |
31 |
32 |
43 |
44 |
50 |
51 |
--------------------------------------------------------------------------------
/MLVB-API-Example/Advanced/ThirdBeauty/src/main/res/values-en/strings.xml:
--------------------------------------------------------------------------------
1 |
2 | live
3 | Publish
4 | Stream Id
5 | Stop
6 | Third-Party Beauty Filters
7 | Tencent Effect Beauty Filters
8 |
9 |
--------------------------------------------------------------------------------
/MLVB-API-Example/Advanced/ThirdBeauty/src/main/res/values/colors.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | #FFFFFF
4 | #000000
5 |
6 |
--------------------------------------------------------------------------------
/MLVB-API-Example/Advanced/ThirdBeauty/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 | live
3 | 开始推流
4 | 请输入streamId
5 | 停止推流
6 | 第三方美颜
7 | 腾讯特效美颜
8 |
9 |
--------------------------------------------------------------------------------
/MLVB-API-Example/Advanced/ThirdBeauty/src/main/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
5 |
7 |
8 |
17 |
18 |
22 |
23 |
24 |
--------------------------------------------------------------------------------
/MLVB-API-Example/Advanced/TimeShift/.gitignore:
--------------------------------------------------------------------------------
1 | /build
--------------------------------------------------------------------------------
/MLVB-API-Example/Advanced/TimeShift/build.gradle:
--------------------------------------------------------------------------------
1 | apply plugin: 'com.android.library'
2 |
3 | android {
4 | compileSdkVersion rootProject.ext.compileSdkVersion
5 | buildToolsVersion rootProject.ext.buildToolsVersion
6 |
7 | defaultConfig {
8 | minSdkVersion rootProject.ext.minSdkVersion
9 | targetSdkVersion rootProject.ext.targetSdkVersion
10 | versionCode 1
11 | versionName "1.0"
12 | ndk {
13 | abiFilters "armeabi-v7a", "arm64-v8a"
14 | }
15 | }
16 |
17 | buildTypes {
18 | release {
19 | minifyEnabled false
20 | proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
21 | }
22 | }
23 | }
24 |
25 | dependencies {
26 | implementation fileTree(dir: "libs", include: ["*.jar"])
27 | implementation rootProject.ext.liteavSdk
28 | implementation 'androidx.appcompat:appcompat:1.1.0'
29 | implementation project(':Debug')
30 | implementation project(':Common')
31 | }
--------------------------------------------------------------------------------
/MLVB-API-Example/Advanced/TimeShift/consumer-rules.pro:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LiteAVSDK/Live_Android/47797c0f61a54ec0173630200cb7147bb2d9eb82/MLVB-API-Example/Advanced/TimeShift/consumer-rules.pro
--------------------------------------------------------------------------------
/MLVB-API-Example/Advanced/TimeShift/proguard-rules.pro:
--------------------------------------------------------------------------------
1 | # Add project specific ProGuard rules here.
2 | # You can control the set of applied configuration files using the
3 | # proguardFiles setting in build.gradle.
4 | #
5 | # For more details, see
6 | # http://developer.android.com/guide/developing/tools/proguard.html
7 |
8 | # If your project uses WebView with JS, uncomment the following
9 | # and specify the fully qualified class name to the JavaScript interface
10 | # class:
11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview {
12 | # public *;
13 | #}
14 |
15 | # Uncomment this to preserve the line number information for
16 | # debugging stack traces.
17 | #-keepattributes SourceFile,LineNumberTable
18 |
19 | # If you keep the line number information, uncomment this to
20 | # hide the original source file name.
21 | #-renamesourcefileattribute SourceFile
--------------------------------------------------------------------------------
/MLVB-API-Example/Advanced/TimeShift/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/MLVB-API-Example/Advanced/TimeShift/src/main/res/layout/activity_time_shift.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
14 |
15 |
18 |
19 |
26 |
27 |
36 |
37 |
38 |
50 |
51 |
63 |
64 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
--------------------------------------------------------------------------------
/MLVB-API-Example/Advanced/TimeShift/src/main/res/values-en/strings.xml:
--------------------------------------------------------------------------------
1 |
2 | live
3 | Time Shift
4 | Resume Live
5 |
6 |
--------------------------------------------------------------------------------
/MLVB-API-Example/Advanced/TimeShift/src/main/res/values/colors.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | #FFFFFF
4 | #000000
5 |
6 |
--------------------------------------------------------------------------------
/MLVB-API-Example/Advanced/TimeShift/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 | live
3 | 直播时移
4 | 返回直播
5 |
6 |
--------------------------------------------------------------------------------
/MLVB-API-Example/Advanced/TimeShift/src/main/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
5 |
7 |
8 |
17 |
18 |
22 |
23 |
24 |
--------------------------------------------------------------------------------
/MLVB-API-Example/App/.gitignore:
--------------------------------------------------------------------------------
1 | /build
2 |
--------------------------------------------------------------------------------
/MLVB-API-Example/App/build.gradle:
--------------------------------------------------------------------------------
1 | apply plugin: 'com.android.application'
2 |
3 | android {
4 | compileSdkVersion rootProject.ext.compileSdkVersion
5 | buildToolsVersion rootProject.ext.buildToolsVersion
6 |
7 | defaultConfig {
8 | applicationId "com.tencent.mlvb.apiexample"
9 | minSdkVersion rootProject.ext.minSdkVersion
10 | targetSdkVersion rootProject.ext.targetSdkVersion
11 | versionCode 24
12 | versionName "12.6.0.5368"
13 | multiDexEnabled true
14 | ndk {
15 | abiFilters "armeabi-v7a", "arm64-v8a"
16 | }
17 | }
18 | buildTypes {
19 | release {
20 | minifyEnabled false
21 | proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
22 | }
23 | }
24 | }
25 |
26 | dependencies {
27 | implementation fileTree(dir: 'libs', include: ['*.jar'])
28 | implementation 'androidx.appcompat:appcompat:1.1.0'
29 | implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
30 | implementation 'androidx.multidex:multidex:2.0.0'
31 | implementation rootProject.ext.liteavSdk
32 | implementation project(':Debug')
33 | implementation project(':Basic:LivePushCamera')
34 | implementation project(':Basic:LivePushScreen')
35 | implementation project(':Basic:LivePlay')
36 | implementation project(':Basic:LebPlay')
37 | implementation project(':Basic:LiveLink')
38 | implementation project(':Basic:LivePK')
39 | implementation project(':Advanced:SwitchRenderView')
40 | implementation project(':Advanced:ThirdBeauty')
41 | implementation project(':Advanced:RTCPushAndPlay')
42 | implementation project(':Advanced:CustomVideoCapture')
43 | implementation project(':Advanced:LebAutoBitrate')
44 | implementation project(':Advanced:HlsAutoBitrate')
45 | implementation project(':Advanced:TimeShift')
46 | implementation project(':Advanced:NewTimeShiftSprite')
47 | implementation project(':Advanced:PictureInPicture')
48 | }
49 |
50 |
--------------------------------------------------------------------------------
/MLVB-API-Example/App/proguard-rules.pro:
--------------------------------------------------------------------------------
1 | # Add project specific ProGuard rules here.
2 | # You can control the set of applied configuration files using the
3 | # proguardFiles setting in build.gradle.
4 | #
5 | # For more details, see
6 | # http://developer.android.com/guide/developing/tools/proguard.html
7 |
8 | # If your project uses WebView with JS, uncomment the following
9 | # and specify the fully qualified class name to the JavaScript interface
10 | # class:
11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview {
12 | # public *;
13 | #}
14 |
15 | # Uncomment this to preserve the line number information for
16 | # debugging stack traces.
17 | #-keepattributes SourceFile,LineNumberTable
18 |
19 | # If you keep the line number information, uncomment this to
20 | # hide the original source file name.
21 | #-renamesourcefileattribute SourceFile
22 |
--------------------------------------------------------------------------------
/MLVB-API-Example/App/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
--------------------------------------------------------------------------------
/MLVB-API-Example/App/src/main/java/com/tencent/mlvb/apiexample/MLVBApplication.java:
--------------------------------------------------------------------------------
1 | package com.tencent.mlvb.apiexample;
2 |
3 | import android.app.Application;
4 |
5 | import androidx.multidex.MultiDex;
6 |
7 | import com.tencent.live2.V2TXLiveDef.V2TXLiveLogConfig;
8 | import com.tencent.live2.V2TXLivePremier;
9 | import com.tencent.mlvb.debug.GenerateTestUserSig;
10 |
11 | public class MLVBApplication extends Application {
12 |
13 | private static MLVBApplication instance;
14 |
15 | @Override
16 | public void onCreate() {
17 | super.onCreate();
18 | MultiDex.install(this);
19 | instance = this;
20 | V2TXLiveLogConfig liveLogConfig = new V2TXLiveLogConfig();
21 | liveLogConfig.enableConsole = true;
22 | V2TXLivePremier.setLogConfig(liveLogConfig);
23 | V2TXLivePremier.setLicence(instance, GenerateTestUserSig.LICENSEURL, GenerateTestUserSig.LICENSEURLKEY);
24 | }
25 |
26 | }
27 |
--------------------------------------------------------------------------------
/MLVB-API-Example/App/src/main/res/drawable/button_bg.xml:
--------------------------------------------------------------------------------
1 |
3 |
4 |
5 |
6 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/MLVB-API-Example/App/src/main/res/drawable/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LiteAVSDK/Live_Android/47797c0f61a54ec0173630200cb7147bb2d9eb82/MLVB-API-Example/App/src/main/res/drawable/ic_launcher.png
--------------------------------------------------------------------------------
/MLVB-API-Example/App/src/main/res/mipmap-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LiteAVSDK/Live_Android/47797c0f61a54ec0173630200cb7147bb2d9eb82/MLVB-API-Example/App/src/main/res/mipmap-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/MLVB-API-Example/App/src/main/res/mipmap-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LiteAVSDK/Live_Android/47797c0f61a54ec0173630200cb7147bb2d9eb82/MLVB-API-Example/App/src/main/res/mipmap-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/MLVB-API-Example/App/src/main/res/mipmap-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LiteAVSDK/Live_Android/47797c0f61a54ec0173630200cb7147bb2d9eb82/MLVB-API-Example/App/src/main/res/mipmap-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/MLVB-API-Example/App/src/main/res/mipmap-xxhdpi/ic_appicon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LiteAVSDK/Live_Android/47797c0f61a54ec0173630200cb7147bb2d9eb82/MLVB-API-Example/App/src/main/res/mipmap-xxhdpi/ic_appicon.png
--------------------------------------------------------------------------------
/MLVB-API-Example/App/src/main/res/mipmap-xxhdpi/ic_launch_image.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LiteAVSDK/Live_Android/47797c0f61a54ec0173630200cb7147bb2d9eb82/MLVB-API-Example/App/src/main/res/mipmap-xxhdpi/ic_launch_image.png
--------------------------------------------------------------------------------
/MLVB-API-Example/App/src/main/res/mipmap-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LiteAVSDK/Live_Android/47797c0f61a54ec0173630200cb7147bb2d9eb82/MLVB-API-Example/App/src/main/res/mipmap-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/MLVB-API-Example/App/src/main/res/mipmap-xxxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LiteAVSDK/Live_Android/47797c0f61a54ec0173630200cb7147bb2d9eb82/MLVB-API-Example/App/src/main/res/mipmap-xxxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/MLVB-API-Example/App/src/main/res/values-en/strings.xml:
--------------------------------------------------------------------------------
1 |
2 | MLVB-API-Example
3 | Tencent Cloud MLVB API Example
4 | Basic Features
5 | Publishing from Camera
6 | Including rtmp push stream, rtc push stream function
7 | Publishing from Screen
8 | Playback
9 | Including standard protocols rtmp,flv,hls streaming and rtc streaming
10 | Webrtc Playback
11 | Co-anchoring
12 | Competition
13 | Advanced Features
14 | Dynamically Switching Rendering Control
15 | Custom Video Capturing
16 | Third-Party Beauty Filters
17 | RTC Co-anchoring + Ultra-low-latency Playback
18 | Picture In Picture
19 | Webrtc Auto Bitrate
20 | HLS Auto Bitrate
21 | Time Shift
22 |
23 |
--------------------------------------------------------------------------------
/MLVB-API-Example/App/src/main/res/values/colors.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | #008577
4 | #00574B
5 | #D81B60
6 |
7 | #1B1B1B
8 | #037BFF
9 | #8F8F8F
10 | #B7B7B7
11 |
12 |
--------------------------------------------------------------------------------
/MLVB-API-Example/App/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 | MLVB-API-Example
3 | 腾讯云MLVB API Example
4 | 基础功能
5 | 摄像头推流
6 | 包含rtmp推流,rtc推流
7 | 录屏推流
8 | 直播拉流
9 | 包含标准协议rtmp,flv,hls拉流和rtc拉流功能
10 | 快直播拉流
11 | 连麦互动
12 | PK互动
13 | 进阶功能
14 | 动态切换渲染组件
15 | 自定义视频采集
16 | 第三方美颜
17 | RTC连麦+超低延时播放
18 | 画中画功能
19 | 快直播自适应播放
20 | HLS自适应播放
21 | 直播时移
22 | 新直播时移雪碧图
23 |
24 |
--------------------------------------------------------------------------------
/MLVB-API-Example/App/src/main/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/MLVB-API-Example/Basic/LebPlay/.gitignore:
--------------------------------------------------------------------------------
1 | /build
--------------------------------------------------------------------------------
/MLVB-API-Example/Basic/LebPlay/build.gradle:
--------------------------------------------------------------------------------
1 | apply plugin: 'com.android.library'
2 |
3 | android {
4 | compileSdkVersion rootProject.ext.compileSdkVersion
5 | buildToolsVersion rootProject.ext.buildToolsVersion
6 |
7 | defaultConfig {
8 | minSdkVersion rootProject.ext.minSdkVersion
9 | targetSdkVersion rootProject.ext.targetSdkVersion
10 | versionCode 1
11 | versionName "1.0"
12 | ndk {
13 | abiFilters "armeabi-v7a", "arm64-v8a"
14 | }
15 | }
16 |
17 | buildTypes {
18 | release {
19 | minifyEnabled false
20 | proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
21 | }
22 | }
23 | }
24 |
25 | dependencies {
26 | implementation fileTree(dir: "libs", include: ["*.jar"])
27 | implementation 'androidx.appcompat:appcompat:1.1.0'
28 | implementation rootProject.ext.liteavSdk
29 | implementation project(':Debug')
30 | implementation project(':Common')
31 | }
--------------------------------------------------------------------------------
/MLVB-API-Example/Basic/LebPlay/proguard-rules.pro:
--------------------------------------------------------------------------------
1 | # Add project specific ProGuard rules here.
2 | # You can control the set of applied configuration files using the
3 | # proguardFiles setting in build.gradle.
4 | #
5 | # For more details, see
6 | # http://developer.android.com/guide/developing/tools/proguard.html
7 |
8 | # If your project uses WebView with JS, uncomment the following
9 | # and specify the fully qualified class name to the JavaScript interface
10 | # class:
11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview {
12 | # public *;
13 | #}
14 |
15 | # Uncomment this to preserve the line number information for
16 | # debugging stack traces.
17 | #-keepattributes SourceFile,LineNumberTable
18 |
19 | # If you keep the line number information, uncomment this to
20 | # hide the original source file name.
21 | #-renamesourcefileattribute SourceFile
--------------------------------------------------------------------------------
/MLVB-API-Example/Basic/LebPlay/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
10 |
11 |
15 |
16 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/MLVB-API-Example/Basic/LebPlay/src/main/java/com/tencent/liteav/sdk/lebplay/LebPlayEnterActivity.java:
--------------------------------------------------------------------------------
1 | package com.tencent.liteav.sdk.lebplay;
2 |
3 | import android.content.Intent;
4 | import android.os.Bundle;
5 | import android.text.TextUtils;
6 | import android.view.View;
7 | import android.widget.EditText;
8 | import android.widget.Toast;
9 |
10 | import androidx.annotation.Nullable;
11 |
12 | import com.tencent.mlvb.common.MLVBBaseActivity;
13 |
14 | /**
15 | * WebRTC Playback Entrance View
16 | * - For the playback view, see {@link LebPlayActivity}.
17 | */
18 | public class LebPlayEnterActivity extends MLVBBaseActivity {
19 |
20 | private EditText mEditStreamId;
21 |
22 | @Override
23 | protected void onCreate(@Nullable Bundle savedInstanceState) {
24 | super.onCreate(savedInstanceState);
25 | setContentView(R.layout.lebplay_activity_leb_play_enter);
26 | initView();
27 | }
28 |
29 | private void initView() {
30 | mEditStreamId = findViewById(R.id.et_stream_id);
31 |
32 | mEditStreamId.setText(generateStreamId());
33 | findViewById(R.id.btn_play_webrtc).setOnClickListener(new View.OnClickListener() {
34 | @Override
35 | public void onClick(View view) {
36 | startPlay();
37 | }
38 | });
39 | }
40 |
41 | private void startPlay() {
42 | String streamId = mEditStreamId.getText().toString();
43 | if (TextUtils.isEmpty(streamId)) {
44 | Toast.makeText(LebPlayEnterActivity.this, getString(R.string.lebplay_please_input_streamid),
45 | Toast.LENGTH_SHORT).show();
46 | } else {
47 | Intent intent = new Intent(LebPlayEnterActivity.this, LebPlayActivity.class);
48 | intent.putExtra("STREAM_ID", streamId);
49 | startActivity(intent);
50 | }
51 | }
52 |
53 | @Override
54 | protected void onPermissionGranted() {
55 |
56 | }
57 | }
58 |
--------------------------------------------------------------------------------
/MLVB-API-Example/Basic/LebPlay/src/main/res/layout/lebplay_activity_leb_play.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
11 |
12 |
15 |
16 |
23 |
24 |
32 |
33 |
34 |
47 |
48 |
--------------------------------------------------------------------------------
/MLVB-API-Example/Basic/LebPlay/src/main/res/layout/lebplay_activity_leb_play_enter.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
15 |
16 |
24 |
25 |
31 |
32 |
41 |
42 |
43 |
44 |
55 |
56 |
67 |
68 |
80 |
81 |
--------------------------------------------------------------------------------
/MLVB-API-Example/Basic/LebPlay/src/main/res/values-en/strings.xml:
--------------------------------------------------------------------------------
1 |
2 | live
3 | Mute
4 | Unmute
5 | MLVB Playback
6 | Stream Id
7 | LEB is an ultra-low-latency version of LVB. It delivers excellent instant streaming performance and can handle ultra-high concurrency.
8 | LEB Playback
9 | LEB playback is recommended.
10 |
11 |
--------------------------------------------------------------------------------
/MLVB-API-Example/Basic/LebPlay/src/main/res/values/colors.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | #FFFFFF
4 | #000000
5 |
6 |
--------------------------------------------------------------------------------
/MLVB-API-Example/Basic/LebPlay/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 | live
3 | 静音
4 | 取消静音
5 | MLVB 快直播拉流
6 | 请输入streamId
7 | 快直播(Live Event Broadcasting,LEB)是标准直播在超低延迟播放场景下的延伸,强烈推荐,秒开效果最好,支持超高并发。
8 | 快直播拉流
9 | 腾讯云官方推荐使用快直播拉流方式
10 |
11 |
--------------------------------------------------------------------------------
/MLVB-API-Example/Basic/LebPlay/src/main/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
5 |
7 |
8 |
17 |
18 |
22 |
23 |
24 |
--------------------------------------------------------------------------------
/MLVB-API-Example/Basic/LiveLink/.gitignore:
--------------------------------------------------------------------------------
1 | /build
--------------------------------------------------------------------------------
/MLVB-API-Example/Basic/LiveLink/build.gradle:
--------------------------------------------------------------------------------
1 | apply plugin: 'com.android.library'
2 |
3 | android {
4 | compileSdkVersion rootProject.ext.compileSdkVersion
5 | buildToolsVersion rootProject.ext.buildToolsVersion
6 |
7 | defaultConfig {
8 | minSdkVersion rootProject.ext.minSdkVersion
9 | targetSdkVersion rootProject.ext.targetSdkVersion
10 | versionCode 1
11 | versionName "1.0"
12 | ndk {
13 | abiFilters "armeabi-v7a", "arm64-v8a"
14 | }
15 | }
16 |
17 | buildTypes {
18 | release {
19 | minifyEnabled false
20 | proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
21 | }
22 | }
23 | }
24 |
25 | dependencies {
26 | implementation fileTree(dir: "libs", include: ["*.jar"])
27 | implementation 'androidx.appcompat:appcompat:1.1.0'
28 | implementation rootProject.ext.liteavSdk
29 | implementation project(':Debug')
30 | implementation project(':Common')
31 | }
--------------------------------------------------------------------------------
/MLVB-API-Example/Basic/LiveLink/proguard-rules.pro:
--------------------------------------------------------------------------------
1 | # Add project specific ProGuard rules here.
2 | # You can control the set of applied configuration files using the
3 | # proguardFiles setting in build.gradle.
4 | #
5 | # For more details, see
6 | # http://developer.android.com/guide/developing/tools/proguard.html
7 |
8 | # If your project uses WebView with JS, uncomment the following
9 | # and specify the fully qualified class name to the JavaScript interface
10 | # class:
11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview {
12 | # public *;
13 | #}
14 |
15 | # Uncomment this to preserve the line number information for
16 | # debugging stack traces.
17 | #-keepattributes SourceFile,LineNumberTable
18 |
19 | # If you keep the line number information, uncomment this to
20 | # hide the original source file name.
21 | #-renamesourcefileattribute SourceFile
--------------------------------------------------------------------------------
/MLVB-API-Example/Basic/LiveLink/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
7 |
11 |
15 |
19 |
20 |
21 |
22 |
--------------------------------------------------------------------------------
/MLVB-API-Example/Basic/LiveLink/src/main/res/drawable/livelink_selector_role_btn_bg.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/MLVB-API-Example/Basic/LiveLink/src/main/res/drawable/livelink_start_link.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LiteAVSDK/Live_Android/47797c0f61a54ec0173630200cb7147bb2d9eb82/MLVB-API-Example/Basic/LiveLink/src/main/res/drawable/livelink_start_link.png
--------------------------------------------------------------------------------
/MLVB-API-Example/Basic/LiveLink/src/main/res/drawable/livelink_stop_link.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LiteAVSDK/Live_Android/47797c0f61a54ec0173630200cb7147bb2d9eb82/MLVB-API-Example/Basic/LiveLink/src/main/res/drawable/livelink_stop_link.png
--------------------------------------------------------------------------------
/MLVB-API-Example/Basic/LiveLink/src/main/res/layout/livelink_activity_live_link_anchor.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
11 |
12 |
15 |
16 |
23 |
24 |
32 |
33 |
34 |
35 |
44 |
45 |
51 |
52 |
58 |
59 |
63 |
64 |
65 |
66 |
--------------------------------------------------------------------------------
/MLVB-API-Example/Basic/LiveLink/src/main/res/layout/livelink_activity_live_link_audience.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
11 |
12 |
15 |
16 |
23 |
24 |
32 |
33 |
34 |
43 |
44 |
50 |
51 |
57 |
58 |
62 |
63 |
64 |
--------------------------------------------------------------------------------
/MLVB-API-Example/Basic/LiveLink/src/main/res/values-en/strings.xml:
--------------------------------------------------------------------------------
1 |
2 | live
3 | Start Pusher
4 | Start Play
5 | OK
6 | Co-anchor
7 | Co-anchor
8 | MLVB Co-anchoring
9 | Live Name
10 | User Id
11 | Role
12 | Anchor
13 | Audience
14 | RTC Publishing
15 | Stop
16 | Failed to mix streams.
17 | LEB Playback
18 | Please enter the UserId of the audience
19 | Co-anchoring: \n1. Anchor A\n1.1 Anchor A starts publishing streams.\n1.2 Anchor A’s audience play anchor A’s streams.\n1.3 The co-anchoring user B plays anchor A’s streams.\n\n2. Co-anchoring user B\n2.1 The co-anchoring user B input userId and streamId.\n2.2 The co-anchoring user B stops playing webrtc streams.\n2.3 The co-anchoring user B playing rtc streams.\n2.4 The co-anchoring user B starts publishing streams.\n\n3. Co-anchoring\n3.1 User B’s streams are mixed into anchor A’s.
20 | Next
21 | Currently only supported in China, other regions are continuing to develop.
22 |
23 |
24 |
--------------------------------------------------------------------------------
/MLVB-API-Example/Basic/LiveLink/src/main/res/values/colors.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | #FFFFFF
4 | #000000
5 |
6 |
--------------------------------------------------------------------------------
/MLVB-API-Example/Basic/LiveLink/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 | live
3 | 开始推流
4 | 开始拉流
5 | 确定
6 | 开始连麦
7 | 接受连麦
8 | MLVB 连麦互动
9 | 请输入直播间名称
10 | 请输入用户名
11 | 请选择角色
12 | 主播
13 | 观众
14 | RTC推流
15 | 停止连麦
16 | 混流失败
17 | 快直播拉流
18 | 请输入观众的用户名
19 | 连麦互动场景实现:\n1、主播A\n1.1、主播A开始推流\n1.2、主播A的观众拉主播A的流\n1.3、主播A的连麦观众B拉主播A的流\n\n2、连麦观众B\n2.1、连麦观众B输入自己的推流streamId和userId\n2.2、连麦观众B开始停止快直播拉流\n2.3、连麦观众B开始拉主播A的RTC流\n2.4、连麦观众B开始推流\n\n3、主播A连麦连麦观众B\n3.1、主播A与连麦观众B混流到主播A
20 | 下一步
21 | 目前仅中国大陆支持,其他地区正持续开发中。
22 |
23 |
--------------------------------------------------------------------------------
/MLVB-API-Example/Basic/LiveLink/src/main/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
5 |
7 |
8 |
17 |
18 |
22 |
23 |
24 |
--------------------------------------------------------------------------------
/MLVB-API-Example/Basic/LivePK/.gitignore:
--------------------------------------------------------------------------------
1 | /build
--------------------------------------------------------------------------------
/MLVB-API-Example/Basic/LivePK/build.gradle:
--------------------------------------------------------------------------------
1 | apply plugin: 'com.android.library'
2 |
3 | android {
4 | compileSdkVersion rootProject.ext.compileSdkVersion
5 | buildToolsVersion rootProject.ext.buildToolsVersion
6 |
7 | defaultConfig {
8 | minSdkVersion rootProject.ext.minSdkVersion
9 | targetSdkVersion rootProject.ext.targetSdkVersion
10 | versionCode 1
11 | versionName "1.0"
12 | ndk {
13 | abiFilters "armeabi-v7a", "arm64-v8a"
14 | }
15 | }
16 |
17 | buildTypes {
18 | release {
19 | minifyEnabled false
20 | proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
21 | }
22 | }
23 | }
24 |
25 | dependencies {
26 | implementation fileTree(dir: "libs", include: ["*.jar"])
27 | implementation 'androidx.appcompat:appcompat:1.1.0'
28 | implementation rootProject.ext.liteavSdk
29 | implementation project(':Debug')
30 | implementation project(':Common')
31 | }
--------------------------------------------------------------------------------
/MLVB-API-Example/Basic/LivePK/proguard-rules.pro:
--------------------------------------------------------------------------------
1 | # Add project specific ProGuard rules here.
2 | # You can control the set of applied configuration files using the
3 | # proguardFiles setting in build.gradle.
4 | #
5 | # For more details, see
6 | # http://developer.android.com/guide/developing/tools/proguard.html
7 |
8 | # If your project uses WebView with JS, uncomment the following
9 | # and specify the fully qualified class name to the JavaScript interface
10 | # class:
11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview {
12 | # public *;
13 | #}
14 |
15 | # Uncomment this to preserve the line number information for
16 | # debugging stack traces.
17 | #-keepattributes SourceFile,LineNumberTable
18 |
19 | # If you keep the line number information, uncomment this to
20 | # hide the original source file name.
21 | #-renamesourcefileattribute SourceFile
--------------------------------------------------------------------------------
/MLVB-API-Example/Basic/LivePK/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
7 |
11 |
15 |
19 |
20 |
21 |
22 |
--------------------------------------------------------------------------------
/MLVB-API-Example/Basic/LivePK/src/main/res/drawable/livepk_selector_role_btn_bg.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/MLVB-API-Example/Basic/LivePK/src/main/res/drawable/livepk_start_link.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LiteAVSDK/Live_Android/47797c0f61a54ec0173630200cb7147bb2d9eb82/MLVB-API-Example/Basic/LivePK/src/main/res/drawable/livepk_start_link.png
--------------------------------------------------------------------------------
/MLVB-API-Example/Basic/LivePK/src/main/res/drawable/livepk_stop_link.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LiteAVSDK/Live_Android/47797c0f61a54ec0173630200cb7147bb2d9eb82/MLVB-API-Example/Basic/LivePK/src/main/res/drawable/livepk_stop_link.png
--------------------------------------------------------------------------------
/MLVB-API-Example/Basic/LivePK/src/main/res/layout/livepk_activity_live_pk_anchor.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
13 |
14 |
19 |
28 |
29 |
35 |
36 |
42 |
43 |
47 |
48 |
49 |
50 |
53 |
54 |
61 |
62 |
70 |
71 |
72 |
--------------------------------------------------------------------------------
/MLVB-API-Example/Basic/LivePK/src/main/res/layout/livepk_activity_live_pk_audience.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
14 |
15 |
18 |
19 |
26 |
27 |
35 |
36 |
37 |
--------------------------------------------------------------------------------
/MLVB-API-Example/Basic/LivePK/src/main/res/values-en/strings.xml:
--------------------------------------------------------------------------------
1 |
2 | live
3 | Compete
4 | Competition
5 | Stream Id
6 | User Id
7 | Role
8 | Anchor
9 | Audience
10 | RTC Publishing
11 | End
12 | Failed to mix streams.
13 | LVB Playback
14 | Competition: \n1. Anchor A\n1.1 Anchor A starts publishing streams.\n1.2 Anchor A’s audience play anchor A’s streams.\n\n2. Anchor B\n2.1 Anchor B starts publishing streams.\n2.2 Anchor B’s audience play anchor B’s streams.\n\n3. Co-anchoring\n3.1 Anchor A plays anchor B’s streams.\n3.2 Anchor B’s streams are mixed into anchor A’s.\n3.3 Anchor B plays anchor A’s streams.\n3.4 Anchor A’s streams are mixed into anchor B’s.
15 | Next
16 | OK
17 | Please Input Other StreamId
18 | Currently only supported in China, other regions are continuing to develop.
19 |
20 |
21 |
--------------------------------------------------------------------------------
/MLVB-API-Example/Basic/LivePK/src/main/res/values/colors.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | #FFFFFF
4 | #000000
5 |
6 |
--------------------------------------------------------------------------------
/MLVB-API-Example/Basic/LivePK/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 | live
3 | 开始PK
4 | MLVB PK互动
5 | 请输入直播间名称
6 | 请输入用户名
7 | 请选择角色
8 | 主播
9 | 观众
10 | RTC推流
11 | 停止PK
12 | 混流失败
13 | 快直播拉流
14 | 连麦PK场景实现:\n1、主播A\n1.1、主播A开始推流\n1.2、主播A的观众拉主播A的流\n\n2、主播B\n2.1、主播B开始推流\n2.2、主播B的观众拉主播B的流\n\n3、主播A连麦主播B\n3.1、主播A拉主播B的流\n3.2、主播A与主播B混流到主播A\n3.3、主播B拉主播A的流\n3.4、主播B与主播A混流到主播B
15 | 下一步
16 | 确定
17 | 请输入对方的直播间名称
18 | 目前仅中国大陆支持,其他地区正持续开发中。
19 |
20 |
--------------------------------------------------------------------------------
/MLVB-API-Example/Basic/LivePK/src/main/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
5 |
7 |
8 |
17 |
18 |
22 |
23 |
24 |
--------------------------------------------------------------------------------
/MLVB-API-Example/Basic/LivePlay/.gitignore:
--------------------------------------------------------------------------------
1 | /build
--------------------------------------------------------------------------------
/MLVB-API-Example/Basic/LivePlay/build.gradle:
--------------------------------------------------------------------------------
1 | apply plugin: 'com.android.library'
2 |
3 | android {
4 | compileSdkVersion rootProject.ext.compileSdkVersion
5 | buildToolsVersion rootProject.ext.buildToolsVersion
6 |
7 | defaultConfig {
8 | minSdkVersion rootProject.ext.minSdkVersion
9 | targetSdkVersion rootProject.ext.targetSdkVersion
10 | versionCode 1
11 | versionName "1.0"
12 | ndk {
13 | abiFilters "armeabi-v7a", "arm64-v8a"
14 | }
15 | }
16 |
17 | buildTypes {
18 | release {
19 | minifyEnabled false
20 | proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
21 | }
22 | }
23 | }
24 |
25 | dependencies {
26 | implementation fileTree(dir: "libs", include: ["*.jar"])
27 | implementation 'androidx.appcompat:appcompat:1.1.0'
28 | implementation rootProject.ext.liteavSdk
29 | implementation project(':Debug')
30 | implementation project(':Common')
31 | }
--------------------------------------------------------------------------------
/MLVB-API-Example/Basic/LivePlay/proguard-rules.pro:
--------------------------------------------------------------------------------
1 | # Add project specific ProGuard rules here.
2 | # You can control the set of applied configuration files using the
3 | # proguardFiles setting in build.gradle.
4 | #
5 | # For more details, see
6 | # http://developer.android.com/guide/developing/tools/proguard.html
7 |
8 | # If your project uses WebView with JS, uncomment the following
9 | # and specify the fully qualified class name to the JavaScript interface
10 | # class:
11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview {
12 | # public *;
13 | #}
14 |
15 | # Uncomment this to preserve the line number information for
16 | # debugging stack traces.
17 | #-keepattributes SourceFile,LineNumberTable
18 |
19 | # If you keep the line number information, uncomment this to
20 | # hide the original source file name.
21 | #-renamesourcefileattribute SourceFile
--------------------------------------------------------------------------------
/MLVB-API-Example/Basic/LivePlay/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
10 |
11 |
15 |
16 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/MLVB-API-Example/Basic/LivePlay/src/main/java/com/tencent/mlvb/liveplay/LivePlayEnterActivity.java:
--------------------------------------------------------------------------------
1 | package com.tencent.mlvb.liveplay;
2 |
3 | import android.content.Intent;
4 | import android.os.Bundle;
5 | import android.text.SpannableString;
6 | import android.text.Spanned;
7 | import android.text.TextUtils;
8 | import android.text.method.LinkMovementMethod;
9 | import android.text.style.URLSpan;
10 | import android.view.View;
11 | import android.widget.EditText;
12 | import android.widget.TextView;
13 | import android.widget.Toast;
14 |
15 | import androidx.annotation.Nullable;
16 |
17 | import com.tencent.mlvb.common.MLVBBaseActivity;
18 |
19 | /**
20 | * Playback Entrance View
21 | * You can play streams over RTMP, FLV, HLS or RTC.
22 | * - For the playback view, see {@link LivePlayActivity}.
23 | * RTC Play Currently only supported in China, other regions are continuing to develop.
24 | */
25 | public class LivePlayEnterActivity extends MLVBBaseActivity {
26 |
27 | private EditText mEditStreamId;
28 | private TextView mTextDesc;
29 |
30 | @Override
31 | protected void onCreate(@Nullable Bundle savedInstanceState) {
32 | super.onCreate(savedInstanceState);
33 | setContentView(R.layout.liveplay_activity_live_play_enter);
34 | initView();
35 | }
36 |
37 | private void initView() {
38 | mEditStreamId = findViewById(R.id.et_stream_id);
39 |
40 | mEditStreamId.setText(generateStreamId());
41 | findViewById(R.id.btn_play_rtmp).setOnClickListener(new View.OnClickListener() {
42 | @Override
43 | public void onClick(View view) {
44 | startPlay(0);
45 | }
46 | });
47 |
48 | findViewById(R.id.btn_play_flv).setOnClickListener(new View.OnClickListener() {
49 | @Override
50 | public void onClick(View view) {
51 | startPlay(1);
52 | }
53 | });
54 |
55 | findViewById(R.id.btn_play_hls).setOnClickListener(new View.OnClickListener() {
56 | @Override
57 | public void onClick(View view) {
58 | startPlay(2);
59 | }
60 | });
61 |
62 | findViewById(R.id.btn_play_rtc).setOnClickListener(new View.OnClickListener() {
63 | @Override
64 | public void onClick(View view) {
65 | startPlay(3);
66 | }
67 | });
68 |
69 | mTextDesc = findViewById(R.id.tv_desc);
70 |
71 | String text = mTextDesc.getText().toString();
72 |
73 | SpannableString str = new SpannableString(text);
74 | str.setSpan(new URLSpan("https://cloud.tencent.com/document/product/454/56598"), text.indexOf("https://"),
75 | text.indexOf("56598") + 5, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
76 | mTextDesc.setMovementMethod(LinkMovementMethod.getInstance());
77 | mTextDesc.setText(str);
78 | }
79 |
80 | private void startPlay(int type) {
81 | String streamId = mEditStreamId.getText().toString();
82 | if (TextUtils.isEmpty(streamId)) {
83 | Toast.makeText(LivePlayEnterActivity.this, getString(R.string.liveplay_please_input_streamid),
84 | Toast.LENGTH_SHORT).show();
85 | } else {
86 | Intent intent = new Intent(LivePlayEnterActivity.this, LivePlayActivity.class);
87 | intent.putExtra("STREAM_ID", streamId);
88 | intent.putExtra("STREAM_TYPE", type);
89 | startActivity(intent);
90 | }
91 | }
92 |
93 | @Override
94 | protected void onPermissionGranted() {
95 |
96 | }
97 | }
98 |
--------------------------------------------------------------------------------
/MLVB-API-Example/Basic/LivePlay/src/main/res/layout/liveplay_activity_live_play.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
11 |
12 |
15 |
16 |
23 |
24 |
32 |
33 |
34 |
47 |
48 |
--------------------------------------------------------------------------------
/MLVB-API-Example/Basic/LivePlay/src/main/res/values-en/strings.xml:
--------------------------------------------------------------------------------
1 |
2 | live
3 | Mute
4 | MLVB Playback
5 | Stream Id
6 | Tencent Cloud’s proprietary RTC protocol features low latency and strong adaptability to poor network conditions, and can be used worldwide. It is suitable for application scenarios such as e-commerce streaming and sports streaming. For details, visit https://cloud.tencent.com/document/product/454/56598. Currently only supported by mainland China, other regions are continuing to develop.
7 | RTC Playback
8 | RTMP Playback
9 | LEB Playback (Recommended))
10 | Unmute
11 | FLV Playback
12 | HLS Playback
13 |
14 |
--------------------------------------------------------------------------------
/MLVB-API-Example/Basic/LivePlay/src/main/res/values/colors.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | #FFFFFF
4 | #000000
5 |
6 |
--------------------------------------------------------------------------------
/MLVB-API-Example/Basic/LivePlay/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 | live
3 | 静音
4 | MLVB 直播拉流
5 | 请输入streamId
6 | RTC拉流为腾讯云自研实时音视频协议,超低延迟、抗弱网能力强,全球覆盖适用于电商秒杀,体育赛事等多个场景,更多细节详见:https://cloud.tencent.com/document/product/454/56598 目前仅仅中国大陆支持,其他地区正持续开发中。\n\n标准直播拉流支持FLV、RTMP、HLS等多种格式,成熟度高,并 发量强,但是延迟高
7 | RTC拉流
8 | RTMP拉流
9 | 快直播拉流(推荐)
10 | 取消静音
11 | FLV拉流
12 | HLS拉流
13 |
14 |
--------------------------------------------------------------------------------
/MLVB-API-Example/Basic/LivePlay/src/main/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
5 |
7 |
8 |
17 |
18 |
22 |
23 |
24 |
--------------------------------------------------------------------------------
/MLVB-API-Example/Basic/LivePushCamera/.gitignore:
--------------------------------------------------------------------------------
1 | /build
--------------------------------------------------------------------------------
/MLVB-API-Example/Basic/LivePushCamera/build.gradle:
--------------------------------------------------------------------------------
1 | apply plugin: 'com.android.library'
2 |
3 | android {
4 | compileSdkVersion rootProject.ext.compileSdkVersion
5 | buildToolsVersion rootProject.ext.buildToolsVersion
6 |
7 | defaultConfig {
8 | minSdkVersion rootProject.ext.minSdkVersion
9 | targetSdkVersion rootProject.ext.targetSdkVersion
10 | versionCode 1
11 | versionName "1.0"
12 | ndk {
13 | abiFilters "armeabi-v7a", "arm64-v8a"
14 | }
15 | }
16 |
17 | buildTypes {
18 | release {
19 | minifyEnabled false
20 | proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
21 | }
22 | }
23 | }
24 |
25 | dependencies {
26 | implementation fileTree(dir: "libs", include: ["*.jar"])
27 | implementation 'androidx.appcompat:appcompat:1.1.0'
28 | implementation rootProject.ext.liteavSdk
29 | implementation project(':Debug')
30 | implementation project(':Common')
31 | }
--------------------------------------------------------------------------------
/MLVB-API-Example/Basic/LivePushCamera/proguard-rules.pro:
--------------------------------------------------------------------------------
1 | # Add project specific ProGuard rules here.
2 | # You can control the set of applied configuration files using the
3 | # proguardFiles setting in build.gradle.
4 | #
5 | # For more details, see
6 | # http://developer.android.com/guide/developing/tools/proguard.html
7 |
8 | # If your project uses WebView with JS, uncomment the following
9 | # and specify the fully qualified class name to the JavaScript interface
10 | # class:
11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview {
12 | # public *;
13 | #}
14 |
15 | # Uncomment this to preserve the line number information for
16 | # debugging stack traces.
17 | #-keepattributes SourceFile,LineNumberTable
18 |
19 | # If you keep the line number information, uncomment this to
20 | # hide the original source file name.
21 | #-renamesourcefileattribute SourceFile
--------------------------------------------------------------------------------
/MLVB-API-Example/Basic/LivePushCamera/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
3 |
4 |
5 |
6 |
10 |
11 |
12 |
16 |
17 |
18 |
19 |
20 |
--------------------------------------------------------------------------------
/MLVB-API-Example/Basic/LivePushCamera/src/main/res/drawable/livepusher_content_bg.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
7 |
--------------------------------------------------------------------------------
/MLVB-API-Example/Basic/LivePushCamera/src/main/res/menu/livepushcamera_mirror.xml:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/MLVB-API-Example/Basic/LivePushCamera/src/main/res/menu/livepushcamera_resolution.xml:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/MLVB-API-Example/Basic/LivePushCamera/src/main/res/menu/livepushcamera_rotate.xml:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/MLVB-API-Example/Basic/LivePushCamera/src/main/res/mipmap-xxhdpi/app_ic_bottom_camera_back.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LiteAVSDK/Live_Android/47797c0f61a54ec0173630200cb7147bb2d9eb82/MLVB-API-Example/Basic/LivePushCamera/src/main/res/mipmap-xxhdpi/app_ic_bottom_camera_back.png
--------------------------------------------------------------------------------
/MLVB-API-Example/Basic/LivePushCamera/src/main/res/mipmap-xxhdpi/app_ic_bottom_camera_front.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LiteAVSDK/Live_Android/47797c0f61a54ec0173630200cb7147bb2d9eb82/MLVB-API-Example/Basic/LivePushCamera/src/main/res/mipmap-xxhdpi/app_ic_bottom_camera_front.png
--------------------------------------------------------------------------------
/MLVB-API-Example/Basic/LivePushCamera/src/main/res/mipmap-xxhdpi/app_ic_bottom_mic_off.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LiteAVSDK/Live_Android/47797c0f61a54ec0173630200cb7147bb2d9eb82/MLVB-API-Example/Basic/LivePushCamera/src/main/res/mipmap-xxhdpi/app_ic_bottom_mic_off.png
--------------------------------------------------------------------------------
/MLVB-API-Example/Basic/LivePushCamera/src/main/res/mipmap-xxhdpi/app_ic_bottom_mic_on.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LiteAVSDK/Live_Android/47797c0f61a54ec0173630200cb7147bb2d9eb82/MLVB-API-Example/Basic/LivePushCamera/src/main/res/mipmap-xxhdpi/app_ic_bottom_mic_on.png
--------------------------------------------------------------------------------
/MLVB-API-Example/Basic/LivePushCamera/src/main/res/mipmap-xxhdpi/app_ic_close.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LiteAVSDK/Live_Android/47797c0f61a54ec0173630200cb7147bb2d9eb82/MLVB-API-Example/Basic/LivePushCamera/src/main/res/mipmap-xxhdpi/app_ic_close.png
--------------------------------------------------------------------------------
/MLVB-API-Example/Basic/LivePushCamera/src/main/res/mipmap-xxhdpi/app_ic_ic_back.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LiteAVSDK/Live_Android/47797c0f61a54ec0173630200cb7147bb2d9eb82/MLVB-API-Example/Basic/LivePushCamera/src/main/res/mipmap-xxhdpi/app_ic_ic_back.png
--------------------------------------------------------------------------------
/MLVB-API-Example/Basic/LivePushCamera/src/main/res/mipmap-xxhdpi/app_ic_plus.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LiteAVSDK/Live_Android/47797c0f61a54ec0173630200cb7147bb2d9eb82/MLVB-API-Example/Basic/LivePushCamera/src/main/res/mipmap-xxhdpi/app_ic_plus.png
--------------------------------------------------------------------------------
/MLVB-API-Example/Basic/LivePushCamera/src/main/res/mipmap-xxhdpi/app_ic_remote_video_off.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LiteAVSDK/Live_Android/47797c0f61a54ec0173630200cb7147bb2d9eb82/MLVB-API-Example/Basic/LivePushCamera/src/main/res/mipmap-xxhdpi/app_ic_remote_video_off.png
--------------------------------------------------------------------------------
/MLVB-API-Example/Basic/LivePushCamera/src/main/res/mipmap-xxhdpi/app_ic_remote_video_on.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LiteAVSDK/Live_Android/47797c0f61a54ec0173630200cb7147bb2d9eb82/MLVB-API-Example/Basic/LivePushCamera/src/main/res/mipmap-xxhdpi/app_ic_remote_video_on.png
--------------------------------------------------------------------------------
/MLVB-API-Example/Basic/LivePushCamera/src/main/res/values-en/strings.xml:
--------------------------------------------------------------------------------
1 |
2 | live
3 | Check that streams are being published.
4 | Front Camera On
5 | Front & Rear Cameras On
6 | Front & Rear Cameras Off
7 | Mic Off
8 | Mic On
9 | Stream Id
10 | MLVB Publishing (Camera)
11 | Audio Settings
12 | Video Settings
13 | Resolution
14 | Local Preview Rotation
15 | Local Preview Mirror
16 | MLVB Publishing (Camera)
17 | Tencent Cloud’s proprietary RTC protocol features lower latency and better adaptability to poor network conditions when compared with traditional live streaming protocols, and can be used worldwide. For details, visit https://cloud.tencent.com/document/product/454/56592 Currently only supported in China, other regions are continuing to develop.
18 | Audio Quality
19 | Default
20 | Speech
21 | Music
22 | LVB Playback
23 | RTC Publishing
24 |
25 |
--------------------------------------------------------------------------------
/MLVB-API-Example/Basic/LivePushCamera/src/main/res/values/colors.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | #FFFFFF
4 | #000000
5 |
6 |
--------------------------------------------------------------------------------
/MLVB-API-Example/Basic/LivePushCamera/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 | live
3 | 请确保正在推流中
4 | 前摄开启
5 | 前后摄均开启
6 | 前后摄均关闭
7 | 关闭麦克风
8 | 打开麦克风
9 | 请输入streamId
10 | MLVB 摄像头推流
11 | 音频设置
12 | 视频设置
13 | 分辨率
14 | 本地预览旋转角度
15 | 本地预览镜像
16 | MLVB 摄像头推流
17 | RTC推流为腾讯云自研实时音视频协议,相比传统的直播协议,具备如下优势:超低延迟、弱网超强抗性、支持全球范围,更多细节详见:https://cloud.tencent.com/document/product/454/56592 目前仅中国大陆支持,其他地区正持续开发中。
18 | 请选择音频质量
19 | 默认
20 | 语音
21 | 音乐
22 | 标准直播推流
23 | RTC推流(推荐)
24 |
25 |
--------------------------------------------------------------------------------
/MLVB-API-Example/Basic/LivePushCamera/src/main/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
5 |
7 |
8 |
17 |
18 |
22 |
23 |
24 |
--------------------------------------------------------------------------------
/MLVB-API-Example/Basic/LivePushScreen/.gitignore:
--------------------------------------------------------------------------------
1 | /build
--------------------------------------------------------------------------------
/MLVB-API-Example/Basic/LivePushScreen/build.gradle:
--------------------------------------------------------------------------------
1 | apply plugin: 'com.android.library'
2 |
3 | android {
4 | compileSdkVersion rootProject.ext.compileSdkVersion
5 | buildToolsVersion rootProject.ext.buildToolsVersion
6 |
7 | defaultConfig {
8 | minSdkVersion rootProject.ext.minSdkVersion
9 | targetSdkVersion rootProject.ext.targetSdkVersion
10 | versionCode 1
11 | versionName "1.0"
12 | ndk {
13 | abiFilters "armeabi-v7a", "arm64-v8a"
14 | }
15 | }
16 |
17 | buildTypes {
18 | release {
19 | minifyEnabled false
20 | proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
21 | }
22 | }
23 | }
24 |
25 | dependencies {
26 | implementation fileTree(dir: "libs", include: ["*.jar"])
27 | implementation 'androidx.appcompat:appcompat:1.1.0'
28 | implementation rootProject.ext.liteavSdk
29 | implementation project(':Debug')
30 | implementation project(':Common')
31 | }
--------------------------------------------------------------------------------
/MLVB-API-Example/Basic/LivePushScreen/proguard-rules.pro:
--------------------------------------------------------------------------------
1 | # Add project specific ProGuard rules here.
2 | # You can control the set of applied configuration files using the
3 | # proguardFiles setting in build.gradle.
4 | #
5 | # For more details, see
6 | # http://developer.android.com/guide/developing/tools/proguard.html
7 |
8 | # If your project uses WebView with JS, uncomment the following
9 | # and specify the fully qualified class name to the JavaScript interface
10 | # class:
11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview {
12 | # public *;
13 | #}
14 |
15 | # Uncomment this to preserve the line number information for
16 | # debugging stack traces.
17 | #-keepattributes SourceFile,LineNumberTable
18 |
19 | # If you keep the line number information, uncomment this to
20 | # hide the original source file name.
21 | #-renamesourcefileattribute SourceFile
--------------------------------------------------------------------------------
/MLVB-API-Example/Basic/LivePushScreen/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
7 |
8 |
12 |
13 |
17 |
18 |
21 |
22 |
23 |
24 |
--------------------------------------------------------------------------------
/MLVB-API-Example/Basic/LivePushScreen/src/main/res/drawable/livepusher_content_bg.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
7 |
--------------------------------------------------------------------------------
/MLVB-API-Example/Basic/LivePushScreen/src/main/res/layout/livepushscreen_activity_push_screen.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
10 |
11 |
18 |
19 |
27 |
28 |
29 |
30 |
42 |
43 |
--------------------------------------------------------------------------------
/MLVB-API-Example/Basic/LivePushScreen/src/main/res/values-en/strings.xml:
--------------------------------------------------------------------------------
1 |
2 | live
3 | Publish from Screen
4 | MLVB Publishing (Screen)
5 | Stream Id
6 | Audio Quality
7 | Default
8 | Speech
9 | Music
10 | LVB Playback
11 | Tencent Cloud’s proprietary RTC protocol features lower latency and better adaptability to poor network conditions when compared with traditional live streaming protocols, and can be used worldwide. For details, visit https://cloud.tencent.com/document/product/454/56595 Currently only supported in China, other regions are continuing to develop.
12 | RTC Publishing
13 | Stop
14 |
15 |
--------------------------------------------------------------------------------
/MLVB-API-Example/Basic/LivePushScreen/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 | live
3 | 开始录屏推流
4 | MLVB 录屏推流
5 | 请输入streamId
6 | 请选择音频质量
7 | 默认
8 | 语音
9 | 音乐
10 | 标准直播推流
11 | RTC推流为腾讯云自研实时音视频协议,相比传统的直播协议,具备如下优势:超低延迟、弱网超强抗性、支持全球范围,更多细节详见:https://cloud.tencent.com/document/product/454/56595 目前仅中国大陆支持,其他地区正持续开发中。
12 | RTC推流(推荐)
13 | 关闭录屏推流
14 |
15 |
--------------------------------------------------------------------------------
/MLVB-API-Example/Basic/LivePushScreen/src/main/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
5 |
7 |
8 |
17 |
18 |
22 |
23 |
24 |
--------------------------------------------------------------------------------
/MLVB-API-Example/Common/.gitignore:
--------------------------------------------------------------------------------
1 | /build
--------------------------------------------------------------------------------
/MLVB-API-Example/Common/build.gradle:
--------------------------------------------------------------------------------
1 | plugins {
2 | id 'com.android.library'
3 | }
4 |
5 |
6 | android {
7 | compileSdkVersion rootProject.ext.compileSdkVersion
8 | buildToolsVersion rootProject.ext.buildToolsVersion
9 |
10 | defaultConfig {
11 | minSdkVersion rootProject.ext.minSdkVersion
12 | targetSdkVersion rootProject.ext.targetSdkVersion
13 | versionCode 1
14 | versionName "1.0"
15 | ndk {
16 | abiFilters "armeabi-v7a", "arm64-v8a"
17 | }
18 | }
19 |
20 | buildTypes {
21 | release {
22 | minifyEnabled false
23 | proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
24 | }
25 | }
26 |
27 | }
28 |
29 | dependencies {
30 |
31 | implementation 'androidx.appcompat:appcompat:1.1.0'
32 | implementation project(':Debug')
33 | }
--------------------------------------------------------------------------------
/MLVB-API-Example/Common/proguard-rules.pro:
--------------------------------------------------------------------------------
1 | # Add project specific ProGuard rules here.
2 | # You can control the set of applied configuration files using the
3 | # proguardFiles setting in build.gradle.
4 | #
5 | # For more details, see
6 | # http://developer.android.com/guide/developing/tools/proguard.html
7 |
8 | # If your project uses WebView with JS, uncomment the following
9 | # and specify the fully qualified class name to the JavaScript interface
10 | # class:
11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview {
12 | # public *;
13 | #}
14 |
15 | # Uncomment this to preserve the line number information for
16 | # debugging stack traces.
17 | #-keepattributes SourceFile,LineNumberTable
18 |
19 | # If you keep the line number information, uncomment this to
20 | # hide the original source file name.
21 | #-renamesourcefileattribute SourceFile
--------------------------------------------------------------------------------
/MLVB-API-Example/Common/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/MLVB-API-Example/Common/src/main/java/com/tencent/mlvb/common/FlowRadioGroup.java:
--------------------------------------------------------------------------------
1 | package com.tencent.mlvb.common;
2 |
3 | import android.content.Context;
4 | import android.util.AttributeSet;
5 | import android.view.View;
6 | import android.widget.RadioGroup;
7 |
8 | /**
9 | * RadioGroup that implements automatic line wrapping
10 | */
11 | public class FlowRadioGroup extends RadioGroup {
12 | public FlowRadioGroup(Context context) {
13 | super(context);
14 | }
15 |
16 | public FlowRadioGroup(Context context, AttributeSet attrs) {
17 | super(context, attrs);
18 | }
19 |
20 | @Override
21 | protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
22 | int widthSize = MeasureSpec.getSize(widthMeasureSpec);
23 |
24 | measureChildren(widthMeasureSpec, heightMeasureSpec);
25 |
26 | int maxWidth = 0;
27 | int totalHeight = 0;
28 | int lineWidth = 0;
29 | int maxLineHeight = 0;
30 | int oldHeight;
31 | int oldWidth;
32 |
33 | int count = getChildCount();
34 | for (int i = 0; i < count; i++) {
35 | View child = getChildAt(i);
36 | MarginLayoutParams params = (MarginLayoutParams) child.getLayoutParams();
37 | oldHeight = maxLineHeight;
38 | oldWidth = maxWidth;
39 |
40 | int deltaX = child.getMeasuredWidth() + params.leftMargin + params.rightMargin;
41 | if (lineWidth + deltaX + getPaddingLeft() + getPaddingRight() > widthSize) {
42 | maxWidth = Math.max(lineWidth, oldWidth);
43 | lineWidth = deltaX;
44 | totalHeight += oldHeight;
45 | maxLineHeight = child.getMeasuredHeight() + params.topMargin + params.bottomMargin;
46 |
47 | } else {
48 | lineWidth += deltaX;
49 | int deltaY = child.getMeasuredHeight() + params.topMargin + params.bottomMargin;
50 | maxLineHeight = Math.max(maxLineHeight, deltaY);
51 | }
52 | if (i == count - 1) {
53 | totalHeight += maxLineHeight;
54 | maxWidth = Math.max(lineWidth, oldWidth);
55 | }
56 | }
57 | maxWidth += getPaddingLeft() + getPaddingRight();
58 | totalHeight += getPaddingTop() + getPaddingBottom();
59 | int widthMode = MeasureSpec.getMode(widthMeasureSpec);
60 | int heightSize = MeasureSpec.getSize(heightMeasureSpec);
61 | int heightMode = MeasureSpec.getMode(heightMeasureSpec);
62 | setMeasuredDimension(widthMode == MeasureSpec.EXACTLY ? widthSize : maxWidth,
63 | heightMode == MeasureSpec.EXACTLY ? heightSize : totalHeight);
64 | }
65 |
66 | @Override
67 | protected void onLayout(boolean changed, int l, int t, int r, int b) {
68 | int count = getChildCount();
69 | int preLeft = getPaddingLeft();
70 | int preTop = getPaddingTop();
71 | int maxHeight = 0;
72 | for (int i = 0; i < count; i++) {
73 | View child = getChildAt(i);
74 | MarginLayoutParams params = (MarginLayoutParams) child.getLayoutParams();
75 | if (preLeft + params.leftMargin + child.getMeasuredWidth() + params.rightMargin + getPaddingRight() > (r
76 | - l)) {
77 | preLeft = getPaddingLeft();
78 | preTop = preTop + maxHeight;
79 | maxHeight = getChildAt(i).getMeasuredHeight() + params.topMargin + params.bottomMargin;
80 | } else {
81 | maxHeight = Math.max(maxHeight, child.getMeasuredHeight() + params.topMargin + params.bottomMargin);
82 | }
83 | int left = preLeft + params.leftMargin;
84 | int top = preTop + params.topMargin;
85 | int right = left + child.getMeasuredWidth();
86 | int bottom = top + child.getMeasuredHeight();
87 | child.layout(left, top, right, bottom);
88 | preLeft += params.leftMargin + child.getMeasuredWidth() + params.rightMargin;
89 | }
90 | }
91 | }
92 |
--------------------------------------------------------------------------------
/MLVB-API-Example/Common/src/main/java/com/tencent/mlvb/common/URLUtils.java:
--------------------------------------------------------------------------------
1 | package com.tencent.mlvb.common;
2 |
3 | import com.tencent.mlvb.debug.GenerateTestUserSig;
4 | import java.io.File;
5 |
6 | /**
7 | * Generating Streaming URLs
8 | * See [https://cloud.tencent.com/document/product/454/7915].
9 | */
10 | public class URLUtils {
11 |
12 | public static final String WEBRTC = "webrtc://";
13 | public static final String RTMP = "rtmp://";
14 | public static final String HTTP = "http://";
15 | public static final String TRTC = "trtc://";
16 | public static final String TRTC_DOMAIN = "cloud.tencent.com";
17 | public static final String APP_NAME = "live";
18 |
19 | /**
20 | * Generating Publishing URLs
21 | *
22 | * @param streamId
23 | * @param userId
24 | * @param type 0:RTC 1:RTMP
25 | * @return
26 | */
27 | public static String generatePushUrl(String streamId, String userId, int type) {
28 | String pushUrl = "";
29 | if (type == 0) {
30 | pushUrl =
31 | TRTC + TRTC_DOMAIN + "/push/" + streamId + "?sdkappid=" + GenerateTestUserSig.SDKAPPID + "&userid="
32 | + userId + "&usersig=" + GenerateTestUserSig.genTestUserSig(userId);
33 | } else if (type == 1) {
34 | pushUrl = RTMP + GenerateTestUserSig.PUSH_DOMAIN + File.separator + APP_NAME + File.separator + streamId
35 | + GenerateTestUserSig.getSafeUrl(streamId);
36 | }
37 | return pushUrl;
38 | }
39 |
40 | /**
41 | * Generating Playback URLs
42 | *
43 | * @param streamId
44 | * @param userId
45 | * @param type type 0:RTMP 1:FLV 2:HLS 3:RTC 4:WEBRTC
46 | * @return
47 | */
48 | public static String generatePlayUrl(String streamId, String userId, int type) {
49 | String playUrl = "";
50 | if (type == 0) {
51 | playUrl = RTMP + GenerateTestUserSig.PLAY_DOMAIN + File.separator + APP_NAME + File.separator + streamId;
52 | } else if (type == 1) {
53 | playUrl = HTTP + GenerateTestUserSig.PLAY_DOMAIN + File.separator + APP_NAME + File.separator + streamId
54 | + ".flv";
55 | } else if (type == 2) {
56 | playUrl = HTTP + GenerateTestUserSig.PLAY_DOMAIN + File.separator + APP_NAME + File.separator + streamId
57 | + ".m3u8";
58 | } else if (type == 3) {
59 | playUrl =
60 | TRTC + TRTC_DOMAIN + "/play/" + streamId + "?sdkappid=" + GenerateTestUserSig.SDKAPPID + "&userid="
61 | + userId + "&usersig=" + GenerateTestUserSig.genTestUserSig(userId);
62 | } else if (type == 4) {
63 | playUrl = WEBRTC + GenerateTestUserSig.PLAY_DOMAIN + File.separator + APP_NAME + File.separator + streamId;
64 | }
65 | return playUrl;
66 | }
67 | }
68 |
--------------------------------------------------------------------------------
/MLVB-API-Example/Common/src/main/res/drawable/common_arrow_above.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LiteAVSDK/Live_Android/47797c0f61a54ec0173630200cb7147bb2d9eb82/MLVB-API-Example/Common/src/main/res/drawable/common_arrow_above.png
--------------------------------------------------------------------------------
/MLVB-API-Example/Common/src/main/res/drawable/common_button_bg.xml:
--------------------------------------------------------------------------------
1 |
3 |
4 |
5 |
6 |
11 |
12 |
--------------------------------------------------------------------------------
/MLVB-API-Example/Common/src/main/res/drawable/common_button_grey_bg.xml:
--------------------------------------------------------------------------------
1 |
3 |
4 |
5 |
6 |
11 |
12 |
--------------------------------------------------------------------------------
/MLVB-API-Example/Common/src/main/res/drawable/common_edit_bg.xml:
--------------------------------------------------------------------------------
1 |
3 |
4 |
5 |
6 |
11 |
12 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/MLVB-API-Example/Common/src/main/res/drawable/common_ic_select_off.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LiteAVSDK/Live_Android/47797c0f61a54ec0173630200cb7147bb2d9eb82/MLVB-API-Example/Common/src/main/res/drawable/common_ic_select_off.png
--------------------------------------------------------------------------------
/MLVB-API-Example/Common/src/main/res/drawable/common_ic_select_on.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LiteAVSDK/Live_Android/47797c0f61a54ec0173630200cb7147bb2d9eb82/MLVB-API-Example/Common/src/main/res/drawable/common_ic_select_on.png
--------------------------------------------------------------------------------
/MLVB-API-Example/Common/src/main/res/drawable/common_rb_icon_selector.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/MLVB-API-Example/Common/src/main/res/drawable/common_seekbar_style.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | -
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 | -
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 | -
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
--------------------------------------------------------------------------------
/MLVB-API-Example/Common/src/main/res/drawable/common_seekbar_thumb.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/MLVB-API-Example/Common/src/main/res/drawable/common_selector_radio_bg.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
5 |
6 |
8 |
--------------------------------------------------------------------------------
/MLVB-API-Example/Common/src/main/res/mipmap-xxhdpi/common_ic_back.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LiteAVSDK/Live_Android/47797c0f61a54ec0173630200cb7147bb2d9eb82/MLVB-API-Example/Common/src/main/res/mipmap-xxhdpi/common_ic_back.png
--------------------------------------------------------------------------------
/MLVB-API-Example/Common/src/main/res/mipmap-xxhdpi/common_user_portrait.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LiteAVSDK/Live_Android/47797c0f61a54ec0173630200cb7147bb2d9eb82/MLVB-API-Example/Common/src/main/res/mipmap-xxhdpi/common_user_portrait.png
--------------------------------------------------------------------------------
/MLVB-API-Example/Common/src/main/res/values-en/strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | Failed to join call as the user did not grant the required permission.
4 |
--------------------------------------------------------------------------------
/MLVB-API-Example/Common/src/main/res/values/colors.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | #0062e3
4 | #EFEFEF
5 | #FFFFFF
6 | #0062e3
7 | #999999
8 | #1B1B1B
9 |
--------------------------------------------------------------------------------
/MLVB-API-Example/Common/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | 用户没有允许需要的权限,加入通话失败
4 |
--------------------------------------------------------------------------------
/MLVB-API-Example/Debug/build.gradle:
--------------------------------------------------------------------------------
1 | apply plugin: 'com.android.library'
2 |
3 | android {
4 | compileSdkVersion rootProject.ext.compileSdkVersion
5 | buildToolsVersion rootProject.ext.buildToolsVersion
6 |
7 | defaultConfig {
8 | minSdkVersion rootProject.ext.minSdkVersion
9 | targetSdkVersion rootProject.ext.targetSdkVersion
10 | versionCode 1
11 | versionName "1.0"
12 | }
13 |
14 | buildTypes {
15 | release {
16 | minifyEnabled false
17 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
18 | }
19 | }
20 |
21 | }
22 |
23 | dependencies {
24 | implementation fileTree(include: ['*.jar'], dir: 'libs')
25 | }
26 |
27 |
--------------------------------------------------------------------------------
/MLVB-API-Example/Debug/proguard-rules.pro:
--------------------------------------------------------------------------------
1 | # Add project specific ProGuard rules here.
2 | # You can control the set of applied configuration files using the
3 | # proguardFiles setting in build.gradle.
4 | #
5 | # For more details, see
6 | # http://developer.android.com/guide/developing/tools/proguard.html
7 |
8 | # If your project uses WebView with JS, uncomment the following
9 | # and specify the fully qualified class name to the JavaScript interface
10 | # class:
11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview {
12 | # public *;
13 | #}
14 |
15 | # Uncomment this to preserve the line number information for
16 | # debugging stack traces.
17 | #-keepattributes SourceFile,LineNumberTable
18 |
19 | # If you keep the line number information, uncomment this to
20 | # hide the original source file name.
21 | #-renamesourcefileattribute SourceFile
22 |
--------------------------------------------------------------------------------
/MLVB-API-Example/Debug/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/MLVB-API-Example/build.gradle:
--------------------------------------------------------------------------------
1 | // Top-level build file where you can add configuration options common to all sub-projects/modules.
2 |
3 | buildscript {
4 | repositories {
5 | mavenCentral()
6 | google()
7 | jcenter()
8 | }
9 | dependencies {
10 | classpath 'com.android.tools.build:gradle:7.1.3'
11 |
12 | // NOTE: Do not place your application dependencies here; they belong
13 | // in the individual module build.gradle files
14 | }
15 | }
16 |
17 | allprojects {
18 | repositories {
19 | mavenCentral()
20 | google()
21 | flatDir {
22 | dirs 'libs'
23 | dirs project(':App').file('libs')
24 | }
25 | }
26 | }
27 |
28 | task clean(type: Delete) {
29 | delete rootProject.buildDir
30 | }
31 |
32 | ext {
33 | compileSdkVersion = 34
34 | buildToolsVersion = "29.0.3"
35 | minSdkVersion = 19
36 | targetSdkVersion = 26
37 | supportSdkVersion = "29.0.3"
38 | liteavSdk="com.tencent.liteav:LiteAVSDK_Live:latest.release"
39 | versionCode = 1
40 | versionName = "v1.0"
41 | ndkAbi = 'armeabi'//,'armeabi-v7a', 'arm64-v8a'
42 | aekit_version = '1.0.10-cloud'
43 | }
--------------------------------------------------------------------------------
/MLVB-API-Example/gradle.properties:
--------------------------------------------------------------------------------
1 | # Project-wide Gradle settings.
2 | # IDE (e.g. Android Studio) users:
3 | # Gradle settings configured through the IDE *will override*
4 | # any settings specified in this file.
5 | # For more details on how to configure your build environment visit
6 | # http://www.gradle.org/docs/current/userguide/build_environment.html
7 | # Specifies the JVM arguments used for the daemon process.
8 | # The setting is particularly useful for tweaking memory settings.
9 | org.gradle.jvmargs=-Xmx1536m
10 | # When configured, Gradle will run in incubating parallel mode.
11 | # This option should only be used with decoupled projects. More details, visit
12 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
13 | # org.gradle.parallel=true
14 | # AndroidX package structure to make it clearer which packages are bundled with the
15 | # Android operating system, and which are packaged with your app's APK
16 | # https://developer.android.com/topic/libraries/support-library/androidx-rn
17 | android.useAndroidX=true
18 | # Automatically convert third-party libraries to use AndroidX
19 | android.enableJetifier=true
20 |
21 | android.injected.testOnly=false
22 |
--------------------------------------------------------------------------------
/MLVB-API-Example/gradle/wrapper/gradle-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LiteAVSDK/Live_Android/47797c0f61a54ec0173630200cb7147bb2d9eb82/MLVB-API-Example/gradle/wrapper/gradle-wrapper.jar
--------------------------------------------------------------------------------
/MLVB-API-Example/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | #Fri Mar 13 20:47:26 CST 2020
2 | distributionBase=GRADLE_USER_HOME
3 | distributionPath=wrapper/dists
4 | zipStoreBase=GRADLE_USER_HOME
5 | zipStorePath=wrapper/dists
6 | distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-bin.zip
7 |
--------------------------------------------------------------------------------
/MLVB-API-Example/gradlew.bat:
--------------------------------------------------------------------------------
1 | @if "%DEBUG%" == "" @echo off
2 | @rem ##########################################################################
3 | @rem
4 | @rem Gradle startup script for Windows
5 | @rem
6 | @rem ##########################################################################
7 |
8 | @rem Set local scope for the variables with windows NT shell
9 | if "%OS%"=="Windows_NT" setlocal
10 |
11 | set DIRNAME=%~dp0
12 | if "%DIRNAME%" == "" set DIRNAME=.
13 | set APP_BASE_NAME=%~n0
14 | set APP_HOME=%DIRNAME%
15 |
16 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
17 | set DEFAULT_JVM_OPTS=
18 |
19 | @rem Find java.exe
20 | if defined JAVA_HOME goto findJavaFromJavaHome
21 |
22 | set JAVA_EXE=java.exe
23 | %JAVA_EXE% -version >NUL 2>&1
24 | if "%ERRORLEVEL%" == "0" goto init
25 |
26 | echo.
27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
28 | echo.
29 | echo Please set the JAVA_HOME variable in your environment to match the
30 | echo location of your Java installation.
31 |
32 | goto fail
33 |
34 | :findJavaFromJavaHome
35 | set JAVA_HOME=%JAVA_HOME:"=%
36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe
37 |
38 | if exist "%JAVA_EXE%" goto init
39 |
40 | echo.
41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
42 | echo.
43 | echo Please set the JAVA_HOME variable in your environment to match the
44 | echo location of your Java installation.
45 |
46 | goto fail
47 |
48 | :init
49 | @rem Get command-line arguments, handling Windows variants
50 |
51 | if not "%OS%" == "Windows_NT" goto win9xME_args
52 |
53 | :win9xME_args
54 | @rem Slurp the command line arguments.
55 | set CMD_LINE_ARGS=
56 | set _SKIP=2
57 |
58 | :win9xME_args_slurp
59 | if "x%~1" == "x" goto execute
60 |
61 | set CMD_LINE_ARGS=%*
62 |
63 | :execute
64 | @rem Setup the command line
65 |
66 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
67 |
68 | @rem Execute Gradle
69 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
70 |
71 | :end
72 | @rem End local scope for the variables with windows NT shell
73 | if "%ERRORLEVEL%"=="0" goto mainEnd
74 |
75 | :fail
76 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
77 | rem the _cmd.exe /c_ return code!
78 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
79 | exit /b 1
80 |
81 | :mainEnd
82 | if "%OS%"=="Windows_NT" endlocal
83 |
84 | :omega
85 |
--------------------------------------------------------------------------------
/MLVB-API-Example/settings.gradle:
--------------------------------------------------------------------------------
1 | include ':App'
2 | include ':Debug'
3 | include ':Common'
4 | include ':Basic:LivePushCamera'
5 | include ':Basic:LivePushScreen'
6 | include ':Basic:LivePlay'
7 | include ':Basic:LebPlay'
8 | include ':Basic:LiveLink'
9 | include ':Basic:LivePK'
10 | include ':Advanced:SwitchRenderView'
11 | include ':Advanced:CustomVideoCapture'
12 | include ':Advanced:ThirdBeauty'
13 | include ':Advanced:RTCPushAndPlay'
14 | include ':Advanced:LebAutoBitrate'
15 | include ':Advanced:HlsAutoBitrate'
16 | include ':Advanced:TimeShift'
17 | include ':Advanced:NewTimeShiftSprite'
18 | include ':Advanced:PictureInPicture'
19 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | ## 目录结构说明
2 |
3 | 本目录包含 Android 版 移动直播 SDK 的Demo 源代码,主要演示接口如何调用以及最基本的功能。
4 |
5 | ```
6 | ├─ MLVB-API-Example // MLVB API Example,包括直播推流,直播播放,互动直播
7 | | ├─ App // 程序入口界面
8 | | ├─ Basic // 演示 Live 基础功能示例代码
9 | | | ├─ LiveLink // 演示直播连麦示例代码
10 | | | ├─ LivePK // 演示直播 PK 示例代码
11 | | | ├─ LivePlay // 演示直播播放示例代码
12 | | | ├─ LivePushCamera // 演示摄像头推流示例代码
13 | | | ├─ LivePushScreen // 演示屏幕推流示例代码
14 | | ├─ Advanced // 演示直播高级功能示例代码
15 | | | ├─ CustomVideoCapture // 演示自定义视频采集示例代码
16 | | | ├─ RTCPushAndPlay // 演示 RTC 推流和播放示例代码
17 | | | ├─ SwitchRenderView // 演示切换渲染 View 示例代码
18 | | | ├─ ThirdBeauty // 演示第三方美颜示例代码
19 | |
20 | ├─ SDK
21 | │ ├─ LiteAVSDK_Smart_x.y.zzzz.aar // 如果您下载的是 Smart 版本 zip 包,解压后将出现此文件夹,其中 x.y.zzzz 表示 SDK 版本号
22 | | ├─ LiteAVSDK_Live_x.y.zzzz.aar // 如果您下载的是 Live 版本 zip 包,解压后将出现此文件夹,其中 x.y.zzzz 表示 SDK 版本号
23 | | ├─ LiteAVSDK_Professional_x.y.zzzz.aar // 如果您下载的是 Professional 版本 zip 包,解压后将出现此文件夹,其中 x.y.zzzz 表示 SDK 版本号
24 | ```
25 |
26 | ## SDK 分类和下载
27 |
28 | 腾讯云 移动直播 SDK 基于 LiteAVSDK 统一框架设计和实现,该框架包含直播、点播、短视频、RTC、AI美颜在内的多项功能:
29 |
30 | - 如果您追求最小化体积增量,可以下载 Smart 版:[TXLiteAVSDK_Smart_Android_latest.zip](https://cloud.tencent.com/document/product/454/7873)
31 | - 如果您还需要 连麦PK 的功能,可以下载 Live 版:[TXLiteAVSDK_Live_Android_latest.zip](https://cloud.tencent.com/document/product/454/7873)
32 | - 如果您需要使用多个功能而不希望打包多个 SDK,可以下载专业版:[TXLiteAVSDK_Professional_Android_latest.zip](https://cloud.tencent.com/document/product/454/7873)
33 |
34 | ## 相关文档链接
35 |
36 | - [SDK 的版本更新历史](https://cloud.tencent.com/document/product/454/7878)
37 | - [SDK 的 API 文档](https://cloud.tencent.com/document/product/454/34766)
38 | - [SDK 的官方体验 App](https://cloud.tencent.com/document/product/454/6555)
39 | - [全功能小直播 App(Demo)源代码](https://cloud.tencent.com/document/product/454/38625)
40 |
--------------------------------------------------------------------------------
/SDK/README-zh_CN.md:
--------------------------------------------------------------------------------
1 | # MLVB SDK (Android)
2 |
3 | _[English](README.md) | 简体中文_
4 | ## 下载地址
5 |
6 | [下载 Android MLVB SDK](https://liteav.sdk.qcloud.com/download/latest/TXLiteAVSDK_Smart_Android_latest.zip)
7 |
--------------------------------------------------------------------------------
/SDK/README.md:
--------------------------------------------------------------------------------
1 | # MLVB SDK (Android)
2 |
3 | [简体中文](README-zh_CN.md) | English
4 |
5 | ## Download URL
6 |
7 | [Download Android MLVB SDK](https://liteav.sdk.qcloud.com/download/latest/TXLiteAVSDK_Smart_Android_latest.zip)
8 |
--------------------------------------------------------------------------------