提交 9fff94cf authored 作者: kongdywang's avatar kongdywang

fix android 14 broadcast new feature problem

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