Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
T
tx_player_fork
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
蒋俊
tx_player_fork
Commits
8ac09f2e
提交
8ac09f2e
authored
6月 11, 2024
作者:
kongdywang
1
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
1. fix playback failed when in pip after recover from lock screen
2. superPlayer Widget fix replay failed after play error 3. superPlayer Widget now will throw playback error msg
上级
1fe484a4
隐藏空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
35 行增加
和
20 行删除
+35
-20
FlutterPipImplActivity.java
...va/com/tencent/vod/flutter/ui/FlutterPipImplActivity.java
+22
-16
activity_flutter_pip_impl.xml
...android/src/main/res/layout/activity_flutter_pip_impl.xml
+4
-3
superplayer_controller.dart
...Widget/superplayer_widget/lib/superplayer_controller.dart
+9
-1
没有找到文件。
Flutter/android/src/main/java/com/tencent/vod/flutter/ui/FlutterPipImplActivity.java
浏览文件 @
8ac09f2e
...
@@ -13,7 +13,7 @@ import android.content.IntentFilter;
...
@@ -13,7 +13,7 @@ import android.content.IntentFilter;
import
android.content.ServiceConnection
;
import
android.content.ServiceConnection
;
import
android.content.res.Configuration
;
import
android.content.res.Configuration
;
import
android.graphics.Color
;
import
android.graphics.Color
;
import
android.graphics.
PixelFormat
;
import
android.graphics.
SurfaceTexture
;
import
android.os.Build
;
import
android.os.Build
;
import
android.os.Build.VERSION
;
import
android.os.Build.VERSION
;
import
android.os.Build.VERSION_CODES
;
import
android.os.Build.VERSION_CODES
;
...
@@ -22,11 +22,10 @@ import android.os.Handler;
...
@@ -22,11 +22,10 @@ import android.os.Handler;
import
android.os.IBinder
;
import
android.os.IBinder
;
import
android.text.TextUtils
;
import
android.text.TextUtils
;
import
android.view.Surface
;
import
android.view.Surface
;
import
android.view.SurfaceHolder
;
import
android.view.TextureView
;
import
android.view.SurfaceHolder.Callback
;
import
android.view.SurfaceView
;
import
android.view.View
;
import
android.view.View
;
import
android.widget.ProgressBar
;
import
android.widget.ProgressBar
;
import
android.widget.RelativeLayout
;
import
androidx.annotation.NonNull
;
import
androidx.annotation.NonNull
;
import
androidx.core.content.ContextCompat
;
import
androidx.core.content.ContextCompat
;
...
@@ -36,7 +35,6 @@ import com.tencent.rtmp.ITXLivePlayListener;
...
@@ -36,7 +35,6 @@ import com.tencent.rtmp.ITXLivePlayListener;
import
com.tencent.rtmp.ITXVodPlayListener
;
import
com.tencent.rtmp.ITXVodPlayListener
;
import
com.tencent.rtmp.TXLiveConstants
;
import
com.tencent.rtmp.TXLiveConstants
;
import
com.tencent.rtmp.TXLivePlayer
;
import
com.tencent.rtmp.TXLivePlayer
;
import
com.tencent.rtmp.TXVodConstants
;
import
com.tencent.rtmp.TXVodPlayer
;
import
com.tencent.rtmp.TXVodPlayer
;
import
com.tencent.vod.flutter.FTXEvent
;
import
com.tencent.vod.flutter.FTXEvent
;
import
com.tencent.vod.flutter.FTXPIPManager.PipParams
;
import
com.tencent.vod.flutter.FTXPIPManager.PipParams
;
...
@@ -47,7 +45,7 @@ import com.tencent.vod.flutter.tools.TXFlutterEngineHolder;
...
@@ -47,7 +45,7 @@ import com.tencent.vod.flutter.tools.TXFlutterEngineHolder;
import
com.tencent.vod.flutter.tools.TXSimpleEventBus
;
import
com.tencent.vod.flutter.tools.TXSimpleEventBus
;
public
class
FlutterPipImplActivity
extends
Activity
implements
Callback
,
ITXVodPlayListener
,
public
class
FlutterPipImplActivity
extends
Activity
implements
TextureView
.
SurfaceTextureListener
,
ITXVodPlayListener
,
ITXLivePlayListener
,
ServiceConnection
{
ITXLivePlayListener
,
ServiceConnection
{
private
static
final
String
TAG
=
"FlutterPipImplActivity"
;
private
static
final
String
TAG
=
"FlutterPipImplActivity"
;
...
@@ -69,8 +67,9 @@ public class FlutterPipImplActivity extends Activity implements Callback, ITXVod
...
@@ -69,8 +67,9 @@ public class FlutterPipImplActivity extends Activity implements Callback, ITXVod
private
int
configWidth
=
0
;
private
int
configWidth
=
0
;
private
int
configHeight
=
0
;
private
int
configHeight
=
0
;
private
Surfac
eView
mVideoSurface
;
private
Textur
eView
mVideoSurface
;
private
ProgressBar
mVideoProgress
;
private
ProgressBar
mVideoProgress
;
private
RelativeLayout
mPipContainer
;
private
boolean
mIsSurfaceCreated
=
false
;
private
boolean
mIsSurfaceCreated
=
false
;
// In picture-in-picture mode, clicking the X in the upper right corner will trigger `onStop` first.
// In picture-in-picture mode, clicking the X in the upper right corner will trigger `onStop` first.
...
@@ -141,9 +140,10 @@ public class FlutterPipImplActivity extends Activity implements Callback, ITXVod
...
@@ -141,9 +140,10 @@ public class FlutterPipImplActivity extends Activity implements Callback, ITXVod
bindAndroid12BugServiceIfNeed
();
bindAndroid12BugServiceIfNeed
();
registerPipBroadcast
();
registerPipBroadcast
();
setContentView
(
R
.
layout
.
activity_flutter_pip_impl
);
setContentView
(
R
.
layout
.
activity_flutter_pip_impl
);
mVideoSurface
=
findViewById
(
R
.
id
.
s
v_video_container
);
mVideoSurface
=
findViewById
(
R
.
id
.
t
v_video_container
);
mVideoProgress
=
findViewById
(
R
.
id
.
pb_video_progress
);
mVideoProgress
=
findViewById
(
R
.
id
.
pb_video_progress
);
mVideoSurface
.
getHolder
().
addCallback
(
this
);
mPipContainer
=
findViewById
(
R
.
id
.
rl_pip_container
);
mVideoSurface
.
setSurfaceTextureListener
(
this
);
if
(
null
==
pipPlayerHolder
)
{
if
(
null
==
pipPlayerHolder
)
{
LiteavLog
.
e
(
TAG
,
"lack pipPlayerHolder, please check the pip argument"
);
LiteavLog
.
e
(
TAG
,
"lack pipPlayerHolder, please check the pip argument"
);
finish
();
finish
();
...
@@ -401,7 +401,7 @@ public class FlutterPipImplActivity extends Activity implements Callback, ITXVod
...
@@ -401,7 +401,7 @@ public class FlutterPipImplActivity extends Activity implements Callback, ITXVod
private
void
startPipVideo
()
{
private
void
startPipVideo
()
{
if
(
mIsSurfaceCreated
)
{
if
(
mIsSurfaceCreated
)
{
attachSurface
(
mVideoSurface
.
getHolder
().
getSurface
(
));
attachSurface
(
new
Surface
(
mVideoSurface
.
getSurfaceTexture
()
));
startPlay
();
startPlay
();
}
}
}
}
...
@@ -418,20 +418,26 @@ public class FlutterPipImplActivity extends Activity implements Callback, ITXVod
...
@@ -418,20 +418,26 @@ public class FlutterPipImplActivity extends Activity implements Callback, ITXVod
}
}
@Override
@Override
public
void
surfaceCreated
(
SurfaceHolder
holder
)
{
public
void
onSurfaceTextureAvailable
(
@NonNull
SurfaceTexture
surface
,
int
width
,
int
height
)
{
mIsSurfaceCreated
=
true
;
mIsSurfaceCreated
=
true
;
holder
.
setFormat
(
PixelFormat
.
TRANSLUCENT
);
attachSurface
(
new
Surface
(
surface
));
attachSurface
(
holder
.
getSurface
());
startPlay
();
startPlay
();
}
}
@Override
@Override
public
void
surfaceChanged
(
SurfaceHolder
holder
,
int
format
,
int
width
,
int
height
)
{
public
void
onSurfaceTextureSizeChanged
(
@NonNull
SurfaceTexture
surface
,
int
width
,
int
height
)
{
}
}
@Override
@Override
public
void
surfaceDestroyed
(
SurfaceHolder
holder
)
{
public
boolean
onSurfaceTextureDestroyed
(
@NonNull
SurfaceTexture
surface
)
{
mIsSurfaceCreated
=
false
;
mIsSurfaceCreated
=
false
;
return
false
;
}
@Override
public
void
onSurfaceTextureUpdated
(
@NonNull
SurfaceTexture
surface
)
{
}
}
@Override
@Override
...
@@ -552,7 +558,7 @@ public class FlutterPipImplActivity extends Activity implements Callback, ITXVod
...
@@ -552,7 +558,7 @@ public class FlutterPipImplActivity extends Activity implements Callback, ITXVod
private
void
showComponent
()
{
private
void
showComponent
()
{
mVideoSurface
.
setVisibility
(
View
.
VISIBLE
);
mVideoSurface
.
setVisibility
(
View
.
VISIBLE
);
mVideoProgress
.
setVisibility
(
View
.
VISIBLE
);
mVideoProgress
.
setVisibility
(
View
.
VISIBLE
);
m
VideoSurface
.
setBackgroundColor
(
Color
.
parseColor
(
"#33000000"
));
m
PipContainer
.
setBackgroundColor
(
Color
.
parseColor
(
"#33000000"
));
}
}
private
void
controlPipPlayStatus
(
boolean
isPlaying
)
{
private
void
controlPipPlayStatus
(
boolean
isPlaying
)
{
...
...
Flutter/android/src/main/res/layout/activity_flutter_pip_impl.xml
浏览文件 @
8ac09f2e
...
@@ -3,16 +3,17 @@
...
@@ -3,16 +3,17 @@
xmlns:android=
"http://schemas.android.com/apk/res/android"
xmlns:android=
"http://schemas.android.com/apk/res/android"
xmlns:app=
"http://schemas.android.com/apk/res-auto"
xmlns:app=
"http://schemas.android.com/apk/res-auto"
xmlns:tools=
"http://schemas.android.com/tools"
xmlns:tools=
"http://schemas.android.com/tools"
android:id=
"@+id/rl_pip_container"
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:layout_height=
"match_parent"
android:background=
"@android:color/transparent"
android:background=
"@android:color/transparent"
tools:context=
"com.tencent.vod.flutter.ui.FlutterPipImplActivity"
>
tools:context=
"com.tencent.vod.flutter.ui.FlutterPipImplActivity"
>
<
Surfac
eView
<
Textur
eView
android:id=
"@+id/
s
v_video_container"
android:id=
"@+id/
t
v_video_container"
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:layout_height=
"match_parent"
android:background=
"@
android:color/transparent
"
android:background=
"@
null
"
android:visibility=
"gone"
/>
android:visibility=
"gone"
/>
<ProgressBar
<ProgressBar
...
...
FlutterWidget/superplayer_widget/lib/superplayer_controller.dart
浏览文件 @
8ac09f2e
...
@@ -223,6 +223,12 @@ class SuperPlayerController {
...
@@ -223,6 +223,12 @@ class SuperPlayerController {
}
}
break
;
break
;
}
}
// -100 is IOS valid view
if
(
eventCode
<
0
&&
eventCode
!=
-
100
)
{
_observer
?.
onError
(
SuperPlayerCode
.
VOD_PLAY_FAIL
,
event
.
toString
());
_addSimpleEvent
(
SuperPlayerViewEvent
.
onSuperPlayerError
,
params:
event
);
_updatePlayerState
(
SuperPlayerState
.
END
);
}
});
});
_vodNetEventListener
=
_vodPlayerController
.
onPlayerNetStatusBroadcast
.
listen
((
event
)
{
_vodNetEventListener
=
_vodPlayerController
.
onPlayerNetStatusBroadcast
.
listen
((
event
)
{
_playerNetStatusStreamController
.
add
(
event
);
_playerNetStatusStreamController
.
add
(
event
);
...
@@ -542,7 +548,9 @@ class SuperPlayerController {
...
@@ -542,7 +548,9 @@ class SuperPlayerController {
}
}
}
}
}
else
{
}
else
{
await
_playVodUrl
(
_currentPlayUrl
);
if
(
null
!=
videoModel
)
{
await
_playWithModelInner
(
videoModel
!);
}
}
}
}
}
...
...
蒋俊
@18223204110
被提及 commit
d84aee2d
·
12月 12, 2025
被提及 commit
d84aee2d
被提及 commit d84aee2d06a850e9baa34725edf634f81c7c5e12
切换提交列表
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论