Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
T
tx_player_fork
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
蒋俊
tx_player_fork
Commits
0ff875e6
提交
0ff875e6
authored
12月 04, 2024
作者:
kongdywang
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
1. Pre-download supports httpHeader.
2. Supports encrypted playback of MP4. 3. Added support for HEVC playback downgrade. 4. Fix an issue that some API callbacks have no parameters.
上级
4110e143
隐藏空白字符变更
内嵌
并排
正在显示
25 个修改的文件
包含
231 行增加
和
102 行删除
+231
-102
CHANGELOG.md
Flutter/CHANGELOG.md
+12
-0
buildVersionOnMac.sh
Flutter/CI/buildVersionOnMac.sh
+1
-1
config.gradle
Flutter/android/config.gradle
+3
-2
FTXDownloadManager.java
...main/java/com/tencent/vod/flutter/FTXDownloadManager.java
+3
-0
FTXTransformation.java
.../main/java/com/tencent/vod/flutter/FTXTransformation.java
+1
-0
FTXVodPlayer.java
...d/src/main/java/com/tencent/vod/flutter/FTXVodPlayer.java
+6
-0
FtxMessages.java
...in/java/com/tencent/vod/flutter/messages/FtxMessages.java
+52
-7
TXCommonUtil.java
...main/java/com/tencent/vod/flutter/tools/TXCommonUtil.java
+3
-1
FTXDownloadManager.m
Flutter/ios/Classes/FTXDownloadManager.m
+35
-38
FTXLivePlayer.m
Flutter/ios/Classes/FTXLivePlayer.m
+4
-8
FTXTransformation.m
Flutter/ios/Classes/FTXTransformation.m
+1
-0
FTXVodPlayer.m
Flutter/ios/Classes/FTXVodPlayer.m
+15
-15
SuperPlayerPlugin.m
Flutter/ios/Classes/SuperPlayerPlugin.m
+5
-12
FtxMessages.h
Flutter/ios/Classes/messages/FtxMessages.h
+8
-3
FtxMessages.m
Flutter/ios/Classes/messages/FtxMessages.m
+11
-3
TXCommonUtil.h
Flutter/ios/Classes/tools/TXCommonUtil.h
+2
-0
TXCommonUtil.m
Flutter/ios/Classes/tools/TXCommonUtil.m
+16
-0
super_player.podspec
Flutter/ios/super_player.podspec
+2
-2
common_config.dart
Flutter/lib/Core/common/common_config.dart
+2
-1
txplayer_message.dart
Flutter/lib/Core/pigeons/txplayer_message.dart
+4
-0
txplayer_define.dart
Flutter/lib/Core/txplayer_define.dart
+23
-2
txplayer_messages.dart
Flutter/lib/Core/txplayer_messages.dart
+11
-0
txvoddownload_controller.dart
Flutter/lib/Core/txvoddownload_controller.dart
+6
-6
txvodplayer_config.dart
Flutter/lib/Core/txvodplayer_config.dart
+4
-0
pubspec.yaml
Flutter/pubspec.yaml
+1
-1
没有找到文件。
Flutter/CHANGELOG.md
浏览文件 @
0ff875e6
...
@@ -250,4 +250,15 @@ Professional 分支:Android & iOS 端集成TXLiteAVSDK_Professional lastest版
...
@@ -250,4 +250,15 @@ Professional 分支:Android & iOS 端集成TXLiteAVSDK_Professional lastest版
-
set iOS TXLiteAVSDK_Professional to 12.1.16597, tag:release_pro_v12.1.0
-
set iOS TXLiteAVSDK_Professional to 12.1.16597, tag:release_pro_v12.1.0
-
Fix the issue of reversed logic in the live streaming mute method.
-
Fix the issue of reversed logic in the live streaming mute method.
-
iOS adds support for Picture-in-Picture for live streaming, which requires premium permission to use.
-
iOS adds support for Picture-in-Picture for live streaming, which requires premium permission to use.
-
Fix other known issues.
#### Version: 12.2.0 2024.12.04
##### Features:
-
set Android TXLiteAVSDK_Professional to 12.2.0.15065,tag:release_pro_v12.2.0
-
set iOS TXLiteAVSDK_Professional to 12.2.16945, tag:release_pro_v12.2.0
-
Pre-download supports httpHeader
-
Supports encrypted playback of MP4
-
Added support for HEVC playback downgrade
-
Fix other known issues.
-
Fix other known issues.
\ No newline at end of file
Flutter/CI/buildVersionOnMac.sh
浏览文件 @
0ff875e6
...
@@ -5,7 +5,7 @@ buildLog() {
...
@@ -5,7 +5,7 @@ buildLog() {
}
}
inputVersion
=
$1
inputVersion
=
$1
export
VERSION_NAME
=
"12.
1
.0"
export
VERSION_NAME
=
"12.
2
.0"
if
[
-n
"
$inputVersion
"
]
;
then
if
[
-n
"
$inputVersion
"
]
;
then
VERSION_NAME
=
$inputVersion
VERSION_NAME
=
$inputVersion
fi
fi
...
...
Flutter/android/config.gradle
浏览文件 @
0ff875e6
...
@@ -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.
1
.0'
playerVersion
=
'12.
2
.0'
compat
=
"androidx.appcompat:appcompat:1.6.1"
compat
=
"androidx.appcompat:appcompat:1.6.1"
/**
/**
...
@@ -14,5 +14,5 @@ rootProject.ext {
...
@@ -14,5 +14,5 @@ rootProject.ext {
Professional SDK: liteavSdk="com.tencent.liteav:LiteAVSDK_Professional:latest.release"
Professional SDK: liteavSdk="com.tencent.liteav:LiteAVSDK_Professional:latest.release"
If you want to specify the SDK version(eg 11.7.0.13946), use: liteavSdk="com.tencent.liteav:LiteAVSDK_Player:11.7.0.13946"
If you want to specify the SDK version(eg 11.7.0.13946), use: liteavSdk="com.tencent.liteav:LiteAVSDK_Player:11.7.0.13946"
*/
*/
liteavSdk
=
"com.tencent.liteav:LiteAVSDK_Professional:12.
0.0.14689
"
liteavSdk
=
"com.tencent.liteav:LiteAVSDK_Professional:12.
2.0.15065
"
}
}
\ No newline at end of file
Flutter/android/src/main/java/com/tencent/vod/flutter/FTXDownloadManager.java
浏览文件 @
0ff875e6
...
@@ -316,6 +316,9 @@ public class FTXDownloadManager implements ITXVodDownloadListener, TXFlutterDown
...
@@ -316,6 +316,9 @@ public class FTXDownloadManager implements ITXVodDownloadListener, TXFlutterDown
int
appId
=
msg
.
getAppId
()
!=
null
?
msg
.
getAppId
().
intValue
()
:
0
;
int
appId
=
msg
.
getAppId
()
!=
null
?
msg
.
getAppId
().
intValue
()
:
0
;
txPlayInfoParams
=
new
TXPlayInfoParams
(
appId
,
msg
.
getFileId
(),
msg
.
getPSign
());
txPlayInfoParams
=
new
TXPlayInfoParams
(
appId
,
msg
.
getFileId
(),
msg
.
getPSign
());
}
}
if
(
msg
.
getHttpHeader
()
!=
null
)
{
txPlayInfoParams
.
setHeaders
(
msg
.
getHttpHeader
());
}
final
TXVodPreloadManager
downloadManager
=
final
TXVodPreloadManager
downloadManager
=
TXVodPreloadManager
.
getInstance
(
mFlutterPluginBinding
.
getApplicationContext
());
TXVodPreloadManager
.
getInstance
(
mFlutterPluginBinding
.
getApplicationContext
());
float
preloadSizeMB
=
msg
.
getPreloadSizeMB
()
!=
null
?
msg
.
getPreloadSizeMB
().
floatValue
()
:
0
;
float
preloadSizeMB
=
msg
.
getPreloadSizeMB
()
!=
null
?
msg
.
getPreloadSizeMB
().
floatValue
()
:
0
;
...
...
Flutter/android/src/main/java/com/tencent/vod/flutter/FTXTransformation.java
浏览文件 @
0ff875e6
...
@@ -76,6 +76,7 @@ public class FTXTransformation {
...
@@ -76,6 +76,7 @@ public class FTXTransformation {
playConfig
.
setPreferredResolution
(
configPlayerMsg
.
getPreferredResolution
());
playConfig
.
setPreferredResolution
(
configPlayerMsg
.
getPreferredResolution
());
}
}
playConfig
.
setMediaType
(
configPlayerMsg
.
getMediaType
().
intValue
());
playConfig
.
setMediaType
(
configPlayerMsg
.
getMediaType
().
intValue
());
playConfig
.
setEncryptedMp4Level
(
configPlayerMsg
.
getEncryptedMp4Level
().
intValue
());
return
playConfig
;
return
playConfig
;
}
}
...
...
Flutter/android/src/main/java/com/tencent/vod/flutter/FTXVodPlayer.java
浏览文件 @
0ff875e6
...
@@ -255,6 +255,12 @@ public class FTXVodPlayer extends FTXBasePlayer implements ITXVodPlayListener,
...
@@ -255,6 +255,12 @@ public class FTXVodPlayer extends FTXBasePlayer implements ITXVodPlayListener,
mVodPlayer
.
setVodSubtitleDataListener
(
new
ITXVodPlayListener
.
ITXVodSubtitleDataListener
()
{
mVodPlayer
.
setVodSubtitleDataListener
(
new
ITXVodPlayListener
.
ITXVodSubtitleDataListener
()
{
@Override
@Override
public
void
onSubtitleData
(
TXVodDef
.
TXVodSubtitleData
sub
)
{
public
void
onSubtitleData
(
TXVodDef
.
TXVodSubtitleData
sub
)
{
LiteavLog
.
i
(
TAG
,
"callback subtitle"
+
" ,index:"
+
sub
.
trackIndex
+
" ,startMs:"
+
sub
.
startPositionMs
+
" ,durationMs:"
+
sub
.
durationMs
+
" ,content:"
+
sub
.
subtitleData
);
Bundle
bundle
=
new
Bundle
();
Bundle
bundle
=
new
Bundle
();
bundle
.
putString
(
FTXEvent
.
EXTRA_SUBTITLE_DATA
,
sub
.
subtitleData
);
bundle
.
putString
(
FTXEvent
.
EXTRA_SUBTITLE_DATA
,
sub
.
subtitleData
);
bundle
.
putLong
(
FTXEvent
.
EXTRA_SUBTITLE_START_POSITION_MS
,
sub
.
startPositionMs
);
bundle
.
putLong
(
FTXEvent
.
EXTRA_SUBTITLE_START_POSITION_MS
,
sub
.
startPositionMs
);
...
...
Flutter/android/src/main/java/com/tencent/vod/flutter/messages/FtxMessages.java
浏览文件 @
0ff875e6
// Copyright (c) 2022 Tencent. All rights reserved.
// Copyright (c) 2022 Tencent. All rights reserved.
// Autogenerated from Pigeon (v22.6.
0
), do not edit directly.
// Autogenerated from Pigeon (v22.6.
1
), do not edit directly.
// See also: https://pub.dev/packages/pigeon
// See also: https://pub.dev/packages/pigeon
package
com
.
tencent
.
vod
.
flutter
.
messages
;
package
com
.
tencent
.
vod
.
flutter
.
messages
;
...
@@ -1374,17 +1374,28 @@ public class FtxMessages {
...
@@ -1374,17 +1374,28 @@ public class FtxMessages {
this
.
mediaType
=
setterArg
;
this
.
mediaType
=
setterArg
;
}
}
/** MP4 encryption playback: Supported since version 12.2. */
private
@Nullable
Long
encryptedMp4Level
;
public
@Nullable
Long
getEncryptedMp4Level
()
{
return
encryptedMp4Level
;
}
public
void
setEncryptedMp4Level
(
@Nullable
Long
setterArg
)
{
this
.
encryptedMp4Level
=
setterArg
;
}
@Override
@Override
public
boolean
equals
(
Object
o
)
{
public
boolean
equals
(
Object
o
)
{
if
(
this
==
o
)
{
return
true
;
}
if
(
this
==
o
)
{
return
true
;
}
if
(
o
==
null
||
getClass
()
!=
o
.
getClass
())
{
return
false
;
}
if
(
o
==
null
||
getClass
()
!=
o
.
getClass
())
{
return
false
;
}
FTXVodPlayConfigPlayerMsg
that
=
(
FTXVodPlayConfigPlayerMsg
)
o
;
FTXVodPlayConfigPlayerMsg
that
=
(
FTXVodPlayConfigPlayerMsg
)
o
;
return
Objects
.
equals
(
playerId
,
that
.
playerId
)
&&
Objects
.
equals
(
connectRetryCount
,
that
.
connectRetryCount
)
&&
Objects
.
equals
(
connectRetryInterval
,
that
.
connectRetryInterval
)
&&
Objects
.
equals
(
timeout
,
that
.
timeout
)
&&
Objects
.
equals
(
playerType
,
that
.
playerType
)
&&
Objects
.
equals
(
headers
,
that
.
headers
)
&&
Objects
.
equals
(
enableAccurateSeek
,
that
.
enableAccurateSeek
)
&&
Objects
.
equals
(
autoRotate
,
that
.
autoRotate
)
&&
Objects
.
equals
(
smoothSwitchBitrate
,
that
.
smoothSwitchBitrate
)
&&
Objects
.
equals
(
cacheMp4ExtName
,
that
.
cacheMp4ExtName
)
&&
Objects
.
equals
(
progressInterval
,
that
.
progressInterval
)
&&
Objects
.
equals
(
maxBufferSize
,
that
.
maxBufferSize
)
&&
Objects
.
equals
(
maxPreloadSize
,
that
.
maxPreloadSize
)
&&
Objects
.
equals
(
firstStartPlayBufferTime
,
that
.
firstStartPlayBufferTime
)
&&
Objects
.
equals
(
nextStartPlayBufferTime
,
that
.
nextStartPlayBufferTime
)
&&
Objects
.
equals
(
overlayKey
,
that
.
overlayKey
)
&&
Objects
.
equals
(
overlayIv
,
that
.
overlayIv
)
&&
Objects
.
equals
(
extInfoMap
,
that
.
extInfoMap
)
&&
Objects
.
equals
(
enableRenderProcess
,
that
.
enableRenderProcess
)
&&
Objects
.
equals
(
preferredResolution
,
that
.
preferredResolution
)
&&
Objects
.
equals
(
mediaType
,
that
.
mediaType
);
return
Objects
.
equals
(
playerId
,
that
.
playerId
)
&&
Objects
.
equals
(
connectRetryCount
,
that
.
connectRetryCount
)
&&
Objects
.
equals
(
connectRetryInterval
,
that
.
connectRetryInterval
)
&&
Objects
.
equals
(
timeout
,
that
.
timeout
)
&&
Objects
.
equals
(
playerType
,
that
.
playerType
)
&&
Objects
.
equals
(
headers
,
that
.
headers
)
&&
Objects
.
equals
(
enableAccurateSeek
,
that
.
enableAccurateSeek
)
&&
Objects
.
equals
(
autoRotate
,
that
.
autoRotate
)
&&
Objects
.
equals
(
smoothSwitchBitrate
,
that
.
smoothSwitchBitrate
)
&&
Objects
.
equals
(
cacheMp4ExtName
,
that
.
cacheMp4ExtName
)
&&
Objects
.
equals
(
progressInterval
,
that
.
progressInterval
)
&&
Objects
.
equals
(
maxBufferSize
,
that
.
maxBufferSize
)
&&
Objects
.
equals
(
maxPreloadSize
,
that
.
maxPreloadSize
)
&&
Objects
.
equals
(
firstStartPlayBufferTime
,
that
.
firstStartPlayBufferTime
)
&&
Objects
.
equals
(
nextStartPlayBufferTime
,
that
.
nextStartPlayBufferTime
)
&&
Objects
.
equals
(
overlayKey
,
that
.
overlayKey
)
&&
Objects
.
equals
(
overlayIv
,
that
.
overlayIv
)
&&
Objects
.
equals
(
extInfoMap
,
that
.
extInfoMap
)
&&
Objects
.
equals
(
enableRenderProcess
,
that
.
enableRenderProcess
)
&&
Objects
.
equals
(
preferredResolution
,
that
.
preferredResolution
)
&&
Objects
.
equals
(
mediaType
,
that
.
mediaType
)
&&
Objects
.
equals
(
encryptedMp4Level
,
that
.
encryptedMp4Level
)
;
}
}
@Override
@Override
public
int
hashCode
()
{
public
int
hashCode
()
{
return
Objects
.
hash
(
playerId
,
connectRetryCount
,
connectRetryInterval
,
timeout
,
playerType
,
headers
,
enableAccurateSeek
,
autoRotate
,
smoothSwitchBitrate
,
cacheMp4ExtName
,
progressInterval
,
maxBufferSize
,
maxPreloadSize
,
firstStartPlayBufferTime
,
nextStartPlayBufferTime
,
overlayKey
,
overlayIv
,
extInfoMap
,
enableRenderProcess
,
preferredResolution
,
mediaType
);
return
Objects
.
hash
(
playerId
,
connectRetryCount
,
connectRetryInterval
,
timeout
,
playerType
,
headers
,
enableAccurateSeek
,
autoRotate
,
smoothSwitchBitrate
,
cacheMp4ExtName
,
progressInterval
,
maxBufferSize
,
maxPreloadSize
,
firstStartPlayBufferTime
,
nextStartPlayBufferTime
,
overlayKey
,
overlayIv
,
extInfoMap
,
enableRenderProcess
,
preferredResolution
,
mediaType
,
encryptedMp4Level
);
}
}
public
static
final
class
Builder
{
public
static
final
class
Builder
{
...
@@ -1557,6 +1568,14 @@ public class FtxMessages {
...
@@ -1557,6 +1568,14 @@ public class FtxMessages {
return
this
;
return
this
;
}
}
private
@Nullable
Long
encryptedMp4Level
;
@CanIgnoreReturnValue
public
@NonNull
Builder
setEncryptedMp4Level
(
@Nullable
Long
setterArg
)
{
this
.
encryptedMp4Level
=
setterArg
;
return
this
;
}
public
@NonNull
FTXVodPlayConfigPlayerMsg
build
()
{
public
@NonNull
FTXVodPlayConfigPlayerMsg
build
()
{
FTXVodPlayConfigPlayerMsg
pigeonReturn
=
new
FTXVodPlayConfigPlayerMsg
();
FTXVodPlayConfigPlayerMsg
pigeonReturn
=
new
FTXVodPlayConfigPlayerMsg
();
pigeonReturn
.
setPlayerId
(
playerId
);
pigeonReturn
.
setPlayerId
(
playerId
);
...
@@ -1580,13 +1599,14 @@ public class FtxMessages {
...
@@ -1580,13 +1599,14 @@ public class FtxMessages {
pigeonReturn
.
setEnableRenderProcess
(
enableRenderProcess
);
pigeonReturn
.
setEnableRenderProcess
(
enableRenderProcess
);
pigeonReturn
.
setPreferredResolution
(
preferredResolution
);
pigeonReturn
.
setPreferredResolution
(
preferredResolution
);
pigeonReturn
.
setMediaType
(
mediaType
);
pigeonReturn
.
setMediaType
(
mediaType
);
pigeonReturn
.
setEncryptedMp4Level
(
encryptedMp4Level
);
return
pigeonReturn
;
return
pigeonReturn
;
}
}
}
}
@NonNull
@NonNull
ArrayList
<
Object
>
toList
()
{
ArrayList
<
Object
>
toList
()
{
ArrayList
<
Object
>
toListResult
=
new
ArrayList
<>(
2
1
);
ArrayList
<
Object
>
toListResult
=
new
ArrayList
<>(
2
2
);
toListResult
.
add
(
playerId
);
toListResult
.
add
(
playerId
);
toListResult
.
add
(
connectRetryCount
);
toListResult
.
add
(
connectRetryCount
);
toListResult
.
add
(
connectRetryInterval
);
toListResult
.
add
(
connectRetryInterval
);
...
@@ -1608,6 +1628,7 @@ public class FtxMessages {
...
@@ -1608,6 +1628,7 @@ public class FtxMessages {
toListResult
.
add
(
enableRenderProcess
);
toListResult
.
add
(
enableRenderProcess
);
toListResult
.
add
(
preferredResolution
);
toListResult
.
add
(
preferredResolution
);
toListResult
.
add
(
mediaType
);
toListResult
.
add
(
mediaType
);
toListResult
.
add
(
encryptedMp4Level
);
return
toListResult
;
return
toListResult
;
}
}
...
@@ -1655,6 +1676,8 @@ public class FtxMessages {
...
@@ -1655,6 +1676,8 @@ public class FtxMessages {
pigeonResult
.
setPreferredResolution
((
Long
)
preferredResolution
);
pigeonResult
.
setPreferredResolution
((
Long
)
preferredResolution
);
Object
mediaType
=
pigeonVar_list
.
get
(
20
);
Object
mediaType
=
pigeonVar_list
.
get
(
20
);
pigeonResult
.
setMediaType
((
Long
)
mediaType
);
pigeonResult
.
setMediaType
((
Long
)
mediaType
);
Object
encryptedMp4Level
=
pigeonVar_list
.
get
(
21
);
pigeonResult
.
setEncryptedMp4Level
((
Long
)
encryptedMp4Level
);
return
pigeonResult
;
return
pigeonResult
;
}
}
}
}
...
@@ -3019,17 +3042,27 @@ public class FtxMessages {
...
@@ -3019,17 +3042,27 @@ public class FtxMessages {
this
.
tmpPreloadTaskId
=
setterArg
;
this
.
tmpPreloadTaskId
=
setterArg
;
}
}
private
@Nullable
Map
<
String
,
String
>
httpHeader
;
public
@Nullable
Map
<
String
,
String
>
getHttpHeader
()
{
return
httpHeader
;
}
public
void
setHttpHeader
(
@Nullable
Map
<
String
,
String
>
setterArg
)
{
this
.
httpHeader
=
setterArg
;
}
@Override
@Override
public
boolean
equals
(
Object
o
)
{
public
boolean
equals
(
Object
o
)
{
if
(
this
==
o
)
{
return
true
;
}
if
(
this
==
o
)
{
return
true
;
}
if
(
o
==
null
||
getClass
()
!=
o
.
getClass
())
{
return
false
;
}
if
(
o
==
null
||
getClass
()
!=
o
.
getClass
())
{
return
false
;
}
PreLoadInfoMsg
that
=
(
PreLoadInfoMsg
)
o
;
PreLoadInfoMsg
that
=
(
PreLoadInfoMsg
)
o
;
return
Objects
.
equals
(
appId
,
that
.
appId
)
&&
Objects
.
equals
(
fileId
,
that
.
fileId
)
&&
Objects
.
equals
(
pSign
,
that
.
pSign
)
&&
Objects
.
equals
(
playUrl
,
that
.
playUrl
)
&&
Objects
.
equals
(
preloadSizeMB
,
that
.
preloadSizeMB
)
&&
Objects
.
equals
(
preferredResolution
,
that
.
preferredResolution
)
&&
Objects
.
equals
(
tmpPreloadTaskId
,
that
.
tmpPreloadTaskId
);
return
Objects
.
equals
(
appId
,
that
.
appId
)
&&
Objects
.
equals
(
fileId
,
that
.
fileId
)
&&
Objects
.
equals
(
pSign
,
that
.
pSign
)
&&
Objects
.
equals
(
playUrl
,
that
.
playUrl
)
&&
Objects
.
equals
(
preloadSizeMB
,
that
.
preloadSizeMB
)
&&
Objects
.
equals
(
preferredResolution
,
that
.
preferredResolution
)
&&
Objects
.
equals
(
tmpPreloadTaskId
,
that
.
tmpPreloadTaskId
)
&&
Objects
.
equals
(
httpHeader
,
that
.
httpHeader
)
;
}
}
@Override
@Override
public
int
hashCode
()
{
public
int
hashCode
()
{
return
Objects
.
hash
(
appId
,
fileId
,
pSign
,
playUrl
,
preloadSizeMB
,
preferredResolution
,
tmpPreloadTaskId
);
return
Objects
.
hash
(
appId
,
fileId
,
pSign
,
playUrl
,
preloadSizeMB
,
preferredResolution
,
tmpPreloadTaskId
,
httpHeader
);
}
}
public
static
final
class
Builder
{
public
static
final
class
Builder
{
...
@@ -3090,6 +3123,14 @@ public class FtxMessages {
...
@@ -3090,6 +3123,14 @@ public class FtxMessages {
return
this
;
return
this
;
}
}
private
@Nullable
Map
<
String
,
String
>
httpHeader
;
@CanIgnoreReturnValue
public
@NonNull
Builder
setHttpHeader
(
@Nullable
Map
<
String
,
String
>
setterArg
)
{
this
.
httpHeader
=
setterArg
;
return
this
;
}
public
@NonNull
PreLoadInfoMsg
build
()
{
public
@NonNull
PreLoadInfoMsg
build
()
{
PreLoadInfoMsg
pigeonReturn
=
new
PreLoadInfoMsg
();
PreLoadInfoMsg
pigeonReturn
=
new
PreLoadInfoMsg
();
pigeonReturn
.
setAppId
(
appId
);
pigeonReturn
.
setAppId
(
appId
);
...
@@ -3099,13 +3140,14 @@ public class FtxMessages {
...
@@ -3099,13 +3140,14 @@ public class FtxMessages {
pigeonReturn
.
setPreloadSizeMB
(
preloadSizeMB
);
pigeonReturn
.
setPreloadSizeMB
(
preloadSizeMB
);
pigeonReturn
.
setPreferredResolution
(
preferredResolution
);
pigeonReturn
.
setPreferredResolution
(
preferredResolution
);
pigeonReturn
.
setTmpPreloadTaskId
(
tmpPreloadTaskId
);
pigeonReturn
.
setTmpPreloadTaskId
(
tmpPreloadTaskId
);
pigeonReturn
.
setHttpHeader
(
httpHeader
);
return
pigeonReturn
;
return
pigeonReturn
;
}
}
}
}
@NonNull
@NonNull
ArrayList
<
Object
>
toList
()
{
ArrayList
<
Object
>
toList
()
{
ArrayList
<
Object
>
toListResult
=
new
ArrayList
<>(
7
);
ArrayList
<
Object
>
toListResult
=
new
ArrayList
<>(
8
);
toListResult
.
add
(
appId
);
toListResult
.
add
(
appId
);
toListResult
.
add
(
fileId
);
toListResult
.
add
(
fileId
);
toListResult
.
add
(
pSign
);
toListResult
.
add
(
pSign
);
...
@@ -3113,6 +3155,7 @@ public class FtxMessages {
...
@@ -3113,6 +3155,7 @@ public class FtxMessages {
toListResult
.
add
(
preloadSizeMB
);
toListResult
.
add
(
preloadSizeMB
);
toListResult
.
add
(
preferredResolution
);
toListResult
.
add
(
preferredResolution
);
toListResult
.
add
(
tmpPreloadTaskId
);
toListResult
.
add
(
tmpPreloadTaskId
);
toListResult
.
add
(
httpHeader
);
return
toListResult
;
return
toListResult
;
}
}
...
@@ -3132,6 +3175,8 @@ public class FtxMessages {
...
@@ -3132,6 +3175,8 @@ public class FtxMessages {
pigeonResult
.
setPreferredResolution
((
Long
)
preferredResolution
);
pigeonResult
.
setPreferredResolution
((
Long
)
preferredResolution
);
Object
tmpPreloadTaskId
=
pigeonVar_list
.
get
(
6
);
Object
tmpPreloadTaskId
=
pigeonVar_list
.
get
(
6
);
pigeonResult
.
setTmpPreloadTaskId
((
Long
)
tmpPreloadTaskId
);
pigeonResult
.
setTmpPreloadTaskId
((
Long
)
tmpPreloadTaskId
);
Object
httpHeader
=
pigeonVar_list
.
get
(
7
);
pigeonResult
.
setHttpHeader
((
Map
<
String
,
String
>)
httpHeader
);
return
pigeonResult
;
return
pigeonResult
;
}
}
}
}
...
...
Flutter/android/src/main/java/com/tencent/vod/flutter/tools/TXCommonUtil.java
浏览文件 @
0ff875e6
...
@@ -99,7 +99,9 @@ public class TXCommonUtil {
...
@@ -99,7 +99,9 @@ public class TXCommonUtil {
Set
<
String
>
keySet
=
bundle
.
keySet
();
Set
<
String
>
keySet
=
bundle
.
keySet
();
for
(
String
key
:
keySet
)
{
for
(
String
key
:
keySet
)
{
Object
val
=
bundle
.
get
(
key
);
Object
val
=
bundle
.
get
(
key
);
param
.
put
(
key
,
val
);
if
(
null
!=
val
)
{
param
.
put
(
key
,
val
);
}
}
}
}
}
...
...
Flutter/ios/Classes/FTXDownloadManager.m
浏览文件 @
0ff875e6
...
@@ -63,12 +63,16 @@
...
@@ -63,12 +63,16 @@
__block
NSMutableDictionary
*
dict
=
[
NSMutableDictionary
dictionary
];
__block
NSMutableDictionary
*
dict
=
[
NSMutableDictionary
dictionary
];
[
dict
setObject
:
@
(
tmpTaskId
)
forKey
:
@"tmpTaskId"
];
[
dict
setObject
:
@
(
tmpTaskId
)
forKey
:
@"tmpTaskId"
];
[
dict
setObject
:
@
(
taskID
)
forKey
:
@"taskId"
];
[
dict
setObject
:
@
(
taskID
)
forKey
:
@"taskId"
];
[
dict
setObject
:
fileId
forKey
:
@"fileId"
];
if
(
fileId
)
{
[
dict
setObject
:
url
forKey
:
@"url"
];
[
dict
setObject
:
fileId
forKey
:
@"fileId"
];
[
dict
setObject
:
param
forKey
:
@"param"
];
}
[
self
.
downloadFlutterApi
onPreDownloadEventEvent
:[
FTXDownloadManager
getParamsWithEvent
:
EVENT_PREDOWNLOAD_ON_START
withParams
:
dict
]
completion
:^
(
FlutterError
*
_Nullable
error
)
{
if
(
url
)
{
FTXLOGE
(
@"callback message error:%@"
,
error
);
[
dict
setObject
:
url
forKey
:
@"url"
];
}];
}
if
(
param
)
{
[
dict
setObject
:
param
forKey
:
@"param"
];
}
[
self
onPreloadCallback
:[
TXCommonUtil
getParamsWithEvent
:
EVENT_PREDOWNLOAD_ON_START
withParams
:
dict
]];
}
}
-
(
void
)
onPreLoadErrorEvent
:
(
long
)
tmpTaskId
taskId
:
(
int
)
taskID
url
:
(
NSString
*
)
url
error
:
(
NSError
*
)
error
{
-
(
void
)
onPreLoadErrorEvent
:
(
long
)
tmpTaskId
taskId
:
(
int
)
taskID
url
:
(
NSString
*
)
url
error
:
(
NSError
*
)
error
{
...
@@ -77,15 +81,22 @@
...
@@ -77,15 +81,22 @@
[
dict
setObject
:
@
(
tmpTaskId
)
forKey
:
@"tmpTaskId"
];
[
dict
setObject
:
@
(
tmpTaskId
)
forKey
:
@"tmpTaskId"
];
}
}
[
dict
setObject
:
@
(
taskID
)
forKey
:
@"taskId"
];
[
dict
setObject
:
@
(
taskID
)
forKey
:
@"taskId"
];
[
dict
setObject
:
url
forKey
:
@"url"
];
if
(
url
)
{
[
dict
setObject
:
url
forKey
:
@"url"
];
}
[
dict
setObject
:
@
(
error
.
code
)
forKey
:
@"code"
];
[
dict
setObject
:
@
(
error
.
code
)
forKey
:
@"code"
];
if
(
nil
!=
error
.
userInfo
.
description
)
{
if
(
nil
!=
error
.
userInfo
.
description
)
{
[
dict
setObject
:
error
.
userInfo
.
description
forKey
:
@"msg"
];
[
dict
setObject
:
error
.
userInfo
.
description
forKey
:
@"msg"
];
}
}
[
self
onPreloadCallback
:[
TXCommonUtil
getParamsWithEvent
:
EVENT_PREDOWNLOAD_ON_ERROR
withParams
:
dict
]];
[
self
.
downloadFlutterApi
onPreDownloadEventEvent
:[
FTXDownloadManager
getParamsWithEvent
:
EVENT_PREDOWNLOAD_ON_ERROR
withParams
:
dict
]
completion
:^
(
FlutterError
*
_Nullable
error
)
{
}
FTXLOGE
(
@"callback message error:%@"
,
error
);
}];
-
(
void
)
onPreloadCallback
:
(
NSDictionary
<
NSString
*
,
id
>
*
)
arg_event
{
dispatch_async
(
dispatch_get_main_queue
(),
^
{
[
self
.
downloadFlutterApi
onPreDownloadEventEvent
:
arg_event
completion
:
^
(
FlutterError
*
_Nullable
error
)
{
FTXLOGE
(
@"callback message error:%@"
,
error
);
}];
});
}
}
-
(
void
)
removePreDelegate
:
(
TXPredownloadFileHelperDelegate
*
)
delegate
{
-
(
void
)
removePreDelegate
:
(
TXPredownloadFileHelperDelegate
*
)
delegate
{
...
@@ -102,15 +113,6 @@
...
@@ -102,15 +113,6 @@
}
}
}
}
+
(
NSDictionary
*
)
getParamsWithEvent
:
(
int
)
EvtID
withParams
:
(
NSDictionary
*
)
params
{
__block
NSMutableDictionary
<
NSString
*
,
NSObject
*>
*
dict
=
[
NSMutableDictionary
dictionaryWithObject
:
@
(
EvtID
)
forKey
:
@"event"
];
if
(
params
!=
nil
&&
params
.
count
!=
0
)
{
[
dict
addEntriesFromDictionary
:
params
];
}
return
dict
;
}
#pragma mark - TXVodPreloadManager delegate
#pragma mark - TXVodPreloadManager delegate
-
(
void
)
onComplete
:
(
int
)
taskID
url
:
(
NSString
*
)
url
-
(
void
)
onComplete
:
(
int
)
taskID
url
:
(
NSString
*
)
url
...
@@ -118,9 +120,7 @@
...
@@ -118,9 +120,7 @@
__block
NSMutableDictionary
*
dict
=
[
NSMutableDictionary
dictionary
];
__block
NSMutableDictionary
*
dict
=
[
NSMutableDictionary
dictionary
];
[
dict
setObject
:
@
(
taskID
)
forKey
:
@"taskId"
];
[
dict
setObject
:
@
(
taskID
)
forKey
:
@"taskId"
];
[
dict
setObject
:
url
forKey
:
@"url"
];
[
dict
setObject
:
url
forKey
:
@"url"
];
[
self
.
downloadFlutterApi
onPreDownloadEventEvent
:[
FTXDownloadManager
getParamsWithEvent
:
EVENT_PREDOWNLOAD_ON_COMPLETE
withParams
:
dict
]
completion
:^
(
FlutterError
*
_Nullable
error
)
{
[
self
onPreloadCallback
:[
TXCommonUtil
getParamsWithEvent
:
EVENT_PREDOWNLOAD_ON_COMPLETE
withParams
:
dict
]];
FTXLOGE
(
@"callback message error:%@"
,
error
);
}];
}
}
-
(
void
)
onError
:
(
int
)
taskID
url
:
(
NSString
*
)
url
error
:
(
NSError
*
)
error
-
(
void
)
onError
:
(
int
)
taskID
url
:
(
NSString
*
)
url
error
:
(
NSError
*
)
error
...
@@ -214,30 +214,22 @@
...
@@ -214,30 +214,22 @@
/// Download started.
/// Download started.
-
(
void
)
onDownloadStart
:
(
TXVodDownloadMediaInfo
*
)
mediaInfo
{
-
(
void
)
onDownloadStart
:
(
TXVodDownloadMediaInfo
*
)
mediaInfo
{
[
self
.
downloadFlutterApi
onDownloadEventEvent
:[
FTXDownloadManager
getParamsWithEvent
:
EVENT_DOWNLOAD_START
withParams
:[
self
buildMapFromDownloadMediaInfo
:
mediaInfo
]]
completion
:^
(
FlutterError
*
_Nullable
error
)
{
[
self
onDownloadCallback
:[
TXCommonUtil
getParamsWithEvent
:
EVENT_DOWNLOAD_START
withParams
:[
self
buildMapFromDownloadMediaInfo
:
mediaInfo
]]];
FTXLOGE
(
@"callback message error:%@"
,
error
);
}];
}
}
/// Download progress.
/// Download progress.
-
(
void
)
onDownloadProgress
:
(
TXVodDownloadMediaInfo
*
)
mediaInfo
{
-
(
void
)
onDownloadProgress
:
(
TXVodDownloadMediaInfo
*
)
mediaInfo
{
[
self
.
downloadFlutterApi
onDownloadEventEvent
:[
FTXDownloadManager
getParamsWithEvent
:
EVENT_DOWNLOAD_PROGRESS
withParams
:[
self
buildMapFromDownloadMediaInfo
:
mediaInfo
]]
completion
:^
(
FlutterError
*
_Nullable
error
)
{
[
self
onDownloadCallback
:[
TXCommonUtil
getParamsWithEvent
:
EVENT_DOWNLOAD_PROGRESS
withParams
:[
self
buildMapFromDownloadMediaInfo
:
mediaInfo
]]];
FTXLOGE
(
@"callback message error:%@"
,
error
);
}];
}
}
/// Download stopped.
/// Download stopped.
-
(
void
)
onDownloadStop
:
(
TXVodDownloadMediaInfo
*
)
mediaInfo
{
-
(
void
)
onDownloadStop
:
(
TXVodDownloadMediaInfo
*
)
mediaInfo
{
[
self
.
downloadFlutterApi
onDownloadEventEvent
:[
FTXDownloadManager
getParamsWithEvent
:
EVENT_DOWNLOAD_STOP
withParams
:[
self
buildMapFromDownloadMediaInfo
:
mediaInfo
]]
completion
:^
(
FlutterError
*
_Nullable
error
)
{
[
self
onDownloadCallback
:[
TXCommonUtil
getParamsWithEvent
:
EVENT_DOWNLOAD_STOP
withParams
:[
self
buildMapFromDownloadMediaInfo
:
mediaInfo
]]];
FTXLOGE
(
@"callback message error:%@"
,
error
);
}];
}
}
/// Download completed.
/// Download completed.
-
(
void
)
onDownloadFinish
:
(
TXVodDownloadMediaInfo
*
)
mediaInfo
{
-
(
void
)
onDownloadFinish
:
(
TXVodDownloadMediaInfo
*
)
mediaInfo
{
[
self
.
downloadFlutterApi
onDownloadEventEvent
:[
FTXDownloadManager
getParamsWithEvent
:
EVENT_DOWNLOAD_FINISH
withParams
:[
self
buildMapFromDownloadMediaInfo
:
mediaInfo
]]
completion
:^
(
FlutterError
*
_Nullable
error
)
{
[
self
onDownloadCallback
:[
TXCommonUtil
getParamsWithEvent
:
EVENT_DOWNLOAD_FINISH
withParams
:[
self
buildMapFromDownloadMediaInfo
:
mediaInfo
]]];
FTXLOGE
(
@"callback message error:%@"
,
error
);
}];
}
}
/// Download error.
/// Download error.
...
@@ -245,9 +237,7 @@
...
@@ -245,9 +237,7 @@
NSMutableDictionary
*
dict
=
[
self
buildMapFromDownloadMediaInfo
:
mediaInfo
];
NSMutableDictionary
*
dict
=
[
self
buildMapFromDownloadMediaInfo
:
mediaInfo
];
[
dict
setValue
:
@
(
code
)
forKey
:
@"errorCode"
];
[
dict
setValue
:
@
(
code
)
forKey
:
@"errorCode"
];
[
dict
setValue
:
msg
forKey
:
@"errorMsg"
];
[
dict
setValue
:
msg
forKey
:
@"errorMsg"
];
[
self
.
downloadFlutterApi
onDownloadEventEvent
:[
FTXDownloadManager
getParamsWithEvent
:
EVENT_DOWNLOAD_ERROR
withParams
:
dict
]
completion
:^
(
FlutterError
*
_Nullable
error
)
{
[
self
onDownloadCallback
:[
TXCommonUtil
getParamsWithEvent
:
EVENT_DOWNLOAD_ERROR
withParams
:
dict
]];
FTXLOGE
(
@"callback message error:%@"
,
error
);
}];
}
}
/**
/**
...
@@ -266,6 +256,12 @@
...
@@ -266,6 +256,12 @@
return
0
;
return
0
;
}
}
-
(
void
)
onDownloadCallback
:
(
NSDictionary
<
NSString
*
,
id
>
*
)
arg_event
{
[
self
.
downloadFlutterApi
onDownloadEventEvent
:
arg_event
completion
:
^
(
FlutterError
*
_Nullable
error
)
{
FTXLOGE
(
@"callback message error:%@"
,
error
);
}];
}
#pragma mark TXFlutterDownloadApi
#pragma mark TXFlutterDownloadApi
-
(
nullable
BoolMsg
*
)
deleteDownloadMediaInfoMsg
:
(
nonnull
TXVodDownloadMediaMsg
*
)
msg
error
:
(
FlutterError
*
_Nullable
__autoreleasing
*
_Nonnull
)
error
{
-
(
nullable
BoolMsg
*
)
deleteDownloadMediaInfoMsg
:
(
nonnull
TXVodDownloadMediaMsg
*
)
msg
error
:
(
FlutterError
*
_Nullable
__autoreleasing
*
_Nonnull
)
error
{
...
@@ -359,6 +355,7 @@
...
@@ -359,6 +355,7 @@
params
.
appId
=
(
msg
.
appId
!=
nil
&&
[
msg
.
appId
isKindOfClass
:[
NSNumber
class
]])
?
[
msg
.
appId
intValue
]
:
0
;
params
.
appId
=
(
msg
.
appId
!=
nil
&&
[
msg
.
appId
isKindOfClass
:[
NSNumber
class
]])
?
[
msg
.
appId
intValue
]
:
0
;
params
.
fileId
=
fileId
;
params
.
fileId
=
fileId
;
params
.
sign
=
(
msg
.
pSign
!=
nil
&&
[
msg
.
pSign
isKindOfClass
:[
NSString
class
]])
?
msg
.
pSign
:
@""
;
params
.
sign
=
(
msg
.
pSign
!=
nil
&&
[
msg
.
pSign
isKindOfClass
:[
NSString
class
]])
?
msg
.
pSign
:
@""
;
params
.
headers
=
msg
.
httpHeader
!=
nil
?
msg
.
httpHeader
:
@{};
__block
TXPredownloadFileHelperDelegate
*
delegate
=
[[
TXPredownloadFileHelperDelegate
alloc
]
initWithBlock
:
tmpTaskId
start
:
^
(
long
tmpTaskId
,
int
taskID
,
NSString
*
_Nonnull
fileId
,
NSString
*
_Nonnull
url
,
NSDictionary
*
_Nonnull
param
)
{
__block
TXPredownloadFileHelperDelegate
*
delegate
=
[[
TXPredownloadFileHelperDelegate
alloc
]
initWithBlock
:
tmpTaskId
start
:
^
(
long
tmpTaskId
,
int
taskID
,
NSString
*
_Nonnull
fileId
,
NSString
*
_Nonnull
url
,
NSDictionary
*
_Nonnull
param
)
{
[
self
onPreLoadStartEvent
:
tmpTaskId
taskID
:
taskID
fileId
:
fileId
url
:
url
param
:
param
];
[
self
onPreLoadStartEvent
:
tmpTaskId
taskID
:
taskID
fileId
:
fileId
url
:
url
param
:
param
];
}
complete
:^
(
int
taskID
,
NSString
*
_Nonnull
url
)
{
}
complete
:^
(
int
taskID
,
NSString
*
_Nonnull
url
)
{
...
...
Flutter/ios/Classes/FTXLivePlayer.m
浏览文件 @
0ff875e6
...
@@ -374,18 +374,14 @@ static const int uninitialized = -1;
...
@@ -374,18 +374,14 @@ static const int uninitialized = -1;
}
}
}
}
+
(
NSDictionary
*
)
getParamsWithEvent
:
(
int
)
evtID
withParams
:
(
NSDictionary
*
)
params
-
(
NSDictionary
*
)
getLiveParamsWithEvent
:
(
int
)
evtID
withParams
:
(
NSDictionary
*
)
params
{
{
NSMutableDictionary
<
NSString
*
,
NSObject
*>
*
dict
=
[
TXCommonUtil
getParamsWithEvent
:
evtID
withParams
:
params
];
NSMutableDictionary
<
NSString
*
,
NSObject
*>
*
dict
=
[
NSMutableDictionary
dictionaryWithObject
:
@
(
evtID
)
forKey
:
EVT_KEY_PLAYER_EVENT
];
if
(
params
!=
nil
&&
params
.
count
!=
0
)
{
[
dict
addEntriesFromDictionary
:
params
];
}
long
long
timestamp
=
[
self
currentMillisecondTime
];
long
long
timestamp
=
[
self
currentMillisecondTime
];
[
dict
setObject
:
@
(
timestamp
)
forKey
:
EVT_TIME
];
[
dict
setObject
:
@
(
timestamp
)
forKey
:
EVT_TIME
];
return
dict
;
return
dict
;
}
}
+
(
long
long
)
currentMillisecondTime
{
-
(
long
long
)
currentMillisecondTime
{
NSDate
*
now
=
[
NSDate
date
];
// 获取当前日期时间
NSDate
*
now
=
[
NSDate
date
];
// 获取当前日期时间
NSTimeInterval
timeInterval
=
[
now
timeIntervalSince1970
];
// 获取距离1970年的秒数
NSTimeInterval
timeInterval
=
[
now
timeIntervalSince1970
];
// 获取距离1970年的秒数
long
long
millisecondTime
=
(
long
long
)(
timeInterval
*
1000
);
// 将秒数转换为毫秒数
long
long
millisecondTime
=
(
long
long
)(
timeInterval
*
1000
);
// 将秒数转换为毫秒数
...
@@ -394,7 +390,7 @@ static const int uninitialized = -1;
...
@@ -394,7 +390,7 @@ static const int uninitialized = -1;
-
(
void
)
notifyPlayerEvent
:
(
int
)
evtID
withParams
:
(
NSDictionary
*
)
params
{
-
(
void
)
notifyPlayerEvent
:
(
int
)
evtID
withParams
:
(
NSDictionary
*
)
params
{
self
.
lastPlayEvent
=
evtID
;
self
.
lastPlayEvent
=
evtID
;
[
self
.
liveFlutterApi
onPlayerEventEvent
:[
FTXLivePlayer
get
ParamsWithEvent
:
evtID
withParams
:
params
]
completion
:^
(
FlutterError
*
_Nullable
error
)
{
[
self
.
liveFlutterApi
onPlayerEventEvent
:[
self
getLive
ParamsWithEvent
:
evtID
withParams
:
params
]
completion
:^
(
FlutterError
*
_Nullable
error
)
{
FTXLOGE
(
@"callback message error:%@"
,
error
);
FTXLOGE
(
@"callback message error:%@"
,
error
);
}];
}];
FTXLOGI
(
@"onLivePlayEvent:%i,%@"
,
evtID
,
params
[
EVT_MSG
])
FTXLOGI
(
@"onLivePlayEvent:%i,%@"
,
evtID
,
params
[
EVT_MSG
])
...
...
Flutter/ios/Classes/FTXTransformation.m
浏览文件 @
0ff875e6
...
@@ -21,6 +21,7 @@
...
@@ -21,6 +21,7 @@
config
.
enableRenderProcess
=
msg
.
enableRenderProcess
.
boolValue
;
config
.
enableRenderProcess
=
msg
.
enableRenderProcess
.
boolValue
;
config
.
preferredResolution
=
msg
.
preferredResolution
.
longValue
;
config
.
preferredResolution
=
msg
.
preferredResolution
.
longValue
;
config
.
mediaType
=
msg
.
mediaType
.
intValue
;
config
.
mediaType
=
msg
.
mediaType
.
intValue
;
config
.
encryptedMp4Level
=
msg
.
encryptedMp4Level
.
intValue
;
NSTimeInterval
progressInerval
=
msg
.
progressInterval
.
intValue
/
1000
.
0
;
NSTimeInterval
progressInerval
=
msg
.
progressInterval
.
intValue
/
1000
.
0
;
if
(
progressInerval
>
0
)
{
if
(
progressInerval
>
0
)
{
config
.
progressInterval
=
progressInerval
;
config
.
progressInterval
=
progressInerval
;
...
...
Flutter/ios/Classes/FTXVodPlayer.m
浏览文件 @
0ff875e6
...
@@ -383,16 +383,6 @@ static const int CODE_ON_RECEIVE_FIRST_FRAME = 2003;
...
@@ -383,16 +383,6 @@ static const int CODE_ON_RECEIVE_FIRST_FRAME = 2003;
return
nil
;
return
nil
;
}
}
+
(
NSDictionary
*
)
getParamsWithEvent
:
(
int
)
EvtID
withParams
:
(
NSDictionary
*
)
params
{
NSMutableDictionary
<
NSString
*
,
NSObject
*>
*
dict
=
[
NSMutableDictionary
dictionaryWithObject
:
@
(
EvtID
)
forKey
:
@"event"
];
if
(
params
!=
nil
&&
params
.
count
!=
0
)
{
[
dict
addEntriesFromDictionary
:
params
];
}
return
dict
;
}
#pragma mark - FlutterTexture
#pragma mark - FlutterTexture
-
(
CVPixelBufferRef
_Nullable
)
copyPixelBuffer
-
(
CVPixelBufferRef
_Nullable
)
copyPixelBuffer
...
@@ -440,7 +430,7 @@ static const int CODE_ON_RECEIVE_FIRST_FRAME = 2003;
...
@@ -440,7 +430,7 @@ static const int CODE_ON_RECEIVE_FIRST_FRAME = 2003;
if
(
evtID
!=
PLAY_EVT_PLAY_PROGRESS
)
{
if
(
evtID
!=
PLAY_EVT_PLAY_PROGRESS
)
{
FTXLOGI
(
@"onPlayEvent:%i,%@"
,
evtID
,
param
[
EVT_PLAY_DESCRIPTION
]);
FTXLOGI
(
@"onPlayEvent:%i,%@"
,
evtID
,
param
[
EVT_PLAY_DESCRIPTION
]);
}
}
[
self
.
vodFlutterApi
onPlayerEventEvent
:[
FTXVodPlayer
getParamsWithEvent
:
evtID
withParams
:
param
]
completion
:^
(
FlutterError
*
_Nullable
error
)
{
[
self
.
vodFlutterApi
onPlayerEventEvent
:[
TXCommonUtil
getParamsWithEvent
:
evtID
withParams
:
param
]
completion
:^
(
FlutterError
*
_Nullable
error
)
{
FTXLOGE
(
@"callback message error:%@"
,
error
);
FTXLOGE
(
@"callback message error:%@"
,
error
);
}];
}];
}
}
...
@@ -472,7 +462,7 @@ static const int CODE_ON_RECEIVE_FIRST_FRAME = 2003;
...
@@ -472,7 +462,7 @@ static const int CODE_ON_RECEIVE_FIRST_FRAME = 2003;
mutableDic
[
EXTRA_SUBTITLE_START_POSITION_MS
]
=
@
(
subtitleData
.
startPositionMs
);
mutableDic
[
EXTRA_SUBTITLE_START_POSITION_MS
]
=
@
(
subtitleData
.
startPositionMs
);
mutableDic
[
EXTRA_SUBTITLE_DURATION_MS
]
=
@
(
subtitleData
.
durationMs
);
mutableDic
[
EXTRA_SUBTITLE_DURATION_MS
]
=
@
(
subtitleData
.
durationMs
);
mutableDic
[
EXTRA_SUBTITLE_TRACK_INDEX
]
=
@
(
subtitleData
.
trackIndex
);
mutableDic
[
EXTRA_SUBTITLE_TRACK_INDEX
]
=
@
(
subtitleData
.
trackIndex
);
[
self
.
vodFlutterApi
onPlayerEventEvent
:[
FTXVodPlayer
getParamsWithEvent
:
EVENT_SUBTITLE_DATA
withParams
:
mutableDic
]
completion
:^
(
FlutterError
*
_Nullable
error
)
{
[
self
.
vodFlutterApi
onPlayerEventEvent
:[
TXCommonUtil
getParamsWithEvent
:
EVENT_SUBTITLE_DATA
withParams
:
mutableDic
]
completion
:^
(
FlutterError
*
_Nullable
error
)
{
FTXLOGE
(
@"callback message error:%@"
,
error
);
FTXLOGE
(
@"callback message error:%@"
,
error
);
}];
}];
}
}
...
@@ -1055,9 +1045,19 @@ static const int CODE_ON_RECEIVE_FIRST_FRAME = 2003;
...
@@ -1055,9 +1045,19 @@ static const int CODE_ON_RECEIVE_FIRST_FRAME = 2003;
if
(
nil
!=
_txVodPlayer
)
{
if
(
nil
!=
_txVodPlayer
)
{
if
(
playerMsg
.
value
&&
[
playerMsg
.
value
count
]
!=
0
)
{
if
(
playerMsg
.
value
&&
[
playerMsg
.
value
count
]
!=
0
)
{
id
value
=
playerMsg
.
value
[
0
];
id
value
=
playerMsg
.
value
[
0
];
[
_txVodPlayer
setExtentOptionInfo
:@{
NSString
*
key
=
playerMsg
.
key
;
playerMsg
.
key
:
value
// HEVC 降级播放参数进行特殊判断,保证 flutter 层接口一致
}];
if
([
key
isEqualToString
:
VOD_KEY_VIDEO_CODEC_TYPE
]
&&
[
value
isKindOfClass
:[
NSString
class
]])
{
if
([(
NSString
*
)
value
isEqualToString
:
@"video/hevc"
])
{
[
_txVodPlayer
setExtentOptionInfo
:@{
VOD_KEY_VIDEO_CODEC_TYPE
:
@
(
kCMVideoCodecType_HEVC
)
}];
}
}
else
{
[
_txVodPlayer
setExtentOptionInfo
:@{
key
:
value
}];
}
}
}
}
}
}
}
...
...
Flutter/ios/Classes/SuperPlayerPlugin.m
浏览文件 @
0ff875e6
...
@@ -78,20 +78,11 @@ SuperPlayerPlugin* instance;
...
@@ -78,20 +78,11 @@ SuperPlayerPlugin* instance;
-
(
void
)
observeValueForKeyPath
:(
NSString
*
)
keyPath
ofObject
:(
id
)
object
change
:(
NSDictionary
<
NSKeyValueChangeKey
,
id
>
*
)
change
context
:(
void
*
)
context
-
(
void
)
observeValueForKeyPath
:(
NSString
*
)
keyPath
ofObject
:(
id
)
object
change
:(
NSDictionary
<
NSKeyValueChangeKey
,
id
>
*
)
change
context
:(
void
*
)
context
{
{
[
self
.
pluginFlutterApi
onNativeEventEvent
:[
SuperPlayerPlugin
getParamsWithEvent
:
EVENT_VOLUME_CHANGED
withParams
:@{}]
completion
:^
(
FlutterError
*
_Nullable
error
)
{
[
self
.
pluginFlutterApi
onNativeEventEvent
:[
TXCommonUtil
getParamsWithEvent
:
EVENT_VOLUME_CHANGED
withParams
:@{}]
completion
:^
(
FlutterError
*
_Nullable
error
)
{
FTXLOGE
(
@"callback message error:%@"
,
error
);
FTXLOGE
(
@"callback message error:%@"
,
error
);
}];
}];
}
}
+
(
NSDictionary
*
)
getParamsWithEvent
:(
int
)
EvtID
withParams
:(
NSDictionary
*
)
params
{
NSMutableDictionary
<
NSString
*
,
NSObject
*>
*
dict
=
[
NSMutableDictionary
dictionaryWithObject
:
@
(
EvtID
)
forKey
:
@"event"
];
if
(
params
!=
nil
&&
params
.
count
!=
0
)
{
[
dict
addEntriesFromDictionary
:
params
];
}
return
dict
;
}
-
(
void
)
destory
-
(
void
)
destory
{
{
[
self
.
audioManager
destory
:
self
];
[
self
.
audioManager
destory
:
self
];
...
@@ -134,7 +125,7 @@ SuperPlayerPlugin* instance;
...
@@ -134,7 +125,7 @@ SuperPlayerPlugin* instance;
*/
*/
-
(
void
)
brightnessDidChange
:
(
NSNotification
*
)
notification
-
(
void
)
brightnessDidChange
:
(
NSNotification
*
)
notification
{
{
[
self
.
pluginFlutterApi
onNativeEventEvent
:[
SuperPlayerPlugin
getParamsWithEvent
:
EVENT_BRIGHTNESS_CHANGED
withParams
:@{}]
completion
:^
(
FlutterError
*
_Nullable
error
)
{
[
self
.
pluginFlutterApi
onNativeEventEvent
:[
TXCommonUtil
getParamsWithEvent
:
EVENT_BRIGHTNESS_CHANGED
withParams
:@{}]
completion
:^
(
FlutterError
*
_Nullable
error
)
{
FTXLOGE
(
@"callback message error:%@"
,
error
);
FTXLOGE
(
@"callback message error:%@"
,
error
);
}];
}];
}
}
...
@@ -155,6 +146,8 @@ SuperPlayerPlugin* instance;
...
@@ -155,6 +146,8 @@ SuperPlayerPlugin* instance;
}
}
#pragma mark - FTXVodPlayerDelegate
#pragma mark - FTXVodPlayerDelegate
-
(
void
)
onPlayerPipRequestStart
{
-
(
void
)
onPlayerPipRequestStart
{
...
@@ -417,7 +410,7 @@ SuperPlayerPlugin* instance;
...
@@ -417,7 +410,7 @@ SuperPlayerPlugin* instance;
@
(
EVENT_RESULT
)
:
@
(
blockResult
),
@
(
EVENT_RESULT
)
:
@
(
blockResult
),
@
(
EVENT_REASON
)
:
blockReason
,
@
(
EVENT_REASON
)
:
blockReason
,
};
};
[
self
.
pluginFlutterApi
onSDKListenerEvent
:[
SuperPlayerPlugin
getParamsWithEvent
:
EVENT_ON_LICENCE_LOADED
withParams
:
param
]
completion
:^
(
FlutterError
*
_Nullable
error
)
{
[
self
.
pluginFlutterApi
onSDKListenerEvent
:[
TXCommonUtil
getParamsWithEvent
:
EVENT_ON_LICENCE_LOADED
withParams
:
param
]
completion
:^
(
FlutterError
*
_Nullable
error
)
{
FTXLOGE
(
@"callback message error:%@"
,
error
);
FTXLOGE
(
@"callback message error:%@"
,
error
);
}];
}];
}
}
...
...
Flutter/ios/Classes/messages/FtxMessages.h
浏览文件 @
0ff875e6
// Copyright (c) 2022 Tencent. All rights reserved.
// Copyright (c) 2022 Tencent. All rights reserved.
// Autogenerated from Pigeon (v22.6.
0
), do not edit directly.
// Autogenerated from Pigeon (v22.6.
1
), do not edit directly.
// See also: https://pub.dev/packages/pigeon
// See also: https://pub.dev/packages/pigeon
#import <Foundation/Foundation.h>
#import <Foundation/Foundation.h>
...
@@ -164,7 +164,8 @@ NS_ASSUME_NONNULL_BEGIN
...
@@ -164,7 +164,8 @@ NS_ASSUME_NONNULL_BEGIN
extInfoMap
:(
nullable
NSDictionary
<
NSString
*
,
id
>
*
)
extInfoMap
extInfoMap
:(
nullable
NSDictionary
<
NSString
*
,
id
>
*
)
extInfoMap
enableRenderProcess
:(
nullable
NSNumber
*
)
enableRenderProcess
enableRenderProcess
:(
nullable
NSNumber
*
)
enableRenderProcess
preferredResolution
:(
nullable
NSNumber
*
)
preferredResolution
preferredResolution
:(
nullable
NSNumber
*
)
preferredResolution
mediaType
:(
nullable
NSNumber
*
)
mediaType
;
mediaType
:(
nullable
NSNumber
*
)
mediaType
encryptedMp4Level
:(
nullable
NSNumber
*
)
encryptedMp4Level
;
@property
(
nonatomic
,
strong
,
nullable
)
NSNumber
*
playerId
;
@property
(
nonatomic
,
strong
,
nullable
)
NSNumber
*
playerId
;
@property
(
nonatomic
,
strong
,
nullable
)
NSNumber
*
connectRetryCount
;
@property
(
nonatomic
,
strong
,
nullable
)
NSNumber
*
connectRetryCount
;
@property
(
nonatomic
,
strong
,
nullable
)
NSNumber
*
connectRetryInterval
;
@property
(
nonatomic
,
strong
,
nullable
)
NSNumber
*
connectRetryInterval
;
...
@@ -188,6 +189,8 @@ NS_ASSUME_NONNULL_BEGIN
...
@@ -188,6 +189,8 @@ NS_ASSUME_NONNULL_BEGIN
/// Media asset type, default auto type, refer to value see[TXVodPlayEvent]
/// Media asset type, default auto type, refer to value see[TXVodPlayEvent]
/// 媒资类型,默认auto类型, 取值参考 see[TXVodPlayEvent]
/// 媒资类型,默认auto类型, 取值参考 see[TXVodPlayEvent]
@property
(
nonatomic
,
strong
,
nullable
)
NSNumber
*
mediaType
;
@property
(
nonatomic
,
strong
,
nullable
)
NSNumber
*
mediaType
;
/// MP4 encryption playback: Supported since version 12.2.
@property
(
nonatomic
,
strong
,
nullable
)
NSNumber
*
encryptedMp4Level
;
@end
@end
@interface
FTXLivePlayConfigPlayerMsg
:
NSObject
@interface
FTXLivePlayConfigPlayerMsg
:
NSObject
...
@@ -329,7 +332,8 @@ NS_ASSUME_NONNULL_BEGIN
...
@@ -329,7 +332,8 @@ NS_ASSUME_NONNULL_BEGIN
playUrl
:(
nullable
NSString
*
)
playUrl
playUrl
:(
nullable
NSString
*
)
playUrl
preloadSizeMB
:(
nullable
NSNumber
*
)
preloadSizeMB
preloadSizeMB
:(
nullable
NSNumber
*
)
preloadSizeMB
preferredResolution
:(
nullable
NSNumber
*
)
preferredResolution
preferredResolution
:(
nullable
NSNumber
*
)
preferredResolution
tmpPreloadTaskId
:(
nullable
NSNumber
*
)
tmpPreloadTaskId
;
tmpPreloadTaskId
:(
nullable
NSNumber
*
)
tmpPreloadTaskId
httpHeader
:(
nullable
NSDictionary
<
NSString
*
,
NSString
*>
*
)
httpHeader
;
@property
(
nonatomic
,
strong
,
nullable
)
NSNumber
*
appId
;
@property
(
nonatomic
,
strong
,
nullable
)
NSNumber
*
appId
;
@property
(
nonatomic
,
copy
,
nullable
)
NSString
*
fileId
;
@property
(
nonatomic
,
copy
,
nullable
)
NSString
*
fileId
;
@property
(
nonatomic
,
copy
,
nullable
)
NSString
*
pSign
;
@property
(
nonatomic
,
copy
,
nullable
)
NSString
*
pSign
;
...
@@ -337,6 +341,7 @@ NS_ASSUME_NONNULL_BEGIN
...
@@ -337,6 +341,7 @@ NS_ASSUME_NONNULL_BEGIN
@property
(
nonatomic
,
strong
,
nullable
)
NSNumber
*
preloadSizeMB
;
@property
(
nonatomic
,
strong
,
nullable
)
NSNumber
*
preloadSizeMB
;
@property
(
nonatomic
,
strong
,
nullable
)
NSNumber
*
preferredResolution
;
@property
(
nonatomic
,
strong
,
nullable
)
NSNumber
*
preferredResolution
;
@property
(
nonatomic
,
strong
,
nullable
)
NSNumber
*
tmpPreloadTaskId
;
@property
(
nonatomic
,
strong
,
nullable
)
NSNumber
*
tmpPreloadTaskId
;
@property
(
nonatomic
,
copy
,
nullable
)
NSDictionary
<
NSString
*
,
NSString
*>
*
httpHeader
;
@end
@end
@interface
MapMsg
:
NSObject
@interface
MapMsg
:
NSObject
...
...
Flutter/ios/Classes/messages/FtxMessages.m
浏览文件 @
0ff875e6
// Copyright (c) 2022 Tencent. All rights reserved.
// Copyright (c) 2022 Tencent. All rights reserved.
// Autogenerated from Pigeon (v22.6.
0
), do not edit directly.
// Autogenerated from Pigeon (v22.6.
1
), do not edit directly.
// See also: https://pub.dev/packages/pigeon
// See also: https://pub.dev/packages/pigeon
#import "FtxMessages.h"
#import "FtxMessages.h"
...
@@ -532,7 +532,8 @@ static id GetNullableObjectAtIndex(NSArray<id> *array, NSInteger key) {
...
@@ -532,7 +532,8 @@ static id GetNullableObjectAtIndex(NSArray<id> *array, NSInteger key) {
extInfoMap
:(
nullable
NSDictionary
<
NSString
*
,
id
>
*
)
extInfoMap
extInfoMap
:(
nullable
NSDictionary
<
NSString
*
,
id
>
*
)
extInfoMap
enableRenderProcess
:(
nullable
NSNumber
*
)
enableRenderProcess
enableRenderProcess
:(
nullable
NSNumber
*
)
enableRenderProcess
preferredResolution
:(
nullable
NSNumber
*
)
preferredResolution
preferredResolution
:(
nullable
NSNumber
*
)
preferredResolution
mediaType
:(
nullable
NSNumber
*
)
mediaType
{
mediaType
:(
nullable
NSNumber
*
)
mediaType
encryptedMp4Level
:(
nullable
NSNumber
*
)
encryptedMp4Level
{
FTXVodPlayConfigPlayerMsg
*
pigeonResult
=
[[
FTXVodPlayConfigPlayerMsg
alloc
]
init
];
FTXVodPlayConfigPlayerMsg
*
pigeonResult
=
[[
FTXVodPlayConfigPlayerMsg
alloc
]
init
];
pigeonResult
.
playerId
=
playerId
;
pigeonResult
.
playerId
=
playerId
;
pigeonResult
.
connectRetryCount
=
connectRetryCount
;
pigeonResult
.
connectRetryCount
=
connectRetryCount
;
...
@@ -555,6 +556,7 @@ static id GetNullableObjectAtIndex(NSArray<id> *array, NSInteger key) {
...
@@ -555,6 +556,7 @@ static id GetNullableObjectAtIndex(NSArray<id> *array, NSInteger key) {
pigeonResult
.
enableRenderProcess
=
enableRenderProcess
;
pigeonResult
.
enableRenderProcess
=
enableRenderProcess
;
pigeonResult
.
preferredResolution
=
preferredResolution
;
pigeonResult
.
preferredResolution
=
preferredResolution
;
pigeonResult
.
mediaType
=
mediaType
;
pigeonResult
.
mediaType
=
mediaType
;
pigeonResult
.
encryptedMp4Level
=
encryptedMp4Level
;
return
pigeonResult
;
return
pigeonResult
;
}
}
+
(
FTXVodPlayConfigPlayerMsg
*
)
fromList
:(
NSArray
<
id
>
*
)
list
{
+
(
FTXVodPlayConfigPlayerMsg
*
)
fromList
:(
NSArray
<
id
>
*
)
list
{
...
@@ -580,6 +582,7 @@ static id GetNullableObjectAtIndex(NSArray<id> *array, NSInteger key) {
...
@@ -580,6 +582,7 @@ static id GetNullableObjectAtIndex(NSArray<id> *array, NSInteger key) {
pigeonResult
.
enableRenderProcess
=
GetNullableObjectAtIndex
(
list
,
18
);
pigeonResult
.
enableRenderProcess
=
GetNullableObjectAtIndex
(
list
,
18
);
pigeonResult
.
preferredResolution
=
GetNullableObjectAtIndex
(
list
,
19
);
pigeonResult
.
preferredResolution
=
GetNullableObjectAtIndex
(
list
,
19
);
pigeonResult
.
mediaType
=
GetNullableObjectAtIndex
(
list
,
20
);
pigeonResult
.
mediaType
=
GetNullableObjectAtIndex
(
list
,
20
);
pigeonResult
.
encryptedMp4Level
=
GetNullableObjectAtIndex
(
list
,
21
);
return
pigeonResult
;
return
pigeonResult
;
}
}
+
(
nullable
FTXVodPlayConfigPlayerMsg
*
)
nullableFromList
:(
NSArray
<
id
>
*
)
list
{
+
(
nullable
FTXVodPlayConfigPlayerMsg
*
)
nullableFromList
:(
NSArray
<
id
>
*
)
list
{
...
@@ -608,6 +611,7 @@ static id GetNullableObjectAtIndex(NSArray<id> *array, NSInteger key) {
...
@@ -608,6 +611,7 @@ static id GetNullableObjectAtIndex(NSArray<id> *array, NSInteger key) {
self
.
enableRenderProcess
?:
[
NSNull
null
],
self
.
enableRenderProcess
?:
[
NSNull
null
],
self
.
preferredResolution
?:
[
NSNull
null
],
self
.
preferredResolution
?:
[
NSNull
null
],
self
.
mediaType
?:
[
NSNull
null
],
self
.
mediaType
?:
[
NSNull
null
],
self
.
encryptedMp4Level
?:
[
NSNull
null
],
];
];
}
}
@end
@end
...
@@ -966,7 +970,8 @@ static id GetNullableObjectAtIndex(NSArray<id> *array, NSInteger key) {
...
@@ -966,7 +970,8 @@ static id GetNullableObjectAtIndex(NSArray<id> *array, NSInteger key) {
playUrl
:(
nullable
NSString
*
)
playUrl
playUrl
:(
nullable
NSString
*
)
playUrl
preloadSizeMB
:(
nullable
NSNumber
*
)
preloadSizeMB
preloadSizeMB
:(
nullable
NSNumber
*
)
preloadSizeMB
preferredResolution
:(
nullable
NSNumber
*
)
preferredResolution
preferredResolution
:(
nullable
NSNumber
*
)
preferredResolution
tmpPreloadTaskId
:(
nullable
NSNumber
*
)
tmpPreloadTaskId
{
tmpPreloadTaskId
:(
nullable
NSNumber
*
)
tmpPreloadTaskId
httpHeader
:(
nullable
NSDictionary
<
NSString
*
,
NSString
*>
*
)
httpHeader
{
PreLoadInfoMsg
*
pigeonResult
=
[[
PreLoadInfoMsg
alloc
]
init
];
PreLoadInfoMsg
*
pigeonResult
=
[[
PreLoadInfoMsg
alloc
]
init
];
pigeonResult
.
appId
=
appId
;
pigeonResult
.
appId
=
appId
;
pigeonResult
.
fileId
=
fileId
;
pigeonResult
.
fileId
=
fileId
;
...
@@ -975,6 +980,7 @@ static id GetNullableObjectAtIndex(NSArray<id> *array, NSInteger key) {
...
@@ -975,6 +980,7 @@ static id GetNullableObjectAtIndex(NSArray<id> *array, NSInteger key) {
pigeonResult
.
preloadSizeMB
=
preloadSizeMB
;
pigeonResult
.
preloadSizeMB
=
preloadSizeMB
;
pigeonResult
.
preferredResolution
=
preferredResolution
;
pigeonResult
.
preferredResolution
=
preferredResolution
;
pigeonResult
.
tmpPreloadTaskId
=
tmpPreloadTaskId
;
pigeonResult
.
tmpPreloadTaskId
=
tmpPreloadTaskId
;
pigeonResult
.
httpHeader
=
httpHeader
;
return
pigeonResult
;
return
pigeonResult
;
}
}
+
(
PreLoadInfoMsg
*
)
fromList
:(
NSArray
<
id
>
*
)
list
{
+
(
PreLoadInfoMsg
*
)
fromList
:(
NSArray
<
id
>
*
)
list
{
...
@@ -986,6 +992,7 @@ static id GetNullableObjectAtIndex(NSArray<id> *array, NSInteger key) {
...
@@ -986,6 +992,7 @@ static id GetNullableObjectAtIndex(NSArray<id> *array, NSInteger key) {
pigeonResult
.
preloadSizeMB
=
GetNullableObjectAtIndex
(
list
,
4
);
pigeonResult
.
preloadSizeMB
=
GetNullableObjectAtIndex
(
list
,
4
);
pigeonResult
.
preferredResolution
=
GetNullableObjectAtIndex
(
list
,
5
);
pigeonResult
.
preferredResolution
=
GetNullableObjectAtIndex
(
list
,
5
);
pigeonResult
.
tmpPreloadTaskId
=
GetNullableObjectAtIndex
(
list
,
6
);
pigeonResult
.
tmpPreloadTaskId
=
GetNullableObjectAtIndex
(
list
,
6
);
pigeonResult
.
httpHeader
=
GetNullableObjectAtIndex
(
list
,
7
);
return
pigeonResult
;
return
pigeonResult
;
}
}
+
(
nullable
PreLoadInfoMsg
*
)
nullableFromList
:(
NSArray
<
id
>
*
)
list
{
+
(
nullable
PreLoadInfoMsg
*
)
nullableFromList
:(
NSArray
<
id
>
*
)
list
{
...
@@ -1000,6 +1007,7 @@ static id GetNullableObjectAtIndex(NSArray<id> *array, NSInteger key) {
...
@@ -1000,6 +1007,7 @@ static id GetNullableObjectAtIndex(NSArray<id> *array, NSInteger key) {
self
.
preloadSizeMB
?:
[
NSNull
null
],
self
.
preloadSizeMB
?:
[
NSNull
null
],
self
.
preferredResolution
?:
[
NSNull
null
],
self
.
preferredResolution
?:
[
NSNull
null
],
self
.
tmpPreloadTaskId
?:
[
NSNull
null
],
self
.
tmpPreloadTaskId
?:
[
NSNull
null
],
self
.
httpHeader
?:
[
NSNull
null
],
];
];
}
}
@end
@end
...
...
Flutter/ios/Classes/tools/TXCommonUtil.h
浏览文件 @
0ff875e6
...
@@ -22,4 +22,6 @@
...
@@ -22,4 +22,6 @@
+
(
ListMsg
*
)
listMsgWith
:(
NSArray
*
)
value
;
+
(
ListMsg
*
)
listMsgWith
:(
NSArray
*
)
value
;
+
(
NSMutableDictionary
*
)
getParamsWithEvent
:(
int
)
EvtID
withParams
:(
NSDictionary
*
)
params
;
@end
@end
Flutter/ios/Classes/tools/TXCommonUtil.m
浏览文件 @
0ff875e6
...
@@ -86,4 +86,20 @@
...
@@ -86,4 +86,20 @@
return
msg
;
return
msg
;
}
}
+
(
NSMutableDictionary
*
)
getParamsWithEvent
:(
int
)
EvtID
withParams
:(
NSDictionary
*
)
params
{
NSMutableDictionary
<
NSString
*
,
NSObject
*>
*
dict
=
[
NSMutableDictionary
dictionaryWithObject
:
@
(
EvtID
)
forKey
:
EVT_KEY_PLAYER_EVENT
];
if
(
params
!=
nil
&&
params
.
count
!=
0
)
{
// Iterate over each key-value pair in the original dictionary
[
params
enumerateKeysAndObjectsUsingBlock
:
^
(
id
key
,
id
value
,
BOOL
*
stop
)
{
// Check if the value is NSNull
if
(
!
[
value
isKindOfClass
:[
NSNull
class
]]
&&
value
!=
nil
)
{
// If it is not NSNull, then add it to the new dictionary
[
dict
setObject
:
value
forKey
:
key
];
}
}];
}
return
dict
;
}
@end
@end
Flutter/ios/super_player.podspec
浏览文件 @
0ff875e6
...
@@ -4,7 +4,7 @@
...
@@ -4,7 +4,7 @@
#
#
Pod
::
Spec
.
new
do
|
s
|
Pod
::
Spec
.
new
do
|
s
|
s
.
name
=
'super_player'
s
.
name
=
'super_player'
s
.
version
=
'12.
1
.0'
s
.
version
=
'12.
2
.0'
s
.
summary
=
'player plugin.'
s
.
summary
=
'player plugin.'
s
.
description
=
<<-
DESC
s
.
description
=
<<-
DESC
player plugin.
player plugin.
...
@@ -26,7 +26,7 @@ player plugin.
...
@@ -26,7 +26,7 @@ player plugin.
# Player_Premium SDK: s.dependency 'TXLiteAVSDK_Player_Premium'
# Player_Premium SDK: s.dependency 'TXLiteAVSDK_Player_Premium'
# 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_Professional'
,
'12.1.16597
'
s
.
dependency
'
LiteAVSDK_Professional'
,
'12.2.16945
'
# Flutter.framework does not contain a i386 slice.
# Flutter.framework does not contain a i386 slice.
s
.
pod_target_xcconfig
=
{
'DEFINES_MODULE'
=>
'YES'
,
'EXCLUDED_ARCHS[sdk=iphonesimulator*]'
=>
'i386'
}
s
.
pod_target_xcconfig
=
{
'DEFINES_MODULE'
=>
'YES'
,
'EXCLUDED_ARCHS[sdk=iphonesimulator*]'
=>
'i386'
}
...
...
Flutter/lib/Core/common/common_config.dart
浏览文件 @
0ff875e6
...
@@ -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.
1
.0"
;
static
const
String
PLAYER_VERSION
=
"12.
2
.0"
;
}
}
\ No newline at end of file
Flutter/lib/Core/pigeons/txplayer_message.dart
浏览文件 @
0ff875e6
...
@@ -149,6 +149,9 @@ class FTXVodPlayConfigPlayerMsg {
...
@@ -149,6 +149,9 @@ class FTXVodPlayConfigPlayerMsg {
/// Media asset type, default auto type, refer to value see[TXVodPlayEvent]
/// Media asset type, default auto type, refer to value see[TXVodPlayEvent]
/// 媒资类型,默认auto类型, 取值参考 see[TXVodPlayEvent]
/// 媒资类型,默认auto类型, 取值参考 see[TXVodPlayEvent]
int
?
mediaType
;
int
?
mediaType
;
/// MP4 encryption playback: Supported since version 12.2.
int
?
encryptedMp4Level
;
}
}
class
FTXLivePlayConfigPlayerMsg
{
class
FTXLivePlayConfigPlayerMsg
{
...
@@ -293,6 +296,7 @@ class PreLoadInfoMsg {
...
@@ -293,6 +296,7 @@ class PreLoadInfoMsg {
double
?
preloadSizeMB
;
double
?
preloadSizeMB
;
int
?
preferredResolution
;
int
?
preferredResolution
;
int
?
tmpPreloadTaskId
;
int
?
tmpPreloadTaskId
;
Map
<
String
?,
String
?>?
httpHeader
;
}
}
class
MapMsg
{
class
MapMsg
{
...
...
Flutter/lib/Core/txplayer_define.dart
浏览文件 @
0ff875e6
...
@@ -435,6 +435,25 @@ abstract class TXVodPlayEvent {
...
@@ -435,6 +435,25 @@ abstract class TXVodPlayEvent {
static
const
EXTRA_SUBTITLE_START_POSITION_MS
=
"startPositionMs"
;
static
const
EXTRA_SUBTITLE_START_POSITION_MS
=
"startPositionMs"
;
static
const
EXTRA_SUBTITLE_DURATION_MS
=
"durationMs"
;
static
const
EXTRA_SUBTITLE_DURATION_MS
=
"durationMs"
;
static
const
EXTRA_SUBTITLE_TRACK_INDEX
=
"trackIndex"
;
static
const
EXTRA_SUBTITLE_TRACK_INDEX
=
"trackIndex"
;
/// Alternative playback URL for HEVC downgrade playback, supported by the Advanced Player 12.0
/// HEVC 降级播放时备选播放 URL, 播放器高级版 12.0 版本开始支持
static
const
VOD_KEY_BACKUP_URL
=
"VOD_KEY_BACKUP_URL"
;
/// When HEVC is downgraded, the main video encoding type
/// HEVC 降级播放时,主播放的视频编码类型
static
const
VOD_KEY_VIDEO_CODEC_TYPE
=
"VOD_KEY_VIDEO_CODEC_TYPE"
;
/// MediaType of alternative playback URL resource during HEVC downgrade playback, supported by the Advanced Player 12.0
/// HEVC 降级播放时备选播放 URL 资源的 MediaType, 播放器高级版 12.0 版本开始支持
static
const
VOD_KEY_BACKUP_URL_MEDIA_TYPE
=
"VOD_KEY_BACKUP_URL_MEDIA_TYPE"
;
/// HEVC format, supported by the player advanced version 12.0
/// HEVC 格式, 播放器高级版 12.0 版本开始支持
static
const
VOD_PLAY_MIMETYPE_H265
=
"video/hevc"
;
/// mp4加密播放:不加密。 12.2 版本开始支持。
/// MP4 encryption playback: No encryption. Supported since version 12.2.
static
const
MP4_ENCRYPTION_LEVEL_NONE
=
0
;
/// mp4加密播放: mp4本地加密播放。12.2 版本开始支持。
/// MP4 encrypted playback: MP4 local encrypted playback. Supported since version 12.2.
static
const
MP4_ENCRYPTION_LEVEL_L2
=
2
;
}
}
abstract
class
TXVodNetEvent
{
abstract
class
TXVodNetEvent
{
...
@@ -618,8 +637,9 @@ class TXPlayInfoParams {
...
@@ -618,8 +637,9 @@ class TXPlayInfoParams {
// video url, only applicable for preloading. When using it, you only need to fill in either the url or fileId.
// video url, only applicable for preloading. When using it, you only need to fill in either the url or fileId.
// The priority of the url is higher than that of the fileId.
// The priority of the url is higher than that of the fileId.
final
String
?
url
;
final
String
?
url
;
// Custom httpHeader
const
TXPlayInfoParams
({
required
this
.
appId
,
required
this
.
fileId
,
this
.
psign
=
""
,
this
.
url
=
""
});
final
Map
<
String
,
String
>?
httpHeader
;
const
TXPlayInfoParams
({
required
this
.
appId
,
required
this
.
fileId
,
this
.
psign
=
""
,
this
.
url
=
""
,
this
.
httpHeader
});
Map
<
String
,
dynamic
>
toJson
()
{
Map
<
String
,
dynamic
>
toJson
()
{
Map
<
String
,
dynamic
>
json
=
{};
Map
<
String
,
dynamic
>
json
=
{};
...
@@ -627,6 +647,7 @@ class TXPlayInfoParams {
...
@@ -627,6 +647,7 @@ class TXPlayInfoParams {
json
[
"fileId"
]
=
fileId
;
json
[
"fileId"
]
=
fileId
;
json
[
"psign"
]
=
psign
;
json
[
"psign"
]
=
psign
;
json
[
"url"
]
=
url
;
json
[
"url"
]
=
url
;
json
[
"httpHeader"
]
=
httpHeader
;
return
json
;
return
json
;
}
}
}
}
...
...
Flutter/lib/Core/txplayer_messages.dart
浏览文件 @
0ff875e6
...
@@ -381,6 +381,7 @@ class FTXVodPlayConfigPlayerMsg {
...
@@ -381,6 +381,7 @@ class FTXVodPlayConfigPlayerMsg {
this
.
enableRenderProcess
,
this
.
enableRenderProcess
,
this
.
preferredResolution
,
this
.
preferredResolution
,
this
.
mediaType
,
this
.
mediaType
,
this
.
encryptedMp4Level
,
});
});
int
?
playerId
;
int
?
playerId
;
...
@@ -427,6 +428,9 @@ class FTXVodPlayConfigPlayerMsg {
...
@@ -427,6 +428,9 @@ class FTXVodPlayConfigPlayerMsg {
/// 媒资类型,默认auto类型, 取值参考 see[TXVodPlayEvent]
/// 媒资类型,默认auto类型, 取值参考 see[TXVodPlayEvent]
int
?
mediaType
;
int
?
mediaType
;
/// MP4 encryption playback: Supported since version 12.2.
int
?
encryptedMp4Level
;
Object
encode
()
{
Object
encode
()
{
return
<
Object
?>[
return
<
Object
?>[
playerId
,
playerId
,
...
@@ -450,6 +454,7 @@ class FTXVodPlayConfigPlayerMsg {
...
@@ -450,6 +454,7 @@ class FTXVodPlayConfigPlayerMsg {
enableRenderProcess
,
enableRenderProcess
,
preferredResolution
,
preferredResolution
,
mediaType
,
mediaType
,
encryptedMp4Level
,
];
];
}
}
...
@@ -477,6 +482,7 @@ class FTXVodPlayConfigPlayerMsg {
...
@@ -477,6 +482,7 @@ class FTXVodPlayConfigPlayerMsg {
enableRenderProcess:
result
[
18
]
as
bool
?,
enableRenderProcess:
result
[
18
]
as
bool
?,
preferredResolution:
result
[
19
]
as
int
?,
preferredResolution:
result
[
19
]
as
int
?,
mediaType:
result
[
20
]
as
int
?,
mediaType:
result
[
20
]
as
int
?,
encryptedMp4Level:
result
[
21
]
as
int
?,
);
);
}
}
}
}
...
@@ -885,6 +891,7 @@ class PreLoadInfoMsg {
...
@@ -885,6 +891,7 @@ class PreLoadInfoMsg {
this
.
preloadSizeMB
,
this
.
preloadSizeMB
,
this
.
preferredResolution
,
this
.
preferredResolution
,
this
.
tmpPreloadTaskId
,
this
.
tmpPreloadTaskId
,
this
.
httpHeader
,
});
});
int
?
appId
;
int
?
appId
;
...
@@ -901,6 +908,8 @@ class PreLoadInfoMsg {
...
@@ -901,6 +908,8 @@ class PreLoadInfoMsg {
int
?
tmpPreloadTaskId
;
int
?
tmpPreloadTaskId
;
Map
<
String
?,
String
?>?
httpHeader
;
Object
encode
()
{
Object
encode
()
{
return
<
Object
?>[
return
<
Object
?>[
appId
,
appId
,
...
@@ -910,6 +919,7 @@ class PreLoadInfoMsg {
...
@@ -910,6 +919,7 @@ class PreLoadInfoMsg {
preloadSizeMB
,
preloadSizeMB
,
preferredResolution
,
preferredResolution
,
tmpPreloadTaskId
,
tmpPreloadTaskId
,
httpHeader
,
];
];
}
}
...
@@ -923,6 +933,7 @@ class PreLoadInfoMsg {
...
@@ -923,6 +933,7 @@ class PreLoadInfoMsg {
preloadSizeMB:
result
[
4
]
as
double
?,
preloadSizeMB:
result
[
4
]
as
double
?,
preferredResolution:
result
[
5
]
as
int
?,
preferredResolution:
result
[
5
]
as
int
?,
tmpPreloadTaskId:
result
[
6
]
as
int
?,
tmpPreloadTaskId:
result
[
6
]
as
int
?,
httpHeader:
(
result
[
7
]
as
Map
<
Object
?,
Object
?>?)?.
cast
<
String
?,
String
?>(),
);
);
}
}
}
}
...
...
Flutter/lib/Core/txvoddownload_controller.dart
浏览文件 @
0ff875e6
...
@@ -82,7 +82,8 @@ class TXVodDownloadController implements TXDownloadFlutterAPI {
...
@@ -82,7 +82,8 @@ class TXVodDownloadController implements TXDownloadFlutterAPI {
..
appId
=
txPlayInfoParams
.
appId
..
appId
=
txPlayInfoParams
.
appId
..
pSign
=
txPlayInfoParams
.
psign
..
pSign
=
txPlayInfoParams
.
psign
..
preloadSizeMB
=
preloadSizeMB
..
preloadSizeMB
=
preloadSizeMB
..
preferredResolution
=
preferredResolution
);
..
preferredResolution
=
preferredResolution
..
httpHeader
=
txPlayInfoParams
.
httpHeader
);
_fileIdBeforeStartListeners
[
tmpPreloadTaskId
]
=
_PreloadListener
()
_fileIdBeforeStartListeners
[
tmpPreloadTaskId
]
=
_PreloadListener
()
..
onCompleteListener
=
onCompleteListener
..
onCompleteListener
=
onCompleteListener
..
onErrorListener
=
onErrorListener
..
onErrorListener
=
onErrorListener
...
@@ -232,8 +233,8 @@ class TXVodDownloadController implements TXDownloadFlutterAPI {
...
@@ -232,8 +233,8 @@ class TXVodDownloadController implements TXDownloadFlutterAPI {
}
}
@override
@override
void
onDownloadEvent
(
Map
<
dynamic
,
dynamic
>
event
)
{
void
onDownloadEvent
(
Map
<
String
,
Object
>
event
)
{
LogUtils
.
d
(
TAG
,
'on
Pre
DownloadEvent _eventHandler, event=
$event
'
);
LogUtils
.
d
(
TAG
,
'onDownloadEvent _eventHandler, event=
$event
'
);
final
Map
<
dynamic
,
dynamic
>
map
=
event
;
final
Map
<
dynamic
,
dynamic
>
map
=
event
;
int
eventCode
=
map
[
"event"
];
int
eventCode
=
map
[
"event"
];
switch
(
eventCode
)
{
switch
(
eventCode
)
{
...
@@ -255,9 +256,8 @@ class TXVodDownloadController implements TXDownloadFlutterAPI {
...
@@ -255,9 +256,8 @@ class TXVodDownloadController implements TXDownloadFlutterAPI {
}
}
@override
@override
void
onPreDownloadEvent
(
Map
<
dynamic
,
dynamic
>
event
)
{
void
onPreDownloadEvent
(
Map
<
String
,
Object
>
event
)
{
LogUtils
.
d
(
TAG
,
'onPreDownloadEvent _eventHandler, event=
$event
'
);
LogUtils
.
d
(
TAG
,
'onDownloadEvent _eventHandler, event=
$event
'
);
final
Map
<
dynamic
,
dynamic
>
map
=
event
;
final
Map
<
dynamic
,
dynamic
>
map
=
event
;
int
eventCode
=
map
[
"event"
];
int
eventCode
=
map
[
"event"
];
switch
(
eventCode
)
{
switch
(
eventCode
)
{
...
...
Flutter/lib/Core/txvodplayer_config.dart
浏览文件 @
0ff875e6
...
@@ -92,6 +92,8 @@ class FTXVodPlayConfig {
...
@@ -92,6 +92,8 @@ class FTXVodPlayConfig {
/// 媒资类型,默认auto类型, 取值参考 see[TXVodPlayEvent]
/// 媒资类型,默认auto类型, 取值参考 see[TXVodPlayEvent]
int
mediaType
=
TXVodPlayEvent
.
MEDIA_TYPE_AUTO
;
int
mediaType
=
TXVodPlayEvent
.
MEDIA_TYPE_AUTO
;
int
encryptedMp4Level
=
TXVodPlayEvent
.
MP4_ENCRYPTION_LEVEL_NONE
;
Map
<
String
,
dynamic
>
toJson
()
{
Map
<
String
,
dynamic
>
toJson
()
{
Map
<
String
,
dynamic
>
json
=
{};
Map
<
String
,
dynamic
>
json
=
{};
json
[
"connectRetryCount"
]
=
connectRetryCount
;
json
[
"connectRetryCount"
]
=
connectRetryCount
;
...
@@ -114,6 +116,7 @@ class FTXVodPlayConfig {
...
@@ -114,6 +116,7 @@ class FTXVodPlayConfig {
json
[
"enableRenderProcess"
]
=
enableRenderProcess
;
json
[
"enableRenderProcess"
]
=
enableRenderProcess
;
json
[
"preferredResolution"
]
=
preferredResolution
.
toString
();
json
[
"preferredResolution"
]
=
preferredResolution
.
toString
();
json
[
"mediaType"
]
=
mediaType
.
toString
();
json
[
"mediaType"
]
=
mediaType
.
toString
();
json
[
"encryptedMp4Level"
]
=
encryptedMp4Level
.
toString
();
return
json
;
return
json
;
}
}
...
@@ -139,6 +142,7 @@ class FTXVodPlayConfig {
...
@@ -139,6 +142,7 @@ class FTXVodPlayConfig {
enableRenderProcess:
enableRenderProcess
,
enableRenderProcess:
enableRenderProcess
,
preferredResolution:
preferredResolution
,
preferredResolution:
preferredResolution
,
mediaType:
mediaType
,
mediaType:
mediaType
,
encryptedMp4Level:
encryptedMp4Level
,
);
);
}
}
}
}
...
...
Flutter/pubspec.yaml
浏览文件 @
0ff875e6
name
:
super_player
name
:
super_player
description
:
player plugin.
description
:
player plugin.
version
:
12.
1
.0
version
:
12.
2
.0
author
:
author
:
homepage
:
homepage
:
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论