Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
T
tx_player_fork
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
蒋俊
tx_player_fork
Commits
d881f7d8
提交
d881f7d8
authored
1月 25, 2024
作者:
kongdywang
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
1. fix player widget isn't throw event when switch video and release
2. player widget add stopPlay method 3. vod/live controller's method which named dispose can await now
上级
59567c0d
隐藏空白字符变更
内嵌
并排
正在显示
6 个修改的文件
包含
25 行增加
和
18 行删除
+25
-18
demo_superplayer.dart
Flutter/example/lib/demo_superplayer.dart
+7
-3
txliveplayer_controller.dart
Flutter/lib/Core/txliveplayer_controller.dart
+1
-1
txplayer_controller.dart
Flutter/lib/Core/txplayer_controller.dart
+2
-1
txvodplayer_controller.dart
Flutter/lib/Core/txvodplayer_controller.dart
+1
-1
superplayer_controller.dart
Flutter/superplayer_widget/lib/superplayer_controller.dart
+10
-10
superplayer_widget.dart
Flutter/superplayer_widget/lib/ui/superplayer_widget.dart
+4
-2
没有找到文件。
Flutter/example/lib/demo_superplayer.dart
浏览文件 @
d881f7d8
...
...
@@ -416,14 +416,18 @@ class _DemoSuperPlayerState extends State<DemoSuperPlayer> with TXPipPlayerResto
@override
void
dispose
()
{
_releasePlayerSource
();
super
.
dispose
();
}
Future
<
void
>
_releasePlayerSource
()
async
{
// must invoke when page exit.
_controller
.
releasePlayer
();
simpleEventSubscription
?.
cancel
();
await
_controller
.
releasePlayer
();
// restore current brightness to sys brightness
SuperPlayerPlugin
.
restorePageBrightness
();
// unregister brightness observer
SuperPlayerPlugin
.
registerSysBrightness
(
false
);
s
uper
.
dispose
();
s
impleEventSubscription
?.
cancel
();
}
@override
...
...
Flutter/lib/Core/txliveplayer_controller.dart
浏览文件 @
d881f7d8
...
...
@@ -365,7 +365,7 @@ class TXLivePlayerController extends ChangeNotifier implements ValueListenable<T
///
/// 释放controller
@override
void
dispose
()
async
{
Future
<
void
>
dispose
()
async
{
_isNeedDisposed
=
true
;
if
(!
_isDisposed
)
{
await
_eventSubscription
!.
cancel
();
...
...
Flutter/lib/Core/txplayer_controller.dart
浏览文件 @
d881f7d8
...
...
@@ -21,5 +21,5 @@ abstract class TXPlayerController {
Future
<
int
>
enterPictureInPictureMode
(
{
String
?
backIconForAndroid
,
String
?
playIconForAndroid
,
String
?
pauseIconForAndroid
,
String
?
forwardIconForAndroid
});
Future
<
void
>
exitPictureInPictureMode
();
void
dispose
();
Future
<
void
>
dispose
();
}
\ No newline at end of file
Flutter/lib/Core/txvodplayer_controller.dart
浏览文件 @
d881f7d8
...
...
@@ -582,7 +582,7 @@ class TXVodPlayerController extends ChangeNotifier implements ValueListenable<TX
///
/// 释放controller
@override
void
dispose
()
async
{
Future
<
void
>
dispose
()
async
{
_isNeedDisposed
=
true
;
if
(!
_isDisposed
)
{
await
_eventSubscription
!.
cancel
();
...
...
Flutter/superplayer_widget/lib/superplayer_controller.dart
浏览文件 @
d881f7d8
...
...
@@ -205,7 +205,7 @@ class SuperPlayerController {
break
;
case
TXVodPlayEvent
.
PLAY_ERR_NET_DISCONNECT
:
case
TXVodPlayEvent
.
PLAY_EVT_PLAY_END
:
_stop
();
stopPlay
();
if
(
eventCode
==
TXVodPlayEvent
.
PLAY_ERR_NET_DISCONNECT
)
{
_observer
?.
onError
(
SuperPlayerCode
.
NET_ERROR
,
FSPLocal
.
current
.
txSpwNetWeak
);
}
else
{
...
...
@@ -286,7 +286,7 @@ class SuperPlayerController {
Future
<
void
>
playWithModelNeedLicence
(
SuperPlayerModel
videoModel
)
async
{
this
.
videoModel
=
videoModel
;
_playAction
=
videoModel
.
playAction
;
await
resetPlayer
();
await
stopPlay
();
if
(
_playAction
==
SuperPlayerModel
.
PLAY_ACTION_AUTO_PLAY
||
_playAction
==
SuperPlayerModel
.
PLAY_ACTION_PRELOAD
)
{
await
_playWithModelInner
(
videoModel
);
}
...
...
@@ -669,23 +669,23 @@ class SuperPlayerController {
_updatePlayerState
(
SuperPlayerState
.
INIT
);
}
void
_stop
()
async
{
resetPlayer
();
Future
<
void
>
stopPlay
()
async
{
_updatePlayerState
(
SuperPlayerState
.
END
);
await
resetPlayer
();
}
/// Release the player. Once the player is released, it cannot be used again
/// 释放播放器,播放器释放之后,将不能再使用
Future
<
void
>
releasePlayer
()
async
{
// Remove the event listener for the widget first.
_observer
?.
onDispose
();
playerStreamController
.
close
();
// If in picture-in-picture mode, the player should not be released temporarily.
if
(!
TXPipController
.
instance
.
isPlayerInPip
(
getCurrentController
()))
{
resetPlayer
();
_vodPlayerController
.
dispose
();
_livePlayerController
.
dispose
();
await
stopPlay
();
await
_vodPlayerController
.
dispose
();
await
_livePlayerController
.
dispose
();
}
// Remove the event listener for the widget.
_observer
?.
onDispose
();
playerStreamController
.
close
();
}
/// return true: executed exit full screen and other operations, consumed the return event. return false: did not consume the event.
...
...
Flutter/superplayer_widget/lib/ui/superplayer_widget.dart
浏览文件 @
d881f7d8
...
...
@@ -166,8 +166,10 @@ class SuperPlayerViewState extends State<SuperPlayerView> with WidgetsBindingObs
_togglePlayUIState
(
false
);
},
()
{
// onPlayStop
showControlView
(
false
);
_togglePlayUIState
(
false
);
if
(
mounted
)
{
showControlView
(
false
);
_togglePlayUIState
(
false
);
}
},
()
{
// onRcvFirstIframe
_coverViewKey
.
currentState
?.
hideCover
();
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论