Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
T
tx_player_fork
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
蒋俊
tx_player_fork
Commits
3d3018b5
提交
3d3018b5
authored
7月 08, 2024
作者:
kongdywang
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
1. fix live playerType
2. SuperPlayerPlugin add setGlobalCacheFolderCustomPath api
上级
ebe1b934
隐藏空白字符变更
内嵌
并排
正在显示
9 个修改的文件
包含
305 行增加
和
26 行删除
+305
-26
SuperPlayerPlugin.java
.../main/java/com/tencent/vod/flutter/SuperPlayerPlugin.java
+17
-0
FtxMessages.java
...in/java/com/tencent/vod/flutter/messages/FtxMessages.java
+103
-7
SuperPlayerPlugin.m
Flutter/ios/Classes/SuperPlayerPlugin.m
+14
-1
FtxMessages.h
Flutter/ios/Classes/messages/FtxMessages.h
+12
-0
FtxMessages.m
Flutter/ios/Classes/messages/FtxMessages.m
+63
-7
txplayer_message.dart
Flutter/lib/Core/pigeons/txplayer_message.dart
+8
-2
superplayer_plugin.dart
Flutter/lib/Core/superplayer_plugin.dart
+19
-0
txplayer_define.dart
Flutter/lib/Core/txplayer_define.dart
+2
-1
txplayer_messages.dart
Flutter/lib/Core/txplayer_messages.dart
+67
-8
没有找到文件。
Flutter/android/src/main/java/com/tencent/vod/flutter/SuperPlayerPlugin.java
浏览文件 @
3d3018b5
...
@@ -31,6 +31,7 @@ import com.tencent.rtmp.TXLiveBaseListener;
...
@@ -31,6 +31,7 @@ import com.tencent.rtmp.TXLiveBaseListener;
import
com.tencent.rtmp.TXPlayerGlobalSetting
;
import
com.tencent.rtmp.TXPlayerGlobalSetting
;
import
com.tencent.vod.flutter.messages.FTXLivePlayerDispatcher
;
import
com.tencent.vod.flutter.messages.FTXLivePlayerDispatcher
;
import
com.tencent.vod.flutter.messages.FTXVodPlayerDispatcher
;
import
com.tencent.vod.flutter.messages.FTXVodPlayerDispatcher
;
import
com.tencent.vod.flutter.messages.FtxMessages
;
import
com.tencent.vod.flutter.messages.FtxMessages.BoolMsg
;
import
com.tencent.vod.flutter.messages.FtxMessages.BoolMsg
;
import
com.tencent.vod.flutter.messages.FtxMessages.DoubleMsg
;
import
com.tencent.vod.flutter.messages.FtxMessages.DoubleMsg
;
import
com.tencent.vod.flutter.messages.FtxMessages.IntMsg
;
import
com.tencent.vod.flutter.messages.FtxMessages.IntMsg
;
...
@@ -274,6 +275,7 @@ public class SuperPlayerPlugin implements FlutterPlugin, ActivityAware,
...
@@ -274,6 +275,7 @@ public class SuperPlayerPlugin implements FlutterPlugin, ActivityAware,
if
(!
TextUtils
.
isEmpty
(
postfixPath
.
getValue
()))
{
if
(!
TextUtils
.
isEmpty
(
postfixPath
.
getValue
()))
{
File
sdcardDir
=
mFlutterPluginBinding
.
getApplicationContext
().
getExternalFilesDir
(
null
);
File
sdcardDir
=
mFlutterPluginBinding
.
getApplicationContext
().
getExternalFilesDir
(
null
);
if
(
null
!=
sdcardDir
)
{
if
(
null
!=
sdcardDir
)
{
LiteavLog
.
v
(
TAG
,
"setGlobalCacheFolderPath:"
+
postfixPath
.
getValue
());
TXPlayerGlobalSetting
.
setCacheFolderPath
(
sdcardDir
.
getPath
()
+
File
.
separator
+
postfixPath
.
getValue
());
TXPlayerGlobalSetting
.
setCacheFolderPath
(
sdcardDir
.
getPath
()
+
File
.
separator
+
postfixPath
.
getValue
());
configResult
=
true
;
configResult
=
true
;
}
}
...
@@ -283,6 +285,21 @@ public class SuperPlayerPlugin implements FlutterPlugin, ActivityAware,
...
@@ -283,6 +285,21 @@ public class SuperPlayerPlugin implements FlutterPlugin, ActivityAware,
return
boolMsg
;
return
boolMsg
;
}
}
@NonNull
@Override
public
BoolMsg
setGlobalCacheFolderCustomPath
(
@NonNull
FtxMessages
.
CachePathMsg
cacheMsg
)
{
boolean
configResult
=
false
;
final
String
cachePath
=
cacheMsg
.
getAndroidAbsolutePath
();
if
(!
TextUtils
.
isEmpty
(
cachePath
))
{
LiteavLog
.
v
(
TAG
,
"setGlobalCacheFolderCustomPath:"
+
cachePath
);
TXPlayerGlobalSetting
.
setCacheFolderPath
(
cachePath
);
configResult
=
true
;
}
BoolMsg
boolMsg
=
new
BoolMsg
();
boolMsg
.
setValue
(
configResult
);
return
boolMsg
;
}
@Override
@Override
public
void
setGlobalLicense
(
@NonNull
LicenseMsg
licenseMsg
)
{
public
void
setGlobalLicense
(
@NonNull
LicenseMsg
licenseMsg
)
{
TXLiveBase
.
getInstance
().
setLicence
(
mFlutterPluginBinding
.
getApplicationContext
(),
licenseMsg
.
getLicenseUrl
(),
TXLiveBase
.
getInstance
().
setLicence
(
mFlutterPluginBinding
.
getApplicationContext
(),
licenseMsg
.
getLicenseUrl
(),
...
...
Flutter/android/src/main/java/com/tencent/vod/flutter/messages/FtxMessages.java
浏览文件 @
3d3018b5
...
@@ -2347,6 +2347,70 @@ public class FtxMessages {
...
@@ -2347,6 +2347,70 @@ public class FtxMessages {
}
}
}
}
/** Generated class from Pigeon that represents data sent in messages. */
public
static
final
class
CachePathMsg
{
private
@Nullable
String
androidAbsolutePath
;
public
@Nullable
String
getAndroidAbsolutePath
()
{
return
androidAbsolutePath
;
}
public
void
setAndroidAbsolutePath
(
@Nullable
String
setterArg
)
{
this
.
androidAbsolutePath
=
setterArg
;
}
private
@Nullable
String
iOSAbsolutePath
;
public
@Nullable
String
getIOSAbsolutePath
()
{
return
iOSAbsolutePath
;
}
public
void
setIOSAbsolutePath
(
@Nullable
String
setterArg
)
{
this
.
iOSAbsolutePath
=
setterArg
;
}
public
static
final
class
Builder
{
private
@Nullable
String
androidAbsolutePath
;
public
@NonNull
Builder
setAndroidAbsolutePath
(
@Nullable
String
setterArg
)
{
this
.
androidAbsolutePath
=
setterArg
;
return
this
;
}
private
@Nullable
String
iOSAbsolutePath
;
public
@NonNull
Builder
setIOSAbsolutePath
(
@Nullable
String
setterArg
)
{
this
.
iOSAbsolutePath
=
setterArg
;
return
this
;
}
public
@NonNull
CachePathMsg
build
()
{
CachePathMsg
pigeonReturn
=
new
CachePathMsg
();
pigeonReturn
.
setAndroidAbsolutePath
(
androidAbsolutePath
);
pigeonReturn
.
setIOSAbsolutePath
(
iOSAbsolutePath
);
return
pigeonReturn
;
}
}
@NonNull
ArrayList
<
Object
>
toList
()
{
ArrayList
<
Object
>
toListResult
=
new
ArrayList
<
Object
>(
2
);
toListResult
.
add
(
androidAbsolutePath
);
toListResult
.
add
(
iOSAbsolutePath
);
return
toListResult
;
}
static
@NonNull
CachePathMsg
fromList
(
@NonNull
ArrayList
<
Object
>
list
)
{
CachePathMsg
pigeonResult
=
new
CachePathMsg
();
Object
androidAbsolutePath
=
list
.
get
(
0
);
pigeonResult
.
setAndroidAbsolutePath
((
String
)
androidAbsolutePath
);
Object
iOSAbsolutePath
=
list
.
get
(
1
);
pigeonResult
.
setIOSAbsolutePath
((
String
)
iOSAbsolutePath
);
return
pigeonResult
;
}
}
/** Generated class from Pigeon that represents data sent in messages. */
/** Generated class from Pigeon that represents data sent in messages. */
public
static
final
class
DoubleMsg
{
public
static
final
class
DoubleMsg
{
private
@Nullable
Double
value
;
private
@Nullable
Double
value
;
...
@@ -3214,12 +3278,14 @@ public class FtxMessages {
...
@@ -3214,12 +3278,14 @@ public class FtxMessages {
case
(
byte
)
128
:
case
(
byte
)
128
:
return
BoolMsg
.
fromList
((
ArrayList
<
Object
>)
readValue
(
buffer
));
return
BoolMsg
.
fromList
((
ArrayList
<
Object
>)
readValue
(
buffer
));
case
(
byte
)
129
:
case
(
byte
)
129
:
return
Int
Msg
.
fromList
((
ArrayList
<
Object
>)
readValue
(
buffer
));
return
CachePath
Msg
.
fromList
((
ArrayList
<
Object
>)
readValue
(
buffer
));
case
(
byte
)
130
:
case
(
byte
)
130
:
return
License
Msg
.
fromList
((
ArrayList
<
Object
>)
readValue
(
buffer
));
return
Int
Msg
.
fromList
((
ArrayList
<
Object
>)
readValue
(
buffer
));
case
(
byte
)
131
:
case
(
byte
)
131
:
return
Player
Msg
.
fromList
((
ArrayList
<
Object
>)
readValue
(
buffer
));
return
License
Msg
.
fromList
((
ArrayList
<
Object
>)
readValue
(
buffer
));
case
(
byte
)
132
:
case
(
byte
)
132
:
return
PlayerMsg
.
fromList
((
ArrayList
<
Object
>)
readValue
(
buffer
));
case
(
byte
)
133
:
return
StringMsg
.
fromList
((
ArrayList
<
Object
>)
readValue
(
buffer
));
return
StringMsg
.
fromList
((
ArrayList
<
Object
>)
readValue
(
buffer
));
default
:
default
:
return
super
.
readValueOfType
(
type
,
buffer
);
return
super
.
readValueOfType
(
type
,
buffer
);
...
@@ -3231,17 +3297,20 @@ public class FtxMessages {
...
@@ -3231,17 +3297,20 @@ public class FtxMessages {
if
(
value
instanceof
BoolMsg
)
{
if
(
value
instanceof
BoolMsg
)
{
stream
.
write
(
128
);
stream
.
write
(
128
);
writeValue
(
stream
,
((
BoolMsg
)
value
).
toList
());
writeValue
(
stream
,
((
BoolMsg
)
value
).
toList
());
}
else
if
(
value
instanceof
Int
Msg
)
{
}
else
if
(
value
instanceof
CachePath
Msg
)
{
stream
.
write
(
129
);
stream
.
write
(
129
);
writeValue
(
stream
,
((
CachePathMsg
)
value
).
toList
());
}
else
if
(
value
instanceof
IntMsg
)
{
stream
.
write
(
130
);
writeValue
(
stream
,
((
IntMsg
)
value
).
toList
());
writeValue
(
stream
,
((
IntMsg
)
value
).
toList
());
}
else
if
(
value
instanceof
LicenseMsg
)
{
}
else
if
(
value
instanceof
LicenseMsg
)
{
stream
.
write
(
13
0
);
stream
.
write
(
13
1
);
writeValue
(
stream
,
((
LicenseMsg
)
value
).
toList
());
writeValue
(
stream
,
((
LicenseMsg
)
value
).
toList
());
}
else
if
(
value
instanceof
PlayerMsg
)
{
}
else
if
(
value
instanceof
PlayerMsg
)
{
stream
.
write
(
13
1
);
stream
.
write
(
13
2
);
writeValue
(
stream
,
((
PlayerMsg
)
value
).
toList
());
writeValue
(
stream
,
((
PlayerMsg
)
value
).
toList
());
}
else
if
(
value
instanceof
StringMsg
)
{
}
else
if
(
value
instanceof
StringMsg
)
{
stream
.
write
(
13
2
);
stream
.
write
(
13
3
);
writeValue
(
stream
,
((
StringMsg
)
value
).
toList
());
writeValue
(
stream
,
((
StringMsg
)
value
).
toList
());
}
else
{
}
else
{
super
.
writeValue
(
stream
,
value
);
super
.
writeValue
(
stream
,
value
);
...
@@ -3284,6 +3353,9 @@ public class FtxMessages {
...
@@ -3284,6 +3353,9 @@ public class FtxMessages {
*/
*/
@NonNull
@NonNull
BoolMsg
setGlobalCacheFolderPath
(
@NonNull
StringMsg
postfixPath
);
BoolMsg
setGlobalCacheFolderPath
(
@NonNull
StringMsg
postfixPath
);
/** 设置播放器资源缓存目录绝对路径,该方法会与 setGlobalCacheFolderPath(String postfixPath) 相互覆盖,调用其中一个即可 */
@NonNull
BoolMsg
setGlobalCacheFolderCustomPath
(
@NonNull
CachePathMsg
cacheMsg
);
/** 设置全局license */
/** 设置全局license */
void
setGlobalLicense
(
@NonNull
LicenseMsg
licenseMsg
);
void
setGlobalLicense
(
@NonNull
LicenseMsg
licenseMsg
);
/** 设置log输出级别 [TXLogLevel] */
/** 设置log输出级别 [TXLogLevel] */
...
@@ -3473,6 +3545,30 @@ public class FtxMessages {
...
@@ -3473,6 +3545,30 @@ public class FtxMessages {
BoolMsg
output
=
api
.
setGlobalCacheFolderPath
(
postfixPathArg
);
BoolMsg
output
=
api
.
setGlobalCacheFolderPath
(
postfixPathArg
);
wrapped
.
add
(
0
,
output
);
wrapped
.
add
(
0
,
output
);
}
}
catch
(
Throwable
exception
)
{
ArrayList
<
Object
>
wrappedError
=
wrapError
(
exception
);
wrapped
=
wrappedError
;
}
reply
.
reply
(
wrapped
);
});
}
else
{
channel
.
setMessageHandler
(
null
);
}
}
{
BasicMessageChannel
<
Object
>
channel
=
new
BasicMessageChannel
<>(
binaryMessenger
,
"dev.flutter.pigeon.TXFlutterSuperPlayerPluginAPI.setGlobalCacheFolderCustomPath"
,
getCodec
());
if
(
api
!=
null
)
{
channel
.
setMessageHandler
(
(
message
,
reply
)
->
{
ArrayList
<
Object
>
wrapped
=
new
ArrayList
<
Object
>();
ArrayList
<
Object
>
args
=
(
ArrayList
<
Object
>)
message
;
CachePathMsg
cacheMsgArg
=
(
CachePathMsg
)
args
.
get
(
0
);
try
{
BoolMsg
output
=
api
.
setGlobalCacheFolderCustomPath
(
cacheMsgArg
);
wrapped
.
add
(
0
,
output
);
}
catch
(
Throwable
exception
)
{
catch
(
Throwable
exception
)
{
ArrayList
<
Object
>
wrappedError
=
wrapError
(
exception
);
ArrayList
<
Object
>
wrappedError
=
wrapError
(
exception
);
wrapped
=
wrappedError
;
wrapped
=
wrappedError
;
...
...
Flutter/ios/Classes/SuperPlayerPlugin.m
浏览文件 @
3d3018b5
...
@@ -289,12 +289,25 @@ SuperPlayerPlugin* instance;
...
@@ -289,12 +289,25 @@ SuperPlayerPlugin* instance;
NSString
*
preloadDataPath
=
[
documentDirectory
stringByAppendingPathComponent
:
postfixPathStr
];
NSString
*
preloadDataPath
=
[
documentDirectory
stringByAppendingPathComponent
:
postfixPathStr
];
NSError
*
error
=
nil
;
NSError
*
error
=
nil
;
[[
NSFileManager
defaultManager
]
createDirectoryAtPath
:
preloadDataPath
withIntermediateDirectories
:
NO
attributes
:
nil
error
:&
error
];
[[
NSFileManager
defaultManager
]
createDirectoryAtPath
:
preloadDataPath
withIntermediateDirectories
:
NO
attributes
:
nil
error
:&
error
];
FTXLOGV
(
@"setGlobalCacheFolderPathPostfixPath:%@"
,
preloadDataPath
);
[
TXPlayerGlobalSetting
setCacheFolderPath
:
preloadDataPath
];
[
TXPlayerGlobalSetting
setCacheFolderPath
:
preloadDataPath
];
return
[
TXCommonUtil
boolMsgWith
:
YES
];
return
[
TXCommonUtil
boolMsgWith
:
YES
];
}
else
{
}
else
{
return
[
TXCommonUtil
boolMsgWith
:
NO
];
return
[
TXCommonUtil
boolMsgWith
:
NO
];
}
}
}
-
(
BoolMsg
*
)
setGlobalCacheFolderCustomPathCacheMsg
:
(
CachePathMsg
*
)
cacheMsg
error
:
(
FlutterError
*
_Nullable
__autoreleasing
*
)
error
{
NSString
*
cachePath
=
cacheMsg
.
iOSAbsolutePath
;
if
(
cachePath
&&
cachePath
.
length
>
0
)
{
NSError
*
error
=
nil
;
[[
NSFileManager
defaultManager
]
createDirectoryAtPath
:
cachePath
withIntermediateDirectories
:
NO
attributes
:
nil
error
:&
error
];
FTXLOGV
(
@"setGlobalCacheFolderCustomPathCacheMsg:%@"
,
cachePath
);
[
TXPlayerGlobalSetting
setCacheFolderPath
:
cachePath
];
return
[
TXCommonUtil
boolMsgWith
:
YES
];
}
else
{
return
[
TXCommonUtil
boolMsgWith
:
NO
];
}
}
}
-
(
nullable
IntMsg
*
)
setGlobalEnvEnvConfig
:
(
nonnull
StringMsg
*
)
envConfig
error
:
(
FlutterError
*
_Nullable
__autoreleasing
*
_Nonnull
)
error
{
-
(
nullable
IntMsg
*
)
setGlobalEnvEnvConfig
:
(
nonnull
StringMsg
*
)
envConfig
error
:
(
FlutterError
*
_Nullable
__autoreleasing
*
_Nonnull
)
error
{
...
...
Flutter/ios/Classes/messages/FtxMessages.h
浏览文件 @
3d3018b5
...
@@ -31,6 +31,7 @@ NS_ASSUME_NONNULL_BEGIN
...
@@ -31,6 +31,7 @@ NS_ASSUME_NONNULL_BEGIN
@class
BoolMsg
;
@class
BoolMsg
;
@class
IntMsg
;
@class
IntMsg
;
@class
StringMsg
;
@class
StringMsg
;
@class
CachePathMsg
;
@class
DoubleMsg
;
@class
DoubleMsg
;
@class
PreLoadMsg
;
@class
PreLoadMsg
;
@class
PreLoadInfoMsg
;
@class
PreLoadInfoMsg
;
...
@@ -300,6 +301,13 @@ NS_ASSUME_NONNULL_BEGIN
...
@@ -300,6 +301,13 @@ NS_ASSUME_NONNULL_BEGIN
@property
(
nonatomic
,
copy
,
nullable
)
NSString
*
value
;
@property
(
nonatomic
,
copy
,
nullable
)
NSString
*
value
;
@end
@end
@interface
CachePathMsg
:
NSObject
+
(
instancetype
)
makeWithAndroidAbsolutePath
:(
nullable
NSString
*
)
androidAbsolutePath
iOSAbsolutePath
:(
nullable
NSString
*
)
iOSAbsolutePath
;
@property
(
nonatomic
,
copy
,
nullable
)
NSString
*
androidAbsolutePath
;
@property
(
nonatomic
,
copy
,
nullable
)
NSString
*
iOSAbsolutePath
;
@end
@interface
DoubleMsg
:
NSObject
@interface
DoubleMsg
:
NSObject
+
(
instancetype
)
makeWithValue
:(
nullable
NSNumber
*
)
value
;
+
(
instancetype
)
makeWithValue
:(
nullable
NSNumber
*
)
value
;
@property
(
nonatomic
,
strong
,
nullable
)
NSNumber
*
value
;
@property
(
nonatomic
,
strong
,
nullable
)
NSNumber
*
value
;
...
@@ -424,6 +432,10 @@ NSObject<FlutterMessageCodec> *TXFlutterSuperPlayerPluginAPIGetCodec(void);
...
@@ -424,6 +432,10 @@ NSObject<FlutterMessageCodec> *TXFlutterSuperPlayerPluginAPIGetCodec(void);
///
///
/// @return `nil` only when `error != nil`.
/// @return `nil` only when `error != nil`.
-
(
nullable
BoolMsg
*
)
setGlobalCacheFolderPathPostfixPath
:(
StringMsg
*
)
postfixPath
error
:(
FlutterError
*
_Nullable
*
_Nonnull
)
error
;
-
(
nullable
BoolMsg
*
)
setGlobalCacheFolderPathPostfixPath
:(
StringMsg
*
)
postfixPath
error
:(
FlutterError
*
_Nullable
*
_Nonnull
)
error
;
/// 设置播放器资源缓存目录绝对路径,该方法会与 setGlobalCacheFolderPath(String postfixPath) 相互覆盖,调用其中一个即可
///
/// @return `nil` only when `error != nil`.
-
(
nullable
BoolMsg
*
)
setGlobalCacheFolderCustomPathCacheMsg
:(
CachePathMsg
*
)
cacheMsg
error
:(
FlutterError
*
_Nullable
*
_Nonnull
)
error
;
/// 设置全局license
/// 设置全局license
-
(
void
)
setGlobalLicenseLicenseMsg
:(
LicenseMsg
*
)
licenseMsg
error
:(
FlutterError
*
_Nullable
*
_Nonnull
)
error
;
-
(
void
)
setGlobalLicenseLicenseMsg
:(
LicenseMsg
*
)
licenseMsg
error
:(
FlutterError
*
_Nullable
*
_Nonnull
)
error
;
/// 设置log输出级别 [TXLogLevel]
/// 设置log输出级别 [TXLogLevel]
...
...
Flutter/ios/Classes/messages/FtxMessages.m
浏览文件 @
3d3018b5
...
@@ -142,6 +142,12 @@ static id GetNullableObjectAtIndex(NSArray *array, NSInteger key) {
...
@@ -142,6 +142,12 @@ static id GetNullableObjectAtIndex(NSArray *array, NSInteger key) {
-
(
NSArray
*
)
toList
;
-
(
NSArray
*
)
toList
;
@end
@end
@interface
CachePathMsg
()
+
(
CachePathMsg
*
)
fromList
:
(
NSArray
*
)
list
;
+
(
nullable
CachePathMsg
*
)
nullableFromList
:(
NSArray
*
)
list
;
-
(
NSArray
*
)
toList
;
@end
@interface
DoubleMsg
()
@interface
DoubleMsg
()
+
(
DoubleMsg
*
)
fromList
:
(
NSArray
*
)
list
;
+
(
DoubleMsg
*
)
fromList
:
(
NSArray
*
)
list
;
+
(
nullable
DoubleMsg
*
)
nullableFromList
:(
NSArray
*
)
list
;
+
(
nullable
DoubleMsg
*
)
nullableFromList
:(
NSArray
*
)
list
;
...
@@ -870,6 +876,31 @@ static id GetNullableObjectAtIndex(NSArray *array, NSInteger key) {
...
@@ -870,6 +876,31 @@ static id GetNullableObjectAtIndex(NSArray *array, NSInteger key) {
}
}
@end
@end
@implementation
CachePathMsg
+
(
instancetype
)
makeWithAndroidAbsolutePath
:(
nullable
NSString
*
)
androidAbsolutePath
iOSAbsolutePath
:(
nullable
NSString
*
)
iOSAbsolutePath
{
CachePathMsg
*
pigeonResult
=
[[
CachePathMsg
alloc
]
init
];
pigeonResult
.
androidAbsolutePath
=
androidAbsolutePath
;
pigeonResult
.
iOSAbsolutePath
=
iOSAbsolutePath
;
return
pigeonResult
;
}
+
(
CachePathMsg
*
)
fromList
:(
NSArray
*
)
list
{
CachePathMsg
*
pigeonResult
=
[[
CachePathMsg
alloc
]
init
];
pigeonResult
.
androidAbsolutePath
=
GetNullableObjectAtIndex
(
list
,
0
);
pigeonResult
.
iOSAbsolutePath
=
GetNullableObjectAtIndex
(
list
,
1
);
return
pigeonResult
;
}
+
(
nullable
CachePathMsg
*
)
nullableFromList
:(
NSArray
*
)
list
{
return
(
list
)
?
[
CachePathMsg
fromList
:
list
]
:
nil
;
}
-
(
NSArray
*
)
toList
{
return
@[
(
self
.
androidAbsolutePath
?:
[
NSNull
null
]),
(
self
.
iOSAbsolutePath
?:
[
NSNull
null
]),
];
}
@end
@implementation
DoubleMsg
@implementation
DoubleMsg
+
(
instancetype
)
makeWithValue
:(
nullable
NSNumber
*
)
value
{
+
(
instancetype
)
makeWithValue
:(
nullable
NSNumber
*
)
value
{
DoubleMsg
*
pigeonResult
=
[[
DoubleMsg
alloc
]
init
];
DoubleMsg
*
pigeonResult
=
[[
DoubleMsg
alloc
]
init
];
...
@@ -1131,12 +1162,14 @@ static id GetNullableObjectAtIndex(NSArray *array, NSInteger key) {
...
@@ -1131,12 +1162,14 @@ static id GetNullableObjectAtIndex(NSArray *array, NSInteger key) {
case
128
:
case
128
:
return
[
BoolMsg
fromList
:[
self
readValue
]];
return
[
BoolMsg
fromList
:[
self
readValue
]];
case
129
:
case
129
:
return
[
Int
Msg
fromList
:[
self
readValue
]];
return
[
CachePath
Msg
fromList
:[
self
readValue
]];
case
130
:
case
130
:
return
[
License
Msg
fromList
:[
self
readValue
]];
return
[
Int
Msg
fromList
:[
self
readValue
]];
case
131
:
case
131
:
return
[
Player
Msg
fromList
:[
self
readValue
]];
return
[
License
Msg
fromList
:[
self
readValue
]];
case
132
:
case
132
:
return
[
PlayerMsg
fromList
:[
self
readValue
]];
case
133
:
return
[
StringMsg
fromList
:[
self
readValue
]];
return
[
StringMsg
fromList
:[
self
readValue
]];
default:
default:
return
[
super
readValueOfType
:
type
];
return
[
super
readValueOfType
:
type
];
...
@@ -1151,18 +1184,21 @@ static id GetNullableObjectAtIndex(NSArray *array, NSInteger key) {
...
@@ -1151,18 +1184,21 @@ static id GetNullableObjectAtIndex(NSArray *array, NSInteger key) {
if
([
value
isKindOfClass
:[
BoolMsg
class
]])
{
if
([
value
isKindOfClass
:[
BoolMsg
class
]])
{
[
self
writeByte
:
128
];
[
self
writeByte
:
128
];
[
self
writeValue
:[
value
toList
]];
[
self
writeValue
:[
value
toList
]];
}
else
if
([
value
isKindOfClass
:[
Int
Msg
class
]])
{
}
else
if
([
value
isKindOfClass
:[
CachePath
Msg
class
]])
{
[
self
writeByte
:
129
];
[
self
writeByte
:
129
];
[
self
writeValue
:[
value
toList
]];
[
self
writeValue
:[
value
toList
]];
}
else
if
([
value
isKindOfClass
:[
License
Msg
class
]])
{
}
else
if
([
value
isKindOfClass
:[
Int
Msg
class
]])
{
[
self
writeByte
:
130
];
[
self
writeByte
:
130
];
[
self
writeValue
:[
value
toList
]];
[
self
writeValue
:[
value
toList
]];
}
else
if
([
value
isKindOfClass
:[
Player
Msg
class
]])
{
}
else
if
([
value
isKindOfClass
:[
License
Msg
class
]])
{
[
self
writeByte
:
131
];
[
self
writeByte
:
131
];
[
self
writeValue
:[
value
toList
]];
[
self
writeValue
:[
value
toList
]];
}
else
if
([
value
isKindOfClass
:[
String
Msg
class
]])
{
}
else
if
([
value
isKindOfClass
:[
Player
Msg
class
]])
{
[
self
writeByte
:
132
];
[
self
writeByte
:
132
];
[
self
writeValue
:[
value
toList
]];
[
self
writeValue
:[
value
toList
]];
}
else
if
([
value
isKindOfClass
:[
StringMsg
class
]])
{
[
self
writeByte
:
133
];
[
self
writeValue
:[
value
toList
]];
}
else
{
}
else
{
[
super
writeValue
:
value
];
[
super
writeValue
:
value
];
}
}
...
@@ -1335,6 +1371,26 @@ void TXFlutterSuperPlayerPluginAPISetup(id<FlutterBinaryMessenger> binaryMesseng
...
@@ -1335,6 +1371,26 @@ void TXFlutterSuperPlayerPluginAPISetup(id<FlutterBinaryMessenger> binaryMesseng
[
channel
setMessageHandler
:
nil
];
[
channel
setMessageHandler
:
nil
];
}
}
}
}
/// 设置播放器资源缓存目录绝对路径,该方法会与 setGlobalCacheFolderPath(String postfixPath) 相互覆盖,调用其中一个即可
{
FlutterBasicMessageChannel
*
channel
=
[[
FlutterBasicMessageChannel
alloc
]
initWithName
:
@"dev.flutter.pigeon.TXFlutterSuperPlayerPluginAPI.setGlobalCacheFolderCustomPath"
binaryMessenger
:
binaryMessenger
codec
:
TXFlutterSuperPlayerPluginAPIGetCodec
()];
if
(
api
)
{
NSCAssert
([
api
respondsToSelector
:
@selector
(
setGlobalCacheFolderCustomPathCacheMsg
:
error
:
)],
@"TXFlutterSuperPlayerPluginAPI api (%@) doesn't respond to @selector(setGlobalCacheFolderCustomPathCacheMsg:error:)"
,
api
);
[
channel
setMessageHandler
:
^
(
id
_Nullable
message
,
FlutterReply
callback
)
{
NSArray
*
args
=
message
;
CachePathMsg
*
arg_cacheMsg
=
GetNullableObjectAtIndex
(
args
,
0
);
FlutterError
*
error
;
BoolMsg
*
output
=
[
api
setGlobalCacheFolderCustomPathCacheMsg
:
arg_cacheMsg
error
:
&
error
];
callback
(
wrapResult
(
output
,
error
));
}];
}
else
{
[
channel
setMessageHandler
:
nil
];
}
}
/// 设置全局license
/// 设置全局license
{
{
FlutterBasicMessageChannel
*
channel
=
FlutterBasicMessageChannel
*
channel
=
...
...
Flutter/lib/Core/pigeons/txplayer_message.dart
浏览文件 @
3d3018b5
// Copyright (c) 2022 Tencent. All rights reserved.
// Copyright (c) 2022 Tencent. All rights reserved.
// import 'package:pigeon/pigeon.dart';
// import 'package:super_player/super_player.dart';
/// Pigeon original component, used to generate native communication code for `messages`.
/// Pigeon original component, used to generate native communication code for `messages`.
/// The generation command is as follows. When using the generation command,
/// The generation command is as follows. When using the generation command,
/// the two import statements above need to be implemented or commented out.
/// the two import statements above need to be implemented or commented out.
...
@@ -269,6 +267,11 @@ class StringMsg {
...
@@ -269,6 +267,11 @@ class StringMsg {
String
?
value
;
String
?
value
;
}
}
class
CachePathMsg
{
String
?
androidAbsolutePath
;
String
?
iOSAbsolutePath
;
}
class
DoubleMsg
{
class
DoubleMsg
{
double
?
value
;
double
?
value
;
}
}
...
@@ -358,6 +361,9 @@ abstract class TXFlutterSuperPlayerPluginAPI {
...
@@ -358,6 +361,9 @@ abstract class TXFlutterSuperPlayerPluginAPI {
/// @return true 设置成功 false 设置失败
/// @return true 设置成功 false 设置失败
BoolMsg
setGlobalCacheFolderPath
(
StringMsg
postfixPath
);
BoolMsg
setGlobalCacheFolderPath
(
StringMsg
postfixPath
);
/// 设置播放器资源缓存目录绝对路径,该方法会与 setGlobalCacheFolderPath(String postfixPath) 相互覆盖,调用其中一个即可
BoolMsg
setGlobalCacheFolderCustomPath
(
CachePathMsg
cacheMsg
);
/// 设置全局license
/// 设置全局license
void
setGlobalLicense
(
LicenseMsg
licenseMsg
);
void
setGlobalLicense
(
LicenseMsg
licenseMsg
);
...
...
Flutter/lib/Core/superplayer_plugin.dart
浏览文件 @
3d3018b5
...
@@ -137,6 +137,25 @@ class SuperPlayerPlugin {
...
@@ -137,6 +137,25 @@ class SuperPlayerPlugin {
BoolMsg
boolMsg
=
await
_playerPluginApi
.
setGlobalCacheFolderPath
(
StringMsg
()..
value
=
postfixPath
);
BoolMsg
boolMsg
=
await
_playerPluginApi
.
setGlobalCacheFolderPath
(
StringMsg
()..
value
=
postfixPath
);
return
boolMsg
.
value
;
return
boolMsg
.
value
;
}
}
///
/// Set the absolute path of the player resource cache directory. This method will override each other with
/// setGlobalCacheFolderPath(String postfixPath), and you only need to call one of them.
///
/// @param androidAbsolutePath Android side absolute path
/// iOSAbsolutePath Android side absolute path
/// @return true if the setting is successful, false otherwise
///
/// 设置播放器资源缓存目录绝对路径,该方法会与 setGlobalCacheFolderPath(String postfixPath) 相互覆盖,调用其中一个即可。
///
/// @param androidAbsolutePath 安卓侧绝对路径
/// iOSAbsolutePath 安卓侧绝对路径
/// @return true 设置成功 false 设置失败
static
Future
<
bool
?>
setGlobalCacheFolderCustomPath
({
String
?
androidAbsolutePath
,
String
?
iOSAbsolutePath
})
async
{
BoolMsg
boolMsg
=
await
_playerPluginApi
.
setGlobalCacheFolderCustomPath
(
CachePathMsg
()
..
androidAbsolutePath
=
androidAbsolutePath
..
iOSAbsolutePath
=
iOSAbsolutePath
);
return
boolMsg
.
value
;
}
/// Setting the global license
/// Setting the global license
/// 设置全局license
/// 设置全局license
...
...
Flutter/lib/Core/txplayer_define.dart
浏览文件 @
3d3018b5
...
@@ -53,7 +53,8 @@ abstract class TXPlayType {
...
@@ -53,7 +53,8 @@ abstract class TXPlayType {
static
const
LIVE_RTMP
=
0
;
static
const
LIVE_RTMP
=
0
;
static
const
LIVE_FLV
=
1
;
static
const
LIVE_FLV
=
1
;
static
const
LIVE_RTMP_ACC
=
5
;
static
const
LIVE_RTMP_ACC
=
5
;
static
const
VOD_HLS
=
3
;
/// must depend on professional sdk
static
const
VOD_HLS
=
7
;
}
}
abstract
class
TXVodPlayEvent
{
abstract
class
TXVodPlayEvent
{
...
...
Flutter/lib/Core/txplayer_messages.dart
浏览文件 @
3d3018b5
// Copyright (c) 2022 Tencent. All rights reserved.
// Copyright (c) 2022 Tencent. All rights reserved.
part of
SuperPlayer
;
// Autogenerated from Pigeon (v9.2.5), do not edit directly.
// Autogenerated from Pigeon (v9.2.5), do not edit directly.
// See also: https://pub.dev/packages/pigeon
// See also: https://pub.dev/packages/pigeon
// ignore_for_file: public_member_api_docs, non_constant_identifier_names, avoid_as, unused_import, unnecessary_parenthesis, prefer_null_aware_operators, omit_local_variable_types, unused_shown_name, unnecessary_import
// ignore_for_file: public_member_api_docs, non_constant_identifier_names, avoid_as, unused_import, unnecessary_parenthesis, prefer_null_aware_operators, omit_local_variable_types, unused_shown_name, unnecessary_import
part of
SuperPlayer
;
/// Pigeon original component, used to generate native communication code for `messages`.
/// Pigeon original component, used to generate native communication code for `messages`.
/// The generation command is as follows. When using the generation command,
/// The generation command is as follows. When using the generation command,
...
@@ -781,6 +781,32 @@ class StringMsg {
...
@@ -781,6 +781,32 @@ class StringMsg {
}
}
}
}
class
CachePathMsg
{
CachePathMsg
({
this
.
androidAbsolutePath
,
this
.
iOSAbsolutePath
,
});
String
?
androidAbsolutePath
;
String
?
iOSAbsolutePath
;
Object
encode
()
{
return
<
Object
?>[
androidAbsolutePath
,
iOSAbsolutePath
,
];
}
static
CachePathMsg
decode
(
Object
result
)
{
result
as
List
<
Object
?>;
return
CachePathMsg
(
androidAbsolutePath:
result
[
0
]
as
String
?,
iOSAbsolutePath:
result
[
1
]
as
String
?,
);
}
}
class
DoubleMsg
{
class
DoubleMsg
{
DoubleMsg
({
DoubleMsg
({
this
.
value
,
this
.
value
,
...
@@ -1065,18 +1091,21 @@ class _TXFlutterSuperPlayerPluginAPICodec extends StandardMessageCodec {
...
@@ -1065,18 +1091,21 @@ class _TXFlutterSuperPlayerPluginAPICodec extends StandardMessageCodec {
if
(
value
is
BoolMsg
)
{
if
(
value
is
BoolMsg
)
{
buffer
.
putUint8
(
128
);
buffer
.
putUint8
(
128
);
writeValue
(
buffer
,
value
.
encode
());
writeValue
(
buffer
,
value
.
encode
());
}
else
if
(
value
is
Int
Msg
)
{
}
else
if
(
value
is
CachePath
Msg
)
{
buffer
.
putUint8
(
129
);
buffer
.
putUint8
(
129
);
writeValue
(
buffer
,
value
.
encode
());
writeValue
(
buffer
,
value
.
encode
());
}
else
if
(
value
is
License
Msg
)
{
}
else
if
(
value
is
Int
Msg
)
{
buffer
.
putUint8
(
130
);
buffer
.
putUint8
(
130
);
writeValue
(
buffer
,
value
.
encode
());
writeValue
(
buffer
,
value
.
encode
());
}
else
if
(
value
is
Player
Msg
)
{
}
else
if
(
value
is
License
Msg
)
{
buffer
.
putUint8
(
131
);
buffer
.
putUint8
(
131
);
writeValue
(
buffer
,
value
.
encode
());
writeValue
(
buffer
,
value
.
encode
());
}
else
if
(
value
is
String
Msg
)
{
}
else
if
(
value
is
Player
Msg
)
{
buffer
.
putUint8
(
132
);
buffer
.
putUint8
(
132
);
writeValue
(
buffer
,
value
.
encode
());
writeValue
(
buffer
,
value
.
encode
());
}
else
if
(
value
is
StringMsg
)
{
buffer
.
putUint8
(
133
);
writeValue
(
buffer
,
value
.
encode
());
}
else
{
}
else
{
super
.
writeValue
(
buffer
,
value
);
super
.
writeValue
(
buffer
,
value
);
}
}
...
@@ -1088,12 +1117,14 @@ class _TXFlutterSuperPlayerPluginAPICodec extends StandardMessageCodec {
...
@@ -1088,12 +1117,14 @@ class _TXFlutterSuperPlayerPluginAPICodec extends StandardMessageCodec {
case
128
:
case
128
:
return
BoolMsg
.
decode
(
readValue
(
buffer
)!);
return
BoolMsg
.
decode
(
readValue
(
buffer
)!);
case
129
:
case
129
:
return
Int
Msg
.
decode
(
readValue
(
buffer
)!);
return
CachePath
Msg
.
decode
(
readValue
(
buffer
)!);
case
130
:
case
130
:
return
License
Msg
.
decode
(
readValue
(
buffer
)!);
return
Int
Msg
.
decode
(
readValue
(
buffer
)!);
case
131
:
case
131
:
return
Player
Msg
.
decode
(
readValue
(
buffer
)!);
return
License
Msg
.
decode
(
readValue
(
buffer
)!);
case
132
:
case
132
:
return
PlayerMsg
.
decode
(
readValue
(
buffer
)!);
case
133
:
return
StringMsg
.
decode
(
readValue
(
buffer
)!);
return
StringMsg
.
decode
(
readValue
(
buffer
)!);
default
:
default
:
return
super
.
readValueOfType
(
type
,
buffer
);
return
super
.
readValueOfType
(
type
,
buffer
);
...
@@ -1302,6 +1333,34 @@ class TXFlutterSuperPlayerPluginAPI {
...
@@ -1302,6 +1333,34 @@ class TXFlutterSuperPlayerPluginAPI {
}
}
}
}
/// 设置播放器资源缓存目录绝对路径,该方法会与 setGlobalCacheFolderPath(String postfixPath) 相互覆盖,调用其中一个即可
Future
<
BoolMsg
>
setGlobalCacheFolderCustomPath
(
CachePathMsg
arg_cacheMsg
)
async
{
final
BasicMessageChannel
<
Object
?>
channel
=
BasicMessageChannel
<
Object
?>(
'dev.flutter.pigeon.TXFlutterSuperPlayerPluginAPI.setGlobalCacheFolderCustomPath'
,
codec
,
binaryMessenger:
_binaryMessenger
);
final
List
<
Object
?>?
replyList
=
await
channel
.
send
(<
Object
?>[
arg_cacheMsg
])
as
List
<
Object
?>?;
if
(
replyList
==
null
)
{
throw
PlatformException
(
code:
'channel-error'
,
message:
'Unable to establish connection on channel.'
,
);
}
else
if
(
replyList
.
length
>
1
)
{
throw
PlatformException
(
code:
replyList
[
0
]!
as
String
,
message:
replyList
[
1
]
as
String
?,
details:
replyList
[
2
],
);
}
else
if
(
replyList
[
0
]
==
null
)
{
throw
PlatformException
(
code:
'null-error'
,
message:
'Host platform returned null value for non-null return value.'
,
);
}
else
{
return
(
replyList
[
0
]
as
BoolMsg
?)!;
}
}
/// 设置全局license
/// 设置全局license
Future
<
void
>
setGlobalLicense
(
LicenseMsg
arg_licenseMsg
)
async
{
Future
<
void
>
setGlobalLicense
(
LicenseMsg
arg_licenseMsg
)
async
{
final
BasicMessageChannel
<
Object
?>
channel
=
BasicMessageChannel
<
Object
?>(
final
BasicMessageChannel
<
Object
?>
channel
=
BasicMessageChannel
<
Object
?>(
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论