Skip to content

Commit 14de057

Browse files
author
kongdywang
committed
1. After the player UI component enters full-screen mode, to avoid compatibility issues, it no longer forcibly breaks layout restrictions to fill the screen. Now, the business side needs to manually hide unnecessary components and remove height limitations on the player.
2. Fixed an issue where the video did not display in certain live streaming scenarios. 3. Removed the cross-version problematic `LinkedListEntry` from the player UI component to avoid cross-version compatibility issues. 4. Added the `setDrmProvisionEnv` interface in `SuperPlayerPlugin` for configuring the DRM certificate environment. 5. Upgraded to version 12.5.1. 6. Fixed an issue where Android video-on-demand using `SurfaceView` would not display video when switching between foreground and background. 7. Fixed a license configuration error when launching the demo app.
1 parent d04ded8 commit 14de057

38 files changed

+425
-71
lines changed

Flutter/CHANGELOG.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,14 @@
11

2+
#### Version: 12.5.1 2025.05.29
3+
4+
##### Features:
5+
6+
- set Android TXLiteAVSDK_Player to 12.5.0.17576,tag:release_player_v12.5.1
7+
- set iOS TXLiteAVSDK_Player to 12.5.18393, tag:release_player_v12.5.1
8+
- The `SuperPlayerPlugin` has added the `setDrmProvisionEnv` method for switching the DRM playback environment.
9+
- Fixed an issue where the video screen could not be restored when returning to the foreground from the background while using SurfaceView on the Android side.
10+
- Fix the issue where the UI component's fullscreen operation behaves unexpectedly on some older Android devices.
11+
212
#### Version: 12.5.0 2025.05.08
313

414
##### Features:

Flutter/CI/buildVersionOnMac.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ buildLog() {
55
}
66

77
inputVersion=$1
8-
export VERSION_NAME="12.5.0"
8+
export VERSION_NAME="12.5.1"
99
if [ -n "$inputVersion" ]; then
1010
VERSION_NAME=$inputVersion
1111
fi

Flutter/android/build.gradle

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,9 @@ android {
1717
namespace="com.tencent.vod.flutter"
1818

1919
defaultConfig {
20+
buildConfigField("String", "FLUTTER_PLAYER_VERSION", "\"${rootProject.ext.playerVersion}\"")
2021
minSdkVersion rootProject.ext.minSdkVersion
2122
}
22-
23-
compileOptions {
24-
sourceCompatibility JavaVersion.VERSION_1_8
25-
targetCompatibility JavaVersion.VERSION_1_8
26-
}
2723
}
2824

2925

Flutter/android/config.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ rootProject.ext {
44
supportSdkVersion = "26.0.1"
55
minSdkVersion = 19
66
targetSdkVersion = 28
7-
playerVersion = "12.5.0"
7+
playerVersion = "12.5.1"
88
compat = "androidx.appcompat:appcompat:1.6.1"
99

1010
/**
@@ -14,5 +14,5 @@ rootProject.ext {
1414
Professional SDK: liteavSdk="com.tencent.liteav:LiteAVSDK_Professional:latest.release"
1515
If you want to specify the SDK version(eg 11.7.0.13946), use: liteavSdk="com.tencent.liteav:LiteAVSDK_Player:11.7.0.13946"
1616
*/
17-
liteavSdk="com.tencent.liteav:LiteAVSDK_Player:12.5.0.17567"
17+
liteavSdk="com.tencent.liteav:LiteAVSDK_Player:12.5.0.17576"
1818
}

Flutter/android/src/main/java/com/tencent/vod/flutter/SuperPlayerPlugin.java

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
import com.tencent.rtmp.TXLiveBase;
3131
import com.tencent.rtmp.TXLiveBaseListener;
3232
import com.tencent.rtmp.TXPlayerGlobalSetting;
33+
import com.tencent.vod.flutter.common.FTXPlayerConstants;
3334
import com.tencent.vod.flutter.messages.FtxMessages;
3435
import com.tencent.vod.flutter.messages.FtxMessages.BoolMsg;
3536
import com.tencent.vod.flutter.messages.FtxMessages.DoubleMsg;
@@ -184,6 +185,7 @@ public void onAttachedToEngine(@NonNull FlutterPluginBinding flutterPluginBindin
184185
flutterPluginBinding
185186
.getPlatformViewRegistry()
186187
.registerViewFactory(FTXEvent.FTX_RENDER_VIEW, mRenderViewFactory);
188+
LiteavLog.i(TAG, "plugin version is:" + BuildConfig.FLUTTER_PLAYER_VERSION);
187189
TXFlutterSuperPlayerPluginAPI.setUp(flutterPluginBinding.getBinaryMessenger(), this);
188190
TXFlutterNativeAPI.setUp(flutterPluginBinding.getBinaryMessenger(), this);
189191
mPluginApi = new FtxMessages.TXPluginFlutterAPI(flutterPluginBinding.getBinaryMessenger());
@@ -340,6 +342,15 @@ public void setLicenseFlexibleValid(@NonNull BoolMsg msg) {
340342
}
341343
}
342344

