Commit a6391c5a by tanghuan

上传视频时,请求obs生成封面

1 parent b4b90ea3
import 'dart:convert';
import 'dart:io'; import 'dart:io';
import 'package:appframe/config/constant.dart'; import 'package:appframe/config/constant.dart';
...@@ -188,9 +189,9 @@ class UploadFileHandler extends MessageHandler { ...@@ -188,9 +189,9 @@ class UploadFileHandler extends MessageHandler {
/// ///
/// 8 针对视频生成封面 /// 8 针对视频生成封面
/// ///
// if (mimeType?.startsWith('video/') ?? false) { if (mimeType?.startsWith('video/') ?? false) {
// await _genHwVideoCover(dio, objectKey); await _genHwVideoCover(dio, objectKey);
// } }
dio.close(force: true); dio.close(force: true);
bxeApiService.close(); bxeApiService.close();
...@@ -334,15 +335,16 @@ class UploadFileHandler extends MessageHandler { ...@@ -334,15 +335,16 @@ class UploadFileHandler extends MessageHandler {
"api-key": 'FJ9qv53Bxp', "api-key": 'FJ9qv53Bxp',
}; };
var params = { var params = {
"videoKeys": keys, "videoKeys": [keys],
"outputSuffix": "_p1", "outputSuffix": "_p1",
}; };
await dio.post( await dio.post(
'$_genBaseUrl/go/mpc/create_covers', '$_genBaseUrl/go/mpc/create_covers',
data: params, data: jsonEncode(params),
options: Options( options: Options(
headers: headers, headers: headers,
contentType: 'application/json', contentType: 'application/json',
responseType: ResponseType.json,
), ),
); );
} catch (e) { } catch (e) {
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!