Skip to content

Commit 92d0fdf

Browse files
author
kongdywang
committed
1. update to 12.4.1
2. Remove the method of binding textures via the TXPlayerVideo's controller and add relevant explanatory comments
1 parent c329dd6 commit 92d0fdf

File tree

13 files changed

+66
-45
lines changed

13 files changed

+66
-45
lines changed

Flutter/CHANGELOG.md

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

2+
#### Version: 12.4.1 2025.04.02
3+
4+
##### Features:
5+
6+
- Remove the method of binding texture via the controller of TXPlayerVideo
7+
8+
29
#### Version: 12.4.0 2025.03.31
310

411
##### 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.4.0"
8+
export VERSION_NAME="12.4.1"
99
if [ -n "$inputVersion" ]; then
1010
VERSION_NAME=$inputVersion
1111
fi

Flutter/android/config.gradle

Lines changed: 1 addition & 1 deletion
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.4.0"
7+
playerVersion = "12.4.1"
88
compat = "androidx.appcompat:appcompat:1.6.1"
99

1010
/**

Flutter/example/lib/demo_txLiveplayer.dart

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,14 @@ class _DemoTXLivePlayerState extends State<DemoTXLivePlayer> with WidgetsBinding
158158
aspectRatio: _aspectRatio,
159159
child: TXPlayerVideo(
160160
onRenderViewCreatedListener: (viewId) {
161+
/// 此处只展示了最基础的纹理和播放器的配置方式。 这里可记录下来 viewId,在多纹理之间进行切换,比如横竖屏切换场景,竖屏的画面,
162+
/// 要切换到横屏的画面,可以在切换到横屏之后,拿到横屏的viewId 设置上去。回到竖屏的时候,再通过 viewId 切换回来。
163+
/// Only the most basic configuration methods for textures and the player are shown here.
164+
/// The `viewId` can be recorded here to switch between multiple textures. For example, in the scenario
165+
/// of switching between portrait and landscape orientations:
166+
/// To switch from the portrait view to the landscape view, obtain the `viewId` of the landscape view
167+
/// after switching to landscape orientation and set it. When switching back to portrait orientation,
168+
/// switch back using the recorded `viewId`.
161169
_controller.setPlayerView(viewId);
162170
},
163171
),

Flutter/example/lib/demo_txvodplayer.dart

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,14 @@ class _DemoTXVodPlayerState extends State<DemoTXVodPlayer> with WidgetsBindingOb
157157
child: TXPlayerVideo(
158158
androidRenderType: _renderType,
159159
onRenderViewCreatedListener: (viewId) {
160+
/// 此处只展示了最基础的纹理和播放器的配置方式。 这里可记录下来 viewId,在多纹理之间进行切换,比如横竖屏切换场景,竖屏的画面,
161+
/// 要切换到横屏的画面,可以在切换到横屏之后,拿到横屏的viewId 设置上去。回到竖屏的时候,再通过 viewId 切换回来。
162+
/// Only the most basic configuration methods for textures and the player are shown here.
163+
/// The `viewId` can be recorded here to switch between multiple textures. For example, in the scenario
164+
/// of switching between portrait and landscape orientations:
165+
/// To switch from the portrait view to the landscape view, obtain the `viewId` of the landscape view
166+
/// after switching to landscape orientation and set it. When switching back to portrait orientation,
167+
/// switch back using the recorded `viewId`.
160168
_controller.setPlayerView(viewId);
161169
},
162170
),

Flutter/example/lib/shortvideo/short_video_page_widget.dart

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,17 @@ class _TXVodPlayerPageState extends State<ShortVideoPageWidget> {
7474
child: Stack(
7575
children: [
7676
Container(
77-
child: TXPlayerVideo(controller: _controller),
77+
child: TXPlayerVideo(onRenderViewCreatedListener: (viewId) {
78+
/// 此处只展示了最基础的纹理和播放器的配置方式。 这里可记录下来 viewId,在多纹理之间进行切换,比如横竖屏切换场景,竖屏的画面,
79+
/// 要切换到横屏的画面,可以在切换到横屏之后,拿到横屏的viewId 设置上去。回到竖屏的时候,再通过 viewId 切换回来。
80+
/// Only the most basic configuration methods for textures and the player are shown here.
81+
/// The `viewId` can be recorded here to switch between multiple textures. For example, in the scenario
82+
/// of switching between portrait and landscape orientations:
83+
/// To switch from the portrait view to the landscape view, obtain the `viewId` of the landscape view
84+
/// after switching to landscape orientation and set it. When switching back to portrait orientation,
85+
/// switch back using the recorded `viewId`.
86+
_controller.setPlayerView(viewId);
87+
},),
7888
),
7989
_getPauseView()
8090
],

Flutter/ios/super_player.podspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
#
55
Pod::Spec.new do |s|
66
s.name = 'super_player'
7-
s.version = '12.4.0'
7+
s.version = '12.4.1'
88
s.summary = 'The super_player Flutter plugin is one of the sub-product SDKs of the audio/video terminal SDK (Tencent Cloud Video on Demand).'
99
s.description = <<-DESC
1010
player plugin.

Flutter/lib/Core/common/common_config.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
22
part of SuperPlayer;
33

44
abstract class FPlayerPckInfo {
5-
static const String PLAYER_VERSION = "12.4.0";
5+
static const String PLAYER_VERSION = "12.4.1";
66
}

Flutter/lib/Core/txplayer_widget.dart

Lines changed: 25 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,34 @@ typedef FTXOnRenderViewCreatedListener = void Function(int viewId);
55

66
class TXPlayerVideo extends StatefulWidget {
77

8-
@Deprecated("recommended to use onRenderViewCreatedListener and controller.setPlayerView to bind the video surface.")
9-
final TXPlayerController? controller;
108
final FTXAndroidRenderViewType renderViewType;
119
final FTXOnRenderViewCreatedListener? onRenderViewCreatedListener;
1210

11+
///
12+
/// 从 12.4.1 版本开始,移除传入 controller 的绑定纹理方式,该方式由于不可预见问题太多,所以移除。推荐使用 TXPlayerVideo
13+
/// 的 onRenderViewCreatedListener 回调,在获取到 viewId 后,使用 controller#setPlayerView 进行播放器和纹理的绑定
14+
///
15+
/// Starting from version 12.4.1, the method of binding textures by passing in a controller has been removed.
16+
/// This method is removed due to too many unforeseen issues. It is recommended to use the `onRenderViewCreatedListener`
17+
/// callback of `TXPlayerVideo`. After obtaining the `viewId`, use `controller#setPlayerView` to bind the player
18+
/// and texture.
19+
///
20+
/// e.g:
21+
/// TXPlayerVideo(
22+
/// onRenderViewCreatedListener: (viewId) {
23+
/// /// 此处只展示了最基础的纹理和播放器的配置方式。 这里可记录下来 viewId,在多纹理之间进行切换,比如横竖屏切换场景,竖屏的画面,
24+
/// /// 要切换到横屏的画面,可以在切换到横屏之后, 拿到横屏的viewId 设置上去。回到竖屏的时候,再通过 viewId 切换回来。
25+
/// /// Only the most basic configuration methods for textures and the player are shown here.
26+
/// /// The `viewId` can be recorded here to switch between multiple textures. For example, in the scenario
27+
/// /// of switching between portrait and landscape orientations:
28+
/// /// To switch from the portrait view to the landscape view, obtain the `viewId` of the landscape view
29+
/// /// after switching to landscape orientation and set it. When switching back to portrait orientation,
30+
/// /// switch back using the recorded `viewId`.
31+
/// _controller.setPlayerView(viewId);
32+
/// },
33+
/// )
34+
///
1335
TXPlayerVideo({
14-
@Deprecated("recommended to use onRenderViewCreatedListener and controller.setPlayerView to bind the video surface.")
15-
this.controller,
1636
this.onRenderViewCreatedListener,
1737
FTXAndroidRenderViewType? androidRenderType, Key? viewKey})
1838
: renderViewType = androidRenderType ?? FTXAndroidRenderViewType.TEXTURE_VIEW, super(key: viewKey);
@@ -31,39 +51,18 @@ class TXPlayerVideoState extends State<TXPlayerVideo> {
3151
@override
3252
void initState() {
3353
super.initState();
34-
if (_viewIdCompleter.isCompleted) {
35-
_setPlayerView(_viewId);
36-
}
3754
}
3855

3956
@override
4057
void didUpdateWidget(covariant TXPlayerVideo oldWidget) {
4158
super.didUpdateWidget(oldWidget);
42-
if (oldWidget.controller != widget.controller) {
43-
if (_viewIdCompleter.isCompleted) {
44-
setState(() {
45-
_setPlayerView(_viewId);
46-
});
47-
} else {
48-
_waitViewId();
49-
}
50-
} else if (oldWidget.renderViewType != widget.renderViewType) {
59+
if (oldWidget.renderViewType != widget.renderViewType) {
5160
setState(() {
5261
_platformViewKey = UniqueKey();
5362
});
5463
}
55-
else {
56-
LogUtils.i(TAG, "met a unchanged widget refresh");
57-
_waitViewId();
58-
}
5964
}
6065

61-
Future<void> _waitViewId() async {
62-
await _viewIdCompleter.future;
63-
setState(() {
64-
_setPlayerView(_viewId);
65-
});
66-
}
6766

6867
@override
6968
Widget build(BuildContext context) {
@@ -105,7 +104,6 @@ class TXPlayerVideoState extends State<TXPlayerVideo> {
105104
_viewId = params.id;
106105
_viewIdCompleter.complete(params.id);
107106
widget.onRenderViewCreatedListener?.call(params.id);
108-
_setPlayerView(params.id);
109107
if (widget.renderViewType == FTXAndroidRenderViewType.DRM_SURFACE_VIEW) {
110108
return PlatformViewsService.initSurfaceAndroidView(
111109
id: params.id,
@@ -135,29 +133,20 @@ class TXPlayerVideoState extends State<TXPlayerVideo> {
135133
}
136134
}
137135

138-
Future<void> _setPlayerView(int viewId) async {
139-
await widget.controller?.setPlayerView(viewId);
140-
}
141-
142136
void _onCreateIOSView(int id) {
143137
if (_viewIdCompleter.isCompleted) {
144138
_viewIdCompleter = Completer();
145139
}
146140
_viewId = id;
147141
_viewIdCompleter.complete(id);
148142
widget.onRenderViewCreatedListener?.call(id);
149-
_setPlayerView(id);
150143
}
151144

152145
Future<int> getViewId() async {
153146
await _viewIdCompleter.future;
154147
return _viewId;
155148
}
156149

157-
void resetController() {
158-
_waitViewId();
159-
}
160-
161150
@override
162151
void dispose() {
163152
super.dispose();

Flutter/pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: super_player
22
description: The super_player Flutter plugin is one of the sub-product SDKs of the audio/video terminal SDK (Tencent Cloud Video on Demand).
3-
version: 12.4.0
3+
version: 12.4.1
44
homepage: https://github.com/LiteAVSDK/Player_Flutter
55

66
environment:

0 commit comments

Comments
 (0)