mirror of
https://github.com/NapNeko/NapCatQQ.git
synced 2024-11-21 09:36:35 +00:00
refactor: video element
This commit is contained in:
parent
ce7deac2dd
commit
98214aa429
@ -203,7 +203,8 @@ export class OB11Constructor {
|
||||
}
|
||||
else if (element.videoElement) {
|
||||
const videoElement: VideoElement = element.videoElement;
|
||||
let videoUrl;
|
||||
//读取视频链接并兜底
|
||||
let videoUrl;//Array
|
||||
try {
|
||||
videoUrl = await NTQQFileApi.getVideoUrl({
|
||||
chatType: msg.chatType,
|
||||
@ -213,7 +214,19 @@ export class OB11Constructor {
|
||||
} catch (error) {
|
||||
videoUrl = undefined;
|
||||
}
|
||||
const videoDownUrl = videoUrl ? videoUrl : videoElement.filePath;
|
||||
//读取在线URL
|
||||
let videoDownUrl = undefined;
|
||||
|
||||
if (videoUrl) {
|
||||
let videoDownUrlTemp = videoUrl.find((url) => { if (url.url) { return true; } return false; });
|
||||
if (videoDownUrlTemp) {
|
||||
videoDownUrl = videoDownUrlTemp.url;
|
||||
}
|
||||
}
|
||||
//开始兜底
|
||||
if (!videoDownUrl) {
|
||||
videoDownUrl = videoElement.filePath;
|
||||
}
|
||||
message_data['type'] = OB11MessageDataType.video;
|
||||
message_data['data']['file'] = videoElement.fileName;
|
||||
message_data['data']['path'] = videoDownUrl;
|
||||
|
Loading…
x
Reference in New Issue
Block a user