提交 3dd282ba authored 作者: kongdywang's avatar kongdywang

1. Fix the transition animation when entering Picture-in-Picture mode on…

1. Fix the transition animation when entering Picture-in-Picture mode on Android. On some devices, there is a semi-transparent black statusBar at the top. 2. Reduce the descriptions in pubspec.yaml to avoid failures when Flutter publishes to pub. 3. Mark the controller parameter of TXPlayerVideo as deprecated. In the demo, all places where TXPlayerVideo is used no longer use the controller parameter to bind. This method is easily passively affected by the Flutter interface refresh, causing the texture of the Picture-in-Picture window to be repeatedly seized. On the demo side, use the onRenderViewCreatedListener callback method. It is recommended that customers actively bind the texture when needed. 4. For iOS live streaming Picture-in-Picture, use a custom rendering method to avoid the problem that the live streaming Picture-in-Picture has no picture when the app is in the background, because the renderView cannot be rendered in the background. 5. Fix the problem that after enabling the iOS live streaming Picture-in-Picture, the app interface cannot be clicked, and frequent clicks may occasionally cause a crash.
上级 e808d31c
...@@ -5,7 +5,7 @@ buildLog() { ...@@ -5,7 +5,7 @@ buildLog() {
} }
inputVersion=$1 inputVersion=$1
export VERSION_NAME="12.3.1" export VERSION_NAME="12.3.2"
if [ -n "$inputVersion" ]; then if [ -n "$inputVersion" ]; then
VERSION_NAME=$inputVersion VERSION_NAME=$inputVersion
fi fi
......
...@@ -4,7 +4,7 @@ rootProject.ext { ...@@ -4,7 +4,7 @@ rootProject.ext {
supportSdkVersion = "26.0.1" supportSdkVersion = "26.0.1"
minSdkVersion = 19 minSdkVersion = 19
targetSdkVersion = 28 targetSdkVersion = 28
playerVersion = '12.3.1' playerVersion = '12.3.2'
compat = "androidx.appcompat:appcompat:1.6.1" compat = "androidx.appcompat:appcompat:1.6.1"
/** /**
......
...@@ -22,6 +22,8 @@ import android.os.IBinder; ...@@ -22,6 +22,8 @@ import android.os.IBinder;
import android.text.TextUtils; import android.text.TextUtils;
import android.view.TextureView; import android.view.TextureView;
import android.view.View; import android.view.View;
import android.view.Window;
import android.view.WindowManager;
import android.widget.ProgressBar; import android.widget.ProgressBar;
import android.widget.RelativeLayout; import android.widget.RelativeLayout;
...@@ -144,6 +146,14 @@ public class FlutterPipImplActivity extends Activity implements ITXVodPlayListen ...@@ -144,6 +146,14 @@ public class FlutterPipImplActivity extends Activity implements ITXVodPlayListen
bindAndroid12BugServiceIfNeed(); bindAndroid12BugServiceIfNeed();
registerPipBroadcast(); registerPipBroadcast();
setContentView(R.layout.activity_flutter_pip_impl); setContentView(R.layout.activity_flutter_pip_impl);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
Window window = getWindow();
window.clearFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS);
window.addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS);
window.setStatusBarColor(Color.TRANSPARENT);
} else {
getWindow().addFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS);
}
mVideoRenderView = findViewById(R.id.tv_video_container); mVideoRenderView = findViewById(R.id.tv_video_container);
mVideoProgress = findViewById(R.id.pb_video_progress); mVideoProgress = findViewById(R.id.pb_video_progress);
mPipContainer = findViewById(R.id.rl_pip_container); mPipContainer = findViewById(R.id.rl_pip_container);
......
...@@ -156,7 +156,11 @@ class _DemoTXLivePlayerState extends State<DemoTXLivePlayer> with WidgetsBinding ...@@ -156,7 +156,11 @@ class _DemoTXLivePlayerState extends State<DemoTXLivePlayer> with WidgetsBinding
child: _aspectRatio > 0 child: _aspectRatio > 0
? AspectRatio( ? AspectRatio(
aspectRatio: _aspectRatio, aspectRatio: _aspectRatio,
child: TXPlayerVideo(controller: _controller), child: TXPlayerVideo(
onRenderViewCreatedListener: (viewId) {
_controller.setPlayerView(viewId);
},
),
) )
: Container(), : Container(),
), ),
......
...@@ -154,7 +154,12 @@ class _DemoTXVodPlayerState extends State<DemoTXVodPlayer> with WidgetsBindingOb ...@@ -154,7 +154,12 @@ class _DemoTXVodPlayerState extends State<DemoTXVodPlayer> with WidgetsBindingOb
child: _aspectRatio > 0 child: _aspectRatio > 0
? AspectRatio( ? AspectRatio(
aspectRatio: _aspectRatio, aspectRatio: _aspectRatio,
child: TXPlayerVideo(controller: _controller, androidRenderType: _renderType,), child: TXPlayerVideo(
androidRenderType: _renderType,
onRenderViewCreatedListener: (viewId) {
_controller.setPlayerView(viewId);
},
),
) )
: Container(), : Container(),
), ),
......
...@@ -108,6 +108,7 @@ static const int uninitialized = -1; ...@@ -108,6 +108,7 @@ static const int uninitialized = -1;
{ {
if (!onlyAudio) { if (!onlyAudio) {
if (nil != self.livePlayer) { if (nil != self.livePlayer) {
// 只有自定义渲染才能让直播画中画在后台输出画面
[self.livePlayer enableObserveVideoFrame:YES pixelFormat:V2TXLivePixelFormatBGRA32 bufferType:V2TXLiveBufferTypePixelBuffer]; [self.livePlayer enableObserveVideoFrame:YES pixelFormat:V2TXLivePixelFormatBGRA32 bufferType:V2TXLiveBufferTypePixelBuffer];
[self.livePlayer setProperty:@"enableBackgroundDecoding" value:@(YES)]; [self.livePlayer setProperty:@"enableBackgroundDecoding" value:@(YES)];
if (nil != self.curRenderView) { if (nil != self.curRenderView) {
...@@ -725,7 +726,9 @@ static const int uninitialized = -1; ...@@ -725,7 +726,9 @@ static const int uninitialized = -1;
* @note 需要您调用 {@link enableObserveVideoFrame} 开启回调开关。 * @note 需要您调用 {@link enableObserveVideoFrame} 开启回调开关。
*/ */
- (void)onRenderVideoFrame:(id<V2TXLivePlayer>)player frame:(V2TXLiveVideoFrame *)videoFrame { - (void)onRenderVideoFrame:(id<V2TXLivePlayer>)player frame:(V2TXLiveVideoFrame *)videoFrame {
if (self.isStartEnterPipMode) {
[[FTXPipController shareInstance] displayPixelBuffer:videoFrame.pixelBuffer];
}
} }
/** /**
......
...@@ -14,6 +14,7 @@ ...@@ -14,6 +14,7 @@
#import <stdatomic.h> #import <stdatomic.h>
#import "FTXImgTools.h" #import "FTXImgTools.h"
#import "FTXTextureView.h" #import "FTXTextureView.h"
#import "FTXPlayerConstants.h"
#import "FTXPiPKit/FTXPipConstants.h" #import "FTXPiPKit/FTXPipConstants.h"
static const int uninitialized = -1; static const int uninitialized = -1;
......
...@@ -23,6 +23,8 @@ ...@@ -23,6 +23,8 @@
- (void)exitPip; - (void)exitPip;
- (void)displayPixelBuffer:(CVPixelBufferRef)pixelBuffer;
@end @end
#endif // SUPERPLAYER_FLUTTER_IOS_CLASSES_LIVE_PIP_FTXPIPCONTROLLER_H_ #endif // SUPERPLAYER_FLUTTER_IOS_CLASSES_LIVE_PIP_FTXPIPCONTROLLER_H_
...@@ -23,6 +23,8 @@ ...@@ -23,6 +23,8 @@
- (void)exitPip; - (void)exitPip;
- (void)displayPixelBuffer:(CVPixelBufferRef)pixelBuffer;
@end @end
#endif // SUPERPLAYER_FLUTTER_IOS_CLASSES_LIVE_PIP_FTXPIPCONTROLLER_H_ #endif // SUPERPLAYER_FLUTTER_IOS_CLASSES_LIVE_PIP_FTXPIPCONTROLLER_H_
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
</data> </data>
<key>Headers/FTXPipController.h</key> <key>Headers/FTXPipController.h</key>
<data> <data>
FN+nbXxhSJb51gv6KUxdib+TzbU= n6NV0AaRgB3iFDbfETh9QJkSpcU=
</data> </data>
<key>Headers/FTXPipLiteAVSDKHeader.h</key> <key>Headers/FTXPipLiteAVSDKHeader.h</key>
<data> <data>
...@@ -76,11 +76,11 @@ ...@@ -76,11 +76,11 @@
<dict> <dict>
<key>hash</key> <key>hash</key>
<data> <data>
FN+nbXxhSJb51gv6KUxdib+TzbU= n6NV0AaRgB3iFDbfETh9QJkSpcU=
</data> </data>
<key>hash2</key> <key>hash2</key>
<data> <data>
LGT2ZKnzdZY6TP9VC6gpaeg53cmkGjxhF4psRx0h1YU= nxOR5EWJ2t7rEslnDfRkkPdeWLSDuwcL1xIYoWVbP30=
</data> </data>
</dict> </dict>
<key>Headers/FTXPipLiteAVSDKHeader.h</key> <key>Headers/FTXPipLiteAVSDKHeader.h</key>
......
...@@ -4,8 +4,8 @@ ...@@ -4,8 +4,8 @@
# #
Pod::Spec.new do |s| Pod::Spec.new do |s|
s.name = 'super_player' s.name = 'super_player'
s.version = '12.3.1' s.version = '12.3.2'
s.summary = 'player plugin.' 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 s.description = <<-DESC
player plugin. player plugin.
DESC DESC
...@@ -27,6 +27,7 @@ player plugin. ...@@ -27,6 +27,7 @@ player plugin.
# Professional SDK: s.dependency 'TXLiteAVSDK_Professional' # Professional SDK: s.dependency 'TXLiteAVSDK_Professional'
# If you want to specify the SDK version(eg 11.6.15041), use: s.dependency 'TXLiteAVSDK_Player','11.6.15041' # If you want to specify the SDK version(eg 11.6.15041), use: s.dependency 'TXLiteAVSDK_Player','11.6.15041'
s.dependency 'TXLiteAVSDK_Player','12.3.16995' s.dependency 'TXLiteAVSDK_Player','12.3.16995'
# s.dependency 'FTXPiPKit'
s.vendored_frameworks = [ s.vendored_frameworks = [
'localdep/FTXPiPKit.xcframework' 'localdep/FTXPiPKit.xcframework'
] ]
......
...@@ -2,5 +2,5 @@ ...@@ -2,5 +2,5 @@
part of SuperPlayer; part of SuperPlayer;
abstract class FPlayerPckInfo { abstract class FPlayerPckInfo {
static const String PLAYER_VERSION = "12.3.1"; static const String PLAYER_VERSION = "12.3.2";
} }
\ No newline at end of file
...@@ -4,11 +4,16 @@ part of SuperPlayer; ...@@ -4,11 +4,16 @@ part of SuperPlayer;
typedef FTXOnRenderViewCreatedListener = void Function(int viewId); typedef FTXOnRenderViewCreatedListener = void Function(int viewId);
class TXPlayerVideo extends StatefulWidget { class TXPlayerVideo extends StatefulWidget {
@Deprecated("recommended to use onRenderViewCreatedListener and controller.setPlayerView to bind the video surface.")
final TXPlayerController? controller; final TXPlayerController? controller;
final FTXAndroidRenderViewType renderViewType; final FTXAndroidRenderViewType renderViewType;
final FTXOnRenderViewCreatedListener? onRenderViewCreatedListener; final FTXOnRenderViewCreatedListener? onRenderViewCreatedListener;
TXPlayerVideo({this.controller, this.onRenderViewCreatedListener, TXPlayerVideo({
@Deprecated("recommended to use onRenderViewCreatedListener and controller.setPlayerView to bind the video surface.")
this.controller,
this.onRenderViewCreatedListener,
FTXAndroidRenderViewType? androidRenderType, Key? viewKey}) FTXAndroidRenderViewType? androidRenderType, Key? viewKey})
: renderViewType = androidRenderType ?? FTXAndroidRenderViewType.TEXTURE_VIEW, super(key: viewKey); : renderViewType = androidRenderType ?? FTXAndroidRenderViewType.TEXTURE_VIEW, super(key: viewKey);
......
name: super_player 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). Based on Tencent Cloud's powerful backend capabilities and AI technology, it provides a powerful playback carrier with video on demand and live streaming playback capabilities. Used in conjunction with Tencent Cloud Video on Demand or CSS, it allows quick experience of smooth and stable playback performance. It supports multiple scenarios such as Picture-in-Picture and short video lists, fully covering various application scenarios, meeting diverse customer needs, enabling customers to easily focus on business development itself, and enjoy a new experience of fast HD playback. 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.3.1 version: 12.3.2
homepage: https://github.com/LiteAVSDK/Player_Flutter homepage: https://github.com/LiteAVSDK/Player_Flutter
environment: environment:
......
name: superplayer_widget name: superplayer_widget
description: superplayer,base on vodplayer description: superplayer,base on vodplayer
version: 12.0.0 version: 12.3.2
environment: environment:
sdk: '>=2.17.0 <4.0.0' sdk: '>=2.17.0 <4.0.0'
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论