Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
T
tx_player_fork
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
蒋俊
tx_player_fork
Commits
4f9e77f0
提交
4f9e77f0
authored
11月 27, 2023
作者:
kongdywang
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
1. fix license donwload error when ios app first start
2. fix ios predownload path error
上级
0e82e320
隐藏空白字符变更
内嵌
并排
正在显示
6 个修改的文件
包含
31 行增加
和
14 行删除
+31
-14
demo_config.dart
Flutter/example/lib/common/demo_config.dart
+7
-0
demo_txvodplayer.dart
Flutter/example/lib/demo_txvodplayer.dart
+11
-1
main.dart
Flutter/example/lib/main.dart
+2
-3
treePage.dart
Flutter/example/lib/ui/treePage.dart
+8
-1
FTXDownloadManager.m
Flutter/ios/Classes/FTXDownloadManager.m
+0
-4
SuperPlayerPlugin.m
Flutter/ios/Classes/SuperPlayerPlugin.m
+3
-5
没有找到文件。
Flutter/example/lib/common/demo_config.dart
0 → 100644
浏览文件 @
4f9e77f0
// Copyright (c) 2022 Tencent. All rights reserved.
// The obtained license URL
const
LICENSE_URL
=
""
;
// The obtained license key
const
LICENSE_KEY
=
""
;
\ No newline at end of file
Flutter/example/lib/demo_txvodplayer.dart
浏览文件 @
4f9e77f0
...
@@ -38,6 +38,7 @@ class _DemoTXVodPlayerState extends State<DemoTXVodPlayer> with WidgetsBindingOb
...
@@ -38,6 +38,7 @@ class _DemoTXVodPlayerState extends State<DemoTXVodPlayer> with WidgetsBindingOb
Future
<
void
>
init
()
async
{
Future
<
void
>
init
()
async
{
if
(!
mounted
)
return
;
if
(!
mounted
)
return
;
await
SuperPlayerPlugin
.
setConsoleEnabled
(
true
);
_controller
=
TXVodPlayerController
();
_controller
=
TXVodPlayerController
();
_controller
.
onPlayerState
.
listen
((
val
)
{
_controller
.
onPlayerState
.
listen
((
val
)
{
debugPrint
(
"Playback status
${val?.name}
"
);
debugPrint
(
"Playback status
${val?.name}
"
);
...
@@ -80,7 +81,6 @@ class _DemoTXVodPlayerState extends State<DemoTXVodPlayer> with WidgetsBindingOb
...
@@ -80,7 +81,6 @@ class _DemoTXVodPlayerState extends State<DemoTXVodPlayer> with WidgetsBindingOb
});
});
}
}
});
});
await
SuperPlayerPlugin
.
setConsoleEnabled
(
true
);
await
_controller
.
initialize
();
await
_controller
.
initialize
();
await
_controller
.
setLoop
(
true
);
await
_controller
.
setLoop
(
true
);
...
@@ -91,6 +91,16 @@ class _DemoTXVodPlayerState extends State<DemoTXVodPlayer> with WidgetsBindingOb
...
@@ -91,6 +91,16 @@ class _DemoTXVodPlayerState extends State<DemoTXVodPlayer> with WidgetsBindingOb
await
_controller
.
startVodPlay
(
_url
);
await
_controller
.
startVodPlay
(
_url
);
}
}
void
startPlay
()
async
{
await
_controller
.
startVodPlayWithParams
(
TXPlayInfoParams
(
appId:
1500005830
,
fileId:
"243791578431393746"
,
psign:
"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJhcHBJZCI6MTUwMDAwNTgzMCwiZmlsZUlkIjoiMjQzNzkxNTc4NDMxMzkzNzQ2IiwiY"
"3VycmVudFRpbWVTdGFtcCI6MTY3MzQyNjIyNywiY29udGVudEluZm8iOnsiYXVkaW9WaWRlb1R5cGUiOiJQcm90ZWN0ZWRBZGFwdGl"
"2ZSIsImRybUFkYXB0aXZlSW5mbyI6eyJwcml2YXRlRW5jcnlwdGlvbkRlZmluaXRpb24iOjEyfX0sInVybEFjY2Vzc0luZm8iOnsiZ"
"G9tYWluIjoiMTUwMDAwNTgzMC52b2QyLm15cWNsb3VkLmNvbSIsInNjaGVtZSI6IkhUVFBTIn19.q34pq7Bl0ryKDwUHGyzfXKP-C"
"DI8vrm0k_y-IaxgF_U"
));
}
void
_resizeVideo
(
Map
<
dynamic
,
dynamic
>
event
)
{
void
_resizeVideo
(
Map
<
dynamic
,
dynamic
>
event
)
{
int
?
videoWidth
=
event
[
TXVodPlayEvent
.
EVT_PARAM1
];
int
?
videoWidth
=
event
[
TXVodPlayEvent
.
EVT_PARAM1
];
int
?
videoHeight
=
event
[
TXVodPlayEvent
.
EVT_PARAM2
];
int
?
videoHeight
=
event
[
TXVodPlayEvent
.
EVT_PARAM2
];
...
...
Flutter/example/lib/main.dart
浏览文件 @
4f9e77f0
...
@@ -6,6 +6,7 @@ import 'package:flutter/services.dart';
...
@@ -6,6 +6,7 @@ import 'package:flutter/services.dart';
import
'package:flutter_easyloading/flutter_easyloading.dart'
;
import
'package:flutter_easyloading/flutter_easyloading.dart'
;
import
'package:flutter_localizations/flutter_localizations.dart'
;
import
'package:flutter_localizations/flutter_localizations.dart'
;
import
'package:super_player/super_player.dart'
;
import
'package:super_player/super_player.dart'
;
import
'package:super_player_example/common/demo_config.dart'
;
import
'package:super_player_example/demo_superplayer.dart'
;
import
'package:super_player_example/demo_superplayer.dart'
;
import
'package:super_player_example/res/app_localization_delegate.dart'
;
import
'package:super_player_example/res/app_localization_delegate.dart'
;
import
'package:super_player_example/res/app_localizations.dart'
;
import
'package:super_player_example/res/app_localizations.dart'
;
...
@@ -40,9 +41,7 @@ class _MyAppState extends State<MyApp> {
...
@@ -40,9 +41,7 @@ class _MyAppState extends State<MyApp> {
/// set player license
/// set player license
Future
<
void
>
initPlayerLicense
()
async
{
Future
<
void
>
initPlayerLicense
()
async
{
String
licenceURL
=
""
;
// The obtained license URL
await
SuperPlayerPlugin
.
setGlobalLicense
(
LICENSE_URL
,
LICENSE_KEY
);
String
licenceKey
=
""
;
// The obtained license key
await
SuperPlayerPlugin
.
setGlobalLicense
(
licenceURL
,
licenceKey
);
}
}
// Platform messages are asynchronous, so we initialize in an async method.
// Platform messages are asynchronous, so we initialize in an async method.
...
...
Flutter/example/lib/ui/treePage.dart
浏览文件 @
4f9e77f0
...
@@ -2,10 +2,12 @@
...
@@ -2,10 +2,12 @@
import
'dart:math'
;
import
'dart:math'
;
import
'package:flutter/material.dart'
;
import
'package:flutter/material.dart'
;
import
'package:super_player_example/common/demo_config.dart'
;
import
'package:super_player_example/demo_superplayer.dart'
;
import
'package:super_player_example/demo_superplayer.dart'
;
import
'package:super_player_example/demo_txLiveplayer.dart'
;
import
'package:super_player_example/demo_txLiveplayer.dart'
;
import
'package:super_player_example/demo_txvodplayer.dart'
;
import
'package:super_player_example/demo_txvodplayer.dart'
;
import
'package:super_player_example/res/app_localizations.dart'
;
import
'package:super_player_example/res/app_localizations.dart'
;
import
'package:super_player/super_player.dart'
;
import
'../demo_short_video_player.dart'
;
import
'../demo_short_video_player.dart'
;
import
'demo_define.dart'
;
import
'demo_define.dart'
;
...
@@ -28,11 +30,16 @@ class _TreePageState extends State<TreePage> {
...
@@ -28,11 +30,16 @@ class _TreePageState extends State<TreePage> {
Icons
.
ac_unit
,
Icons
.
ac_unit
,
Icons
.
lightbulb_outline
,
Icons
.
lightbulb_outline
,
];
];
/// set player license
Future
<
void
>
initPlayerLicense
()
async
{
await
SuperPlayerPlugin
.
setGlobalLicense
(
LICENSE_URL
,
LICENSE_KEY
);
}
@override
@override
void
initState
()
{
void
initState
()
{
super
.
initState
();
super
.
initState
();
// license add to here, prevent first launch due to license loading failure caused by no network
initPlayerLicense
();
_scrollController
.
addListener
(()
{
_scrollController
.
addListener
(()
{
// Current position = maximum sliding range means that it has already been scrolled to the bottom.
// Current position = maximum sliding range means that it has already been scrolled to the bottom.
if
(
_scrollController
.
position
.
pixels
==
if
(
_scrollController
.
position
.
pixels
==
...
...
Flutter/ios/Classes/FTXDownloadManager.m
浏览文件 @
4f9e77f0
...
@@ -32,10 +32,6 @@
...
@@ -32,10 +32,6 @@
_eventChannel
=
[
FlutterEventChannel
eventChannelWithName
:
@"cloud.tencent.com/txvodplayer/download/event"
binaryMessenger
:[
registrar
messenger
]];
_eventChannel
=
[
FlutterEventChannel
eventChannelWithName
:
@"cloud.tencent.com/txvodplayer/download/event"
binaryMessenger
:[
registrar
messenger
]];
[
_eventChannel
setStreamHandler
:
self
];
[
_eventChannel
setStreamHandler
:
self
];
[[
TXVodDownloadManager
shareInstance
]
setDelegate
:
self
];
[[
TXVodDownloadManager
shareInstance
]
setDelegate
:
self
];
// Set the download storage path.
NSString
*
cachesDir
=
[
NSSearchPathForDirectoriesInDomains
(
NSCachesDirectory
,
NSUserDomainMask
,
YES
)
firstObject
];
NSString
*
path
=
[
NSString
stringWithFormat
:
@"%@/videoCache"
,
cachesDir
];
[[
TXVodDownloadManager
shareInstance
]
setDownloadPath
:
path
];
self
.
mPreloadQueue
=
dispatch_queue_create
(
@"cloud.tencent.com.preload"
,
NULL
);
self
.
mPreloadQueue
=
dispatch_queue_create
(
@"cloud.tencent.com.preload"
,
NULL
);
self
.
delegateArray
=
[[
NSMutableArray
alloc
]
init
];
self
.
delegateArray
=
[[
NSMutableArray
alloc
]
init
];
}
}
...
...
Flutter/ios/Classes/SuperPlayerPlugin.m
浏览文件 @
4f9e77f0
...
@@ -273,11 +273,9 @@ SuperPlayerPlugin* instance;
...
@@ -273,11 +273,9 @@ SuperPlayerPlugin* instance;
NSArray
*
paths
=
NSSearchPathForDirectoriesInDomains
(
NSDocumentDirectory
,
NSUserDomainMask
,
YES
);
NSArray
*
paths
=
NSSearchPathForDirectoriesInDomains
(
NSDocumentDirectory
,
NSUserDomainMask
,
YES
);
NSString
*
documentDirectory
=
[[
paths
objectAtIndex
:
0
]
stringByAppendingString
:
@"/"
];
NSString
*
documentDirectory
=
[[
paths
objectAtIndex
:
0
]
stringByAppendingString
:
@"/"
];
NSString
*
preloadDataPath
=
[
documentDirectory
stringByAppendingPathComponent
:
postfixPathStr
];
NSString
*
preloadDataPath
=
[
documentDirectory
stringByAppendingPathComponent
:
postfixPathStr
];
if
(
!
[[
NSFileManager
defaultManager
]
fileExistsAtPath
:
preloadDataPath
])
{
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
];
[
TXPlayerGlobalSetting
setCacheFolderPath
:
preloadDataPath
];
[
TXPlayerGlobalSetting
setCacheFolderPath
:
preloadDataPath
];
}
return
[
CommonUtil
boolMsgWith
:
YES
];
return
[
CommonUtil
boolMsgWith
:
YES
];
}
else
{
}
else
{
return
[
CommonUtil
boolMsgWith
:
NO
];
return
[
CommonUtil
boolMsgWith
:
NO
];
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论