提交 92d0fdf2 authored 作者: kongdywang's avatar kongdywang

1. update to 12.4.1

2. Remove the method of binding textures via the TXPlayerVideo's controller and add relevant explanatory comments
上级 c329dd6f
#### Version: 12.4.1 2025.04.02
##### Features:
- Remove the method of binding texture via the controller of TXPlayerVideo
#### Version: 12.4.0 2025.03.31
##### Features:
......
......@@ -5,7 +5,7 @@ buildLog() {
}
inputVersion=$1
export VERSION_NAME="12.4.0"
export VERSION_NAME="12.4.1"
if [ -n "$inputVersion" ]; then
VERSION_NAME=$inputVersion
fi
......
......@@ -4,7 +4,7 @@ rootProject.ext {
supportSdkVersion = "26.0.1"
minSdkVersion = 19
targetSdkVersion = 28
playerVersion = "12.4.0"
playerVersion = "12.4.1"
compat = "androidx.appcompat:appcompat:1.6.1"
/**
......
......@@ -158,6 +158,14 @@ class _DemoTXLivePlayerState extends State<DemoTXLivePlayer> with WidgetsBinding
aspectRatio: _aspectRatio,
child: TXPlayerVideo(
onRenderViewCreatedListener: (viewId) {
/// 此处只展示了最基础的纹理和播放器的配置方式。 这里可记录下来 viewId,在多纹理之间进行切换,比如横竖屏切换场景,竖屏的画面,
/// 要切换到横屏的画面,可以在切换到横屏之后,拿到横屏的viewId 设置上去。回到竖屏的时候,再通过 viewId 切换回来。
/// Only the most basic configuration methods for textures and the player are shown here.
/// The `viewId` can be recorded here to switch between multiple textures. For example, in the scenario
/// of switching between portrait and landscape orientations:
/// To switch from the portrait view to the landscape view, obtain the `viewId` of the landscape view
/// after switching to landscape orientation and set it. When switching back to portrait orientation,
/// switch back using the recorded `viewId`.
_controller.setPlayerView(viewId);
},
),
......
......@@ -157,6 +157,14 @@ class _DemoTXVodPlayerState extends State<DemoTXVodPlayer> with WidgetsBindingOb
child: TXPlayerVideo(
androidRenderType: _renderType,
onRenderViewCreatedListener: (viewId) {
/// 此处只展示了最基础的纹理和播放器的配置方式。 这里可记录下来 viewId,在多纹理之间进行切换,比如横竖屏切换场景,竖屏的画面,
/// 要切换到横屏的画面,可以在切换到横屏之后,拿到横屏的viewId 设置上去。回到竖屏的时候,再通过 viewId 切换回来。
/// Only the most basic configuration methods for textures and the player are shown here.
/// The `viewId` can be recorded here to switch between multiple textures. For example, in the scenario
/// of switching between portrait and landscape orientations:
/// To switch from the portrait view to the landscape view, obtain the `viewId` of the landscape view
/// after switching to landscape orientation and set it. When switching back to portrait orientation,
/// switch back using the recorded `viewId`.
_controller.setPlayerView(viewId);
},
),
......
......@@ -74,7 +74,17 @@ class _TXVodPlayerPageState extends State<ShortVideoPageWidget> {
child: Stack(
children: [
Container(
child: TXPlayerVideo(controller: _controller),
child: TXPlayerVideo(onRenderViewCreatedListener: (viewId) {
/// 此处只展示了最基础的纹理和播放器的配置方式。 这里可记录下来 viewId,在多纹理之间进行切换,比如横竖屏切换场景,竖屏的画面,
/// 要切换到横屏的画面,可以在切换到横屏之后,拿到横屏的viewId 设置上去。回到竖屏的时候,再通过 viewId 切换回来。
/// Only the most basic configuration methods for textures and the player are shown here.
/// The `viewId` can be recorded here to switch between multiple textures. For example, in the scenario
/// of switching between portrait and landscape orientations:
/// To switch from the portrait view to the landscape view, obtain the `viewId` of the landscape view
/// after switching to landscape orientation and set it. When switching back to portrait orientation,
/// switch back using the recorded `viewId`.
_controller.setPlayerView(viewId);
},),
),
_getPauseView()
],
......
......@@ -4,7 +4,7 @@
#
Pod::Spec.new do |s|
s.name = 'super_player'
s.version = '12.4.0'
s.version = '12.4.1'
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).'
s.description = <<-DESC
player plugin.
......
......@@ -2,5 +2,5 @@
part of SuperPlayer;
abstract class FPlayerPckInfo {
static const String PLAYER_VERSION = "12.4.0";
static const String PLAYER_VERSION = "12.4.1";
}
\ No newline at end of file
......@@ -5,14 +5,34 @@ typedef FTXOnRenderViewCreatedListener = void Function(int viewId);
class TXPlayerVideo extends StatefulWidget {
@Deprecated("recommended to use onRenderViewCreatedListener and controller.setPlayerView to bind the video surface.")
final TXPlayerController? controller;
final FTXAndroidRenderViewType renderViewType;
final FTXOnRenderViewCreatedListener? onRenderViewCreatedListener;
///
/// 从 12.4.1 版本开始,移除传入 controller 的绑定纹理方式,该方式由于不可预见问题太多,所以移除。推荐使用 TXPlayerVideo
/// 的 onRenderViewCreatedListener 回调,在获取到 viewId 后,使用 controller#setPlayerView 进行播放器和纹理的绑定
///
/// Starting from version 12.4.1, the method of binding textures by passing in a controller has been removed.
/// This method is removed due to too many unforeseen issues. It is recommended to use the `onRenderViewCreatedListener`
/// callback of `TXPlayerVideo`. After obtaining the `viewId`, use `controller#setPlayerView` to bind the player
/// and texture.
///
/// e.g:
/// TXPlayerVideo(
/// onRenderViewCreatedListener: (viewId) {
/// /// 此处只展示了最基础的纹理和播放器的配置方式。 这里可记录下来 viewId,在多纹理之间进行切换,比如横竖屏切换场景,竖屏的画面,
/// /// 要切换到横屏的画面,可以在切换到横屏之后, 拿到横屏的viewId 设置上去。回到竖屏的时候,再通过 viewId 切换回来。
/// /// Only the most basic configuration methods for textures and the player are shown here.
/// /// The `viewId` can be recorded here to switch between multiple textures. For example, in the scenario
/// /// of switching between portrait and landscape orientations:
/// /// To switch from the portrait view to the landscape view, obtain the `viewId` of the landscape view
/// /// after switching to landscape orientation and set it. When switching back to portrait orientation,
/// /// switch back using the recorded `viewId`.
/// _controller.setPlayerView(viewId);
/// },
/// )
///
TXPlayerVideo({
@Deprecated("recommended to use onRenderViewCreatedListener and controller.setPlayerView to bind the video surface.")
this.controller,
this.onRenderViewCreatedListener,
FTXAndroidRenderViewType? androidRenderType, Key? viewKey})
: renderViewType = androidRenderType ?? FTXAndroidRenderViewType.TEXTURE_VIEW, super(key: viewKey);
......@@ -31,39 +51,18 @@ class TXPlayerVideoState extends State<TXPlayerVideo> {
@override
void initState() {
super.initState();
if (_viewIdCompleter.isCompleted) {
_setPlayerView(_viewId);
}
}
@override
void didUpdateWidget(covariant TXPlayerVideo oldWidget) {
super.didUpdateWidget(oldWidget);
if (oldWidget.controller != widget.controller) {
if (_viewIdCompleter.isCompleted) {
setState(() {
_setPlayerView(_viewId);
});
} else {
_waitViewId();
}
} else if (oldWidget.renderViewType != widget.renderViewType) {
if (oldWidget.renderViewType != widget.renderViewType) {
setState(() {
_platformViewKey = UniqueKey();
});
}
else {
LogUtils.i(TAG, "met a unchanged widget refresh");
_waitViewId();
}
}
Future<void> _waitViewId() async {
await _viewIdCompleter.future;
setState(() {
_setPlayerView(_viewId);
});
}
@override
Widget build(BuildContext context) {
......@@ -105,7 +104,6 @@ class TXPlayerVideoState extends State<TXPlayerVideo> {
_viewId = params.id;
_viewIdCompleter.complete(params.id);
widget.onRenderViewCreatedListener?.call(params.id);
_setPlayerView(params.id);
if (widget.renderViewType == FTXAndroidRenderViewType.DRM_SURFACE_VIEW) {
return PlatformViewsService.initSurfaceAndroidView(
id: params.id,
......@@ -135,10 +133,6 @@ class TXPlayerVideoState extends State<TXPlayerVideo> {
}
}
Future<void> _setPlayerView(int viewId) async {
await widget.controller?.setPlayerView(viewId);
}
void _onCreateIOSView(int id) {
if (_viewIdCompleter.isCompleted) {
_viewIdCompleter = Completer();
......@@ -146,7 +140,6 @@ class TXPlayerVideoState extends State<TXPlayerVideo> {
_viewId = id;
_viewIdCompleter.complete(id);
widget.onRenderViewCreatedListener?.call(id);
_setPlayerView(id);
}
Future<int> getViewId() async {
......@@ -154,10 +147,6 @@ class TXPlayerVideoState extends State<TXPlayerVideo> {
return _viewId;
}
void resetController() {
_waitViewId();
}
@override
void dispose() {
super.dispose();
......
name: super_player
description: The super_player Flutter plugin is one of the sub-product SDKs of the audio/video terminal SDK (Tencent Cloud Video on Demand).
version: 12.4.0
version: 12.4.1
homepage: https://github.com/LiteAVSDK/Player_Flutter
environment:
......
......@@ -3,5 +3,5 @@ part of demo_super_player_lib;
class PlayerConstants {
static const PKG_NAME = "superplayer_widget";
static const String PLAYER_WIDGET_VERSION = "12.4.0";
static const String PLAYER_WIDGET_VERSION = "12.4.1";
}
......@@ -375,7 +375,6 @@ class SuperPlayerViewState extends State<SuperPlayerView> with WidgetsBindingObs
_videoBottomKey.currentState?.updateUIStatus(SuperPlayerUIStatus.WINDOW_MODE);
_videoTitleKey.currentState?.updateUIStatus(SuperPlayerUIStatus.WINDOW_MODE);
hideControlView();
_videoKey.currentState?.resetController();
}
void _refreshDownloadStatus() async {
......
name: superplayer_widget
description: superplayer,base on vodplayer
version: 12.4.0
version: 12.4.1
environment:
sdk: '>=2.17.0 <4.0.0'
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论