提交 7c0504e0 authored 作者: kongdywang's avatar kongdywang

fix android 14 broadcast new feature problem

上级 72894e85
......@@ -38,4 +38,5 @@ android {
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation rootProject.ext.liteavSdk
implementation rootProject.ext.compat
}
\ No newline at end of file
rootProject.ext {
compileSdkVersion = 31
compileSdkVersion = 33
buildToolsVersion = "28.0.3"
supportSdkVersion = "26.0.1"
minSdkVersion = 19
targetSdkVersion = 28
playerVersion = '11.8.0'
compat = "androidx.appcompat:appcompat:1.6.1"
/**
Set the dependent LiteAV SDK type:
......
......@@ -10,6 +10,7 @@ import android.content.IntentFilter;
import android.database.ContentObserver;
import android.media.AudioManager;
import android.net.Uri;
import android.os.Build;
import android.os.Bundle;
import android.os.Handler;
import android.os.Looper;
......@@ -23,6 +24,7 @@ import android.view.Window;
import android.view.WindowManager;
import androidx.annotation.NonNull;
import androidx.core.content.ContextCompat;
import com.tencent.rtmp.TXLiveBase;
import com.tencent.rtmp.TXLiveBaseListener;
......@@ -522,7 +524,8 @@ public class SuperPlayerPlugin implements FlutterPlugin, ActivityAware,
mVolumeBroadcastReceiver = new VolumeBroadcastReceiver();
IntentFilter filter = new IntentFilter();
filter.addAction(VOLUME_CHANGED_ACTION);
mActivityPluginBinding.getActivity().registerReceiver(mVolumeBroadcastReceiver, filter);
ContextCompat.registerReceiver(mActivityPluginBinding.getActivity(), mVolumeBroadcastReceiver, filter,
ContextCompat.RECEIVER_NOT_EXPORTED);
}
public void enableBrightnessObserver(boolean enable) {
......
......@@ -30,6 +30,7 @@ import android.view.View;
import android.widget.ProgressBar;
import androidx.annotation.NonNull;
import androidx.core.content.ContextCompat;
import com.tencent.rtmp.ITXLivePlayListener;
import com.tencent.rtmp.ITXVodPlayListener;
......@@ -237,7 +238,8 @@ public class FlutterPipImplActivity extends Activity implements Callback, ITXVod
private void registerPipBroadcast() {
if (!mIsRegisterReceiver) {
IntentFilter pipIntentFilter = new IntentFilter(FTXEvent.ACTION_PIP_PLAY_CONTROL);
registerReceiver(pipActionReceiver, pipIntentFilter);
ContextCompat.registerReceiver(this, pipActionReceiver, pipIntentFilter,
ContextCompat.RECEIVER_NOT_EXPORTED);
mIsRegisterReceiver = true;
}
}
......
......@@ -25,7 +25,7 @@ apply plugin: 'com.android.application'
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
android {
compileSdkVersion 31
compileSdkVersion 33
defaultConfig {
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论