345+
@Override
346+
public void setDrmProvisionEnv(@NonNull Long env) {
347+
if (env == FTXPlayerConstants.FTXDrmProvisionEnvInt.DRM_PROVISION_ENV_CN) {
348+
TXPlayerGlobalSetting.setDrmProvisionEnv(TXPlayerGlobalSetting.DrmProvisionEnv.DRM_PROVISION_ENV_CN);
349+
} else {
350+
TXPlayerGlobalSetting.setDrmProvisionEnv(TXPlayerGlobalSetting.DrmProvisionEnv.DRM_PROVISION_ENV_COM);
351+
}
352+
}
353+
343354
/******* native method call end *******/
344355

345356

Flutter/android/src/main/java/com/tencent/vod/flutter/common/FTXPlayerConstants.java

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ public interface FTXRenderMode {
66

77
/**
88
* 根据视频比例,完整展示出视频画面
9-
* Display the video content fully according to the video aspect ratio.
9+
* Display the video content fully according to the video aspect ratio.
1010
*/
1111
long ADJUST_RESOLUTION = 0;
1212

@@ -23,4 +23,11 @@ public interface FTXRenderMode {
2323
long SCALE_FULL_FILL_CONTAINER = 2;
2424
}
2525

26+
public interface FTXDrmProvisionEnvInt {
27+
28+
long DRM_PROVISION_ENV_COM = 0;
29+
30+
long DRM_PROVISION_ENV_CN = 1;
31+
}
32+
2633
}

