Browse Source

ios视频播放更改

ff_new
w-R 3 years ago
parent
commit
30e82d1f5c
  1. 2
      lib/community/release_dynamic.dart
  2. 2
      lib/mine/user_info_page.dart
  3. 2
      lib/retrofit/retrofit_api.dart
  4. 6
      lib/retrofit/retrofit_api.g.dart
  5. 2
      pubspec.lock
  6. 2
      pubspec.yaml

2
lib/community/release_dynamic.dart

@ -196,6 +196,7 @@ class _ReleaseDynamic extends State<ReleaseDynamic> {
BaseData<UploadResult> baseData = await apiService.upload( BaseData<UploadResult> baseData = await apiService.upload(
File(thumbnail), File(thumbnail),
123123123, 123123123,
dynamicType == 2
); );
if (baseData != null && baseData.isSuccess) { if (baseData != null && baseData.isSuccess) {
UploadResult uploadResult = baseData.data; UploadResult uploadResult = baseData.data;
@ -207,6 +208,7 @@ class _ReleaseDynamic extends State<ReleaseDynamic> {
BaseData<UploadResult> baseData = await apiService.upload( BaseData<UploadResult> baseData = await apiService.upload(
file, file,
123123123, 123123123,
dynamicType == 2
); );
if (baseData != null && baseData.isSuccess) { if (baseData != null && baseData.isSuccess) {
UploadResult uploadResult = baseData.data; UploadResult uploadResult = baseData.data;

2
lib/mine/user_info_page.dart

@ -356,7 +356,7 @@ class _UserInfoPage extends State<UserInfoPage> {
/// ///
fileUpload() async { fileUpload() async {
if (filePath != null && filePath != "" && await File(filePath).exists()) { if (filePath != null && filePath != "" && await File(filePath).exists()) {
BaseData<UploadResult> baseData = await apiService.upload(File(filePath), 123123123).catchError((onError) {}); BaseData<UploadResult> baseData = await apiService.upload(File(filePath), 123123123,false).catchError((onError) {});
if (baseData != null && baseData.isSuccess) { if (baseData != null && baseData.isSuccess) {
UploadResult uploadResult = baseData.data; UploadResult uploadResult = baseData.data;
modifyInfo["headimg"] = uploadResult.url; modifyInfo["headimg"] = uploadResult.url;

2
lib/retrofit/retrofit_api.dart

@ -164,7 +164,7 @@ abstract class ApiService {
@POST("/file/upload") @POST("/file/upload")
@MultiPart() @MultiPart()
Future<BaseData<UploadResult>> upload( Future<BaseData<UploadResult>> upload(
@Part(name: "file") File data, @Part(name: "folderId") int folderId); @Part(name: "file") File data, @Part(name: "folderId") int folderId,bool isVideo);
/// ///
@GET( @GET(

6
lib/retrofit/retrofit_api.g.dart

@ -17,15 +17,17 @@ class _ApiService implements ApiService {
String baseUrl; String baseUrl;
@override @override
Future<BaseData<UploadResult>> upload(data, folderId) async { Future<BaseData<UploadResult>> upload(data, folderId,bool isVideo) async {
ArgumentError.checkNotNull(data, 'data'); ArgumentError.checkNotNull(data, 'data');
ArgumentError.checkNotNull(folderId, 'folderId'); ArgumentError.checkNotNull(folderId, 'folderId');
const _extra = <String, dynamic>{}; const _extra = <String, dynamic>{};
final queryParameters = <String, dynamic>{}; final queryParameters = <String, dynamic>{};
final _data = FormData(); final _data = FormData();
String fileName = data.path.split(Platform.pathSeparator).last; String fileName = data.path.split(Platform.pathSeparator).last;
if(!fileName.contains(".jpeg") && !fileName.contains(".mp4") && !fileName.contains(".png")) if(!isVideo && !fileName.contains(".jpeg") && !fileName.contains(".png"))
fileName += ".jpeg"; fileName += ".jpeg";
else if(isVideo && !fileName.contains(".mp4"))
fileName += ".mp4";
_data.files.add(MapEntry( _data.files.add(MapEntry(
'file', 'file',
MultipartFile.fromFileSync(data.path, MultipartFile.fromFileSync(data.path,

2
pubspec.lock

@ -746,7 +746,7 @@ packages:
name: tpns_flutter_plugin name: tpns_flutter_plugin
url: "https://pub.flutter-io.cn" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "1.1.0" version: "1.0.8"
transformer_page_view: transformer_page_view:
dependency: transitive dependency: transitive
description: description:

2
pubspec.yaml

@ -19,7 +19,7 @@ dependencies:
keframe: ^2.0.2 #滑动组件卡顿优化 keframe: ^2.0.2 #滑动组件卡顿优化
tpns_flutter_plugin: tpns_flutter_plugin: 1.0.8
# git: # git:
# url: git://github.com/TencentCloud/TPNS-Flutter-Plugin # url: git://github.com/TencentCloud/TPNS-Flutter-Plugin
# ref: V1.1.2 # ref: V1.1.2

Loading…
Cancel
Save