cannot share local video

This commit is contained in:
an-lee
2024-01-13 16:13:51 +08:00
parent 8d42c4c626
commit 80fe9caa90
3 changed files with 10 additions and 0 deletions

View File

@@ -338,6 +338,7 @@
"areYouSureToShareThisAudioToCommunity": "Are you sure to share this audio to community?",
"shareVideo": "Share video",
"sharedVideo": "Shared a video resource",
"cannotShareLocalVideo": "Cannot share local video",
"areYouSureToShareThisVideoToCommunity": "Are you sure to share this video to community?",
"sharePrompt": "Share prompt",
"sharedPrompt": "Shared a prompt",

View File

@@ -338,6 +338,7 @@
"areYouSureToShareThisAudioToCommunity": "您确定要分享此音频到社区吗?",
"shareVideo": "分享视频",
"sharedVideo": "分享了一个视频材料",
"cannotShareLocalVideo": "无法分享本地视频",
"areYouSureToShareThisVideoToCommunity": "您确定要分享此视频到社区吗?",
"sharePrompt": "分享提示语",
"sharedPrompt": "分享了一条提示语",

View File

@@ -60,6 +60,14 @@ export const VideoDetail = (props: { id?: string; md5?: string }) => {
};
const handleShare = async () => {
if (!video.source.startsWith("http")) {
toast({
title: t("shareFailed"),
description: t("cannotShareLocalVideo"),
});
return;
}
if (!video.source && !video.isUploaded) {
try {
await EnjoyApp.videos.upload(video.id);