Flutter/android/src/main/java/com/tencent/vod/flutter/messages/FtxMessages.java

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3989,6 +3989,8 @@ public interface TXFlutterSuperPlayerPluginAPI {
39893989

39903990
void setLicenseFlexibleValid(@NonNull BoolMsg msg);
39913991

3992+
void setDrmProvisionEnv(@NonNull Long env);
3993+
39923994
/** The codec used by TXFlutterSuperPlayerPluginAPI. */
39933995
static @NonNull MessageCodec<Object> getCodec() {
39943996
return PigeonCodec.INSTANCE;
@@ -4329,6 +4331,29 @@ static void setUp(@NonNull BinaryMessenger binaryMessenger, @NonNull String mess
43294331
api.setLicenseFlexibleValid(msgArg);
43304332
wrapped.add(0, null);
43314333
}
4334+
catch (Throwable exception) {
4335+
wrapped = wrapError(exception);
4336+
}
4337+
reply.reply(wrapped);
4338+
});
4339+
} else {
4340+
channel.setMessageHandler(null);
4341+
}
4342+
}
4343+
{
4344+
BasicMessageChannel<Object> channel =
4345+
new BasicMessageChannel<>(
4346+
binaryMessenger, "dev.flutter.pigeon.super_player.TXFlutterSuperPlayerPluginAPI.setDrmProvisionEnv" + messageChannelSuffix, getCodec());
4347+
if (api != null) {
4348+
channel.setMessageHandler(
4349+
(message, reply) -> {
4350+
ArrayList<Object> wrapped = new ArrayList<>();
4351+
ArrayList<Object> args = (ArrayList<Object>) message;
4352+
Long envArg = (Long) args.get(0);
4353+
try {
4354+
api.setDrmProvisionEnv(envArg);
4355+
wrapped.add(0, null);
4356+
}
43324357
catch (Throwable exception) {
43334358
wrapped = wrapError(exception);
43344359
}

Flutter/android/src/main/java/com/tencent/vod/flutter/player/FTXLivePlayer.java

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,6 @@ public class FTXLivePlayer extends FTXLivePlayerRenderHost implements TXFlutterL
6565
private boolean mIsPaused = false;
6666
private final FtxMessages.TXLivePlayerFlutterAPI mLiveFlutterApi;
6767
private final FTXRenderViewFactory mRenderViewFactory;
68-
private FTXRenderView mCurRenderView;
6968
private final Handler mUIHandler = new Handler(Looper.getMainLooper());
7069
private boolean mIsMute = false;
7170
private int mCurrentVideoWidth = 0;
@@ -464,14 +463,11 @@ public Long enablePictureInPicture(@NonNull BoolPlayerMsg msg) {
464463
public void setPlayerView(@NonNull Long renderViewId) {
465464
int viewId = renderViewId.intValue();
466465
FTXRenderView renderView = mRenderViewFactory.findViewById(viewId);
467-
if (null != renderView) {
468-
mCurRenderView = renderView;
469-
renderView.setPlayer(this);
470-
} else {
471-
LiteavLog.e(TAG, "setPlayerView can not find renderView by id:" + viewId + ", release player's renderView");
472-
mCurRenderView = null;
473-
setRenderView(null);
466+
if (null == renderView) {
467+
LiteavLog.e(TAG, "setPlayerView can not find renderView by id:"
468+
+ viewId + ", release player's renderView");
474469
}
470+
setUpPlayerView(renderView);
475471
}
476472

477473
@Override

Flutter/android/src/main/java/com/tencent/vod/flutter/player/FTXVodPlayer.java

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@
4545
import com.tencent.vod.flutter.model.TXPipResult;
4646
import com.tencent.vod.flutter.model.TXPlayerHolder;
4747
import com.tencent.vod.flutter.player.render.FTXVodPlayerRenderHost;
48+
import com.tencent.vod.flutter.tools.FTXVersionAdapter;
4849
import com.tencent.vod.flutter.tools.TXCommonUtil;
4950
import com.tencent.vod.flutter.tools.TXFlutterEngineHolder;
5051
import com.tencent.vod.flutter.ui.render.FTXRenderView;
@@ -249,9 +250,8 @@ protected long init(boolean onlyAudio) {
249250
mVodPlayer.setRenderMode(TXLiveConstants.RENDER_MODE_ADJUST_RESOLUTION);
250251
// prevent config null exception
251252
TXVodPlayConfig playConfig = new TXVodPlayConfig();
252-
Map<String, Object> map = new HashMap<>();
253-
map.put("450", 0);
254-
playConfig.setExtInfo(map);
253+
FTXVersionAdapter.enableCustomSubtitle(playConfig, 0);
254+
FTXVersionAdapter.enableDrmLevel3(playConfig, true);
255255
mVodPlayer.setConfig(playConfig);
256256
mVodPlayer.setVodSubtitleDataListener(new ITXVodPlayListener.ITXVodSubtitleDataListener() {
257257
@Override
@@ -406,13 +406,8 @@ void setPlayerRate(float rate) {
406406
void setPlayConfig(FTXVodPlayConfigPlayerMsg config) {
407407
if (mVodPlayer != null) {
408408
TXVodPlayConfig playConfig = FTXTransformation.transformToVodConfig(config);
409-
Map<String, Object> map = new HashMap<>();
410-
Map<String, Object> extInfoMap = playConfig.getExtInfoMap();
411-
if (extInfoMap != null && !extInfoMap.isEmpty()) {
412-
map.putAll(extInfoMap);
413-
}
414-
map.put("450", 0);
415-
playConfig.setExtInfo(map);
409+
FTXVersionAdapter.enableCustomSubtitle(playConfig, 0);
410+
FTXVersionAdapter.enableDrmLevel3(playConfig, true);
416411
mVodPlayer.setConfig(playConfig);
417412
}
418413
}

Flutter/android/src/main/java/com/tencent/vod/flutter/player/render/FTXLivePlayerRenderHost.java

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,16 @@
88
import com.tencent.liteav.base.util.LiteavLog;
99
import com.tencent.live2.V2TXLivePlayer;
1010
import com.tencent.vod.flutter.player.FTXBasePlayer;
11+
import com.tencent.vod.flutter.ui.render.CarrierViewObserver;
1112
import com.tencent.vod.flutter.ui.render.FTXRenderCarrier;
1213
import com.tencent.vod.flutter.ui.render.FTXRenderView;
1314

14-
public abstract class FTXLivePlayerRenderHost extends FTXBasePlayer implements FTXPlayerRenderHost {
15+
public abstract class FTXLivePlayerRenderHost extends FTXBasePlayer implements FTXPlayerRenderHost,
16+
CarrierViewObserver {
1517

1618
private static final String TAG = "FTXLivePlayerRenderHost";
1719
protected FTXRenderView mCurRenderView;
20+
private boolean isTargetDetached = false;
1821

1922
@Override
2023
public void setUpPlayerView(FTXRenderView renderView) {
@@ -32,10 +35,12 @@ public void setUpPlayerView(FTXRenderView renderView) {
3235
@Override
3336
public void setRenderView(FTXRenderCarrier textureView) {
3437
final V2TXLivePlayer livePlayer = getLivePlayer();
38+
isTargetDetached = false;
3539
if (null != textureView) {
3640
LiteavLog.i(TAG, "start bind Player:" + textureView + ", player:" + hashCode());
3741
if (textureView instanceof TextureView) {
3842
livePlayer.setRenderView((TextureView) textureView);
43+
textureView.addViewObserver(this);
3944
} else if (textureView instanceof SurfaceView) {
4045
livePlayer.setRenderView((SurfaceView) textureView);
4146
} else {
@@ -45,6 +50,21 @@ public void setRenderView(FTXRenderCarrier textureView) {
4550
LiteavLog.i(TAG, "setRenderView met a null textureView, player:" + hashCode());
4651
livePlayer.setRenderView((TextureView) null);
4752
livePlayer.setRenderView((SurfaceView) null);
53+
if (null != mCurRenderView && mCurRenderView.getRenderView() != null) {
54+
mCurRenderView.getRenderView().removeViewObserver(this);
55+
}
56+
}
57+
}
58+
59+
@Override
60+
public void onDetachWindow(FTXRenderCarrier carrier) {
61+
isTargetDetached = true;
62+
}
63+
64+
@Override
65+
public void onAttachWindow(FTXRenderCarrier carrier) {
66+
if (isTargetDetached && null != mCurRenderView) {
67+
setUpPlayerView(mCurRenderView);
4868
}
4969
}
5070

0 commit comments

Comments
 (0)