Skip to content

Commit

Permalink
feature: add ShortVideo message support (#2739)
Browse files Browse the repository at this point in the history
* initial support for ShortVideo message

* dump api

* [core] upload protocol

* [core] short video upload event

* [core] doc

* [core] protocol

* [core] fix mp4 file check

* [core] extract fileName from `OnlineShortVideo` to `ShortVideo`

* [core] ShortVideo.Builder

* [core] mirai code support for `ShortVideo`

* [core] add doc for OnlineShortVideo and OfflineShortVideo

* [core] fix text

* dump api

* update `Contact.uploadShortVideo`·` doc

* [core] remove mirai code support for ShortVideo

* [core] ensure Mirai service is loaded before load other services

* [core] introduce `CombinedExternalResource` to reference multiple external resources for combined calculation.

* [core] move refine context key defined in `OnlineShortVideoMsgInternal` to `RefineContext`

* [core] remove data class

* [core] broadcast `ShortVideoUploadEvent.Failed` event

* [core] warn when cannot determine fromId

* [core] add `contentToString` and `toString` for `OnlineShortVideoMsgInternal`

* [core] optimize imports

* [core] import

* [core] revert

* [core] doc

* [core] auto close resource

* dump api

* keep consistence of param name

* update doc

* move Builder to OfflineShortVideo

* optimize RefineContext

* RefineContext.merge

* dump api

* fix test

* show more video info

* optimize constructor and builder of offline short video

* optimize thumbnail

* move thumbnail to main constructor arg

* dump api

* avoid null cast exception.

* combine format transition

* cleanup
  • Loading branch information
StageGuard authored Aug 20, 2023
1 parent c4815c9 commit 5b3e508
Show file tree
Hide file tree
Showing 38 changed files with 1,893 additions and 39 deletions.
96 changes: 96 additions & 0 deletions mirai-core-api/compatibility-validation/android/api/android.api
Original file line number Diff line number Diff line change
Expand Up @@ -366,6 +366,10 @@ public abstract interface class net/mamoe/mirai/contact/Contact : kotlinx/corout
public static fun uploadImage (Lnet/mamoe/mirai/contact/Contact;Lnet/mamoe/mirai/utils/ExternalResource;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
public fun uploadImage (Lnet/mamoe/mirai/utils/ExternalResource;)Lnet/mamoe/mirai/message/data/Image;
public abstract fun uploadImage (Lnet/mamoe/mirai/utils/ExternalResource;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
public fun uploadShortVideo (Lnet/mamoe/mirai/utils/ExternalResource;Lnet/mamoe/mirai/utils/ExternalResource;Ljava/lang/String;)Lnet/mamoe/mirai/message/data/ShortVideo;
public abstract fun uploadShortVideo (Lnet/mamoe/mirai/utils/ExternalResource;Lnet/mamoe/mirai/utils/ExternalResource;Ljava/lang/String;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
public static synthetic fun uploadShortVideo$default (Lnet/mamoe/mirai/contact/Contact;Lnet/mamoe/mirai/utils/ExternalResource;Lnet/mamoe/mirai/utils/ExternalResource;Ljava/lang/String;ILjava/lang/Object;)Lnet/mamoe/mirai/message/data/ShortVideo;
public static synthetic fun uploadShortVideo$default (Lnet/mamoe/mirai/contact/Contact;Lnet/mamoe/mirai/utils/ExternalResource;Lnet/mamoe/mirai/utils/ExternalResource;Ljava/lang/String;Lkotlin/coroutines/Continuation;ILjava/lang/Object;)Ljava/lang/Object;
}

public final class net/mamoe/mirai/contact/Contact$Companion {
Expand Down Expand Up @@ -1888,6 +1892,13 @@ public final class net/mamoe/mirai/event/events/BeforeImageUploadEvent : net/mam
public fun toString ()Ljava/lang/String;
}

public final class net/mamoe/mirai/event/events/BeforeShortVideoUploadEvent : net/mamoe/mirai/event/AbstractEvent, net/mamoe/mirai/event/CancellableEvent, net/mamoe/mirai/event/events/BotActiveEvent, net/mamoe/mirai/event/events/BotEvent, net/mamoe/mirai/internal/event/VerboseEvent {
public fun getBot ()Lnet/mamoe/mirai/Bot;
public final fun getTarget ()Lnet/mamoe/mirai/contact/Contact;
public final fun getThumbnailSource ()Lnet/mamoe/mirai/utils/ExternalResource;
public final fun getVideoSource ()Lnet/mamoe/mirai/utils/ExternalResource;
}

public abstract interface class net/mamoe/mirai/event/events/BotActiveEvent : net/mamoe/mirai/event/events/BotEvent {
}

Expand Down Expand Up @@ -2948,6 +2959,30 @@ public final class net/mamoe/mirai/event/events/OtherClientOnlineEvent : net/mam
public fun toString ()Ljava/lang/String;
}

public abstract class net/mamoe/mirai/event/events/ShortVideoUploadEvent : net/mamoe/mirai/event/AbstractEvent, net/mamoe/mirai/event/events/BotActiveEvent, net/mamoe/mirai/event/events/BotEvent, net/mamoe/mirai/internal/event/VerboseEvent {
public fun getBot ()Lnet/mamoe/mirai/Bot;
public abstract fun getTarget ()Lnet/mamoe/mirai/contact/Contact;
public abstract fun getThumbnailSource ()Lnet/mamoe/mirai/utils/ExternalResource;
public abstract fun getVideoSource ()Lnet/mamoe/mirai/utils/ExternalResource;
}

public final class net/mamoe/mirai/event/events/ShortVideoUploadEvent$Failed : net/mamoe/mirai/event/events/ShortVideoUploadEvent {
public final fun getErrno ()I
public final fun getMessage ()Ljava/lang/String;
public fun getTarget ()Lnet/mamoe/mirai/contact/Contact;
public fun getThumbnailSource ()Lnet/mamoe/mirai/utils/ExternalResource;
public fun getVideoSource ()Lnet/mamoe/mirai/utils/ExternalResource;
public fun toString ()Ljava/lang/String;
}

public final class net/mamoe/mirai/event/events/ShortVideoUploadEvent$Succeed : net/mamoe/mirai/event/events/ShortVideoUploadEvent {
public fun getTarget ()Lnet/mamoe/mirai/contact/Contact;
public fun getThumbnailSource ()Lnet/mamoe/mirai/utils/ExternalResource;
public final fun getVideo ()Lnet/mamoe/mirai/message/data/ShortVideo;
public fun getVideoSource ()Lnet/mamoe/mirai/utils/ExternalResource;
public fun toString ()Ljava/lang/String;
}

public final class net/mamoe/mirai/event/events/SignEvent : net/mamoe/mirai/event/AbstractEvent, net/mamoe/mirai/event/events/BotEvent, net/mamoe/mirai/internal/network/Packet {
public fun getBot ()Lnet/mamoe/mirai/Bot;
public final fun getRank ()Ljava/lang/Integer;
Expand Down Expand Up @@ -4830,6 +4865,39 @@ public abstract class net/mamoe/mirai/message/data/OfflineMessageSource : net/ma
public final class net/mamoe/mirai/message/data/OfflineMessageSource$Key : net/mamoe/mirai/message/data/AbstractPolymorphicMessageKey {
}

public abstract interface class net/mamoe/mirai/message/data/OfflineShortVideo : net/mamoe/mirai/message/data/ShortVideo {
public static final field Key Lnet/mamoe/mirai/message/data/OfflineShortVideo$Key;
public static final field SERIAL_NAME Ljava/lang/String;
}

public final class net/mamoe/mirai/message/data/OfflineShortVideo$Builder {
public static final field Companion Lnet/mamoe/mirai/message/data/OfflineShortVideo$Builder$Companion;
public final fun build ()Lnet/mamoe/mirai/message/data/OfflineShortVideo;
public final fun getFileFormat ()Ljava/lang/String;
public final fun getFileMd5 ()[B
public final fun getFileName ()Ljava/lang/String;
public final fun getFileSize ()J
public final fun getThumbnailMd5 ()[B
public final fun getThumbnailSize ()J
public final fun getVideoId ()Ljava/lang/String;
public static final fun newBuilder (Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;[BJ)Lnet/mamoe/mirai/message/data/OfflineShortVideo$Builder;
public final fun setFileFormat (Ljava/lang/String;)V
public final fun setFileMd5 ([B)V
public final fun setFileName (Ljava/lang/String;)V
public final fun setFileSize (J)V
public final fun setThumbnailMd5 ([B)V
public final fun setThumbnailSize (J)V
public final fun setVideoId (Ljava/lang/String;)V
}

public final class net/mamoe/mirai/message/data/OfflineShortVideo$Builder$Companion {
public final fun newBuilder (Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;[BJ)Lnet/mamoe/mirai/message/data/OfflineShortVideo$Builder;
}

public final class net/mamoe/mirai/message/data/OfflineShortVideo$Key : net/mamoe/mirai/message/data/AbstractPolymorphicMessageKey {
public static final field SERIAL_NAME Ljava/lang/String;
}

public abstract interface class net/mamoe/mirai/message/data/OnlineAudio : net/mamoe/mirai/message/data/Audio {
public static final field Key Lnet/mamoe/mirai/message/data/OnlineAudio$Key;
public static final field SERIAL_NAME Ljava/lang/String;
Expand Down Expand Up @@ -4978,6 +5046,16 @@ public abstract class net/mamoe/mirai/message/data/OnlineMessageSource$Outgoing$
public final class net/mamoe/mirai/message/data/OnlineMessageSource$Outgoing$ToTemp$Key : net/mamoe/mirai/message/data/AbstractPolymorphicMessageKey {
}

public abstract interface class net/mamoe/mirai/message/data/OnlineShortVideo : net/mamoe/mirai/message/data/ShortVideo {
public static final field Key Lnet/mamoe/mirai/message/data/OnlineShortVideo$Key;
public static final field SERIAL_NAME Ljava/lang/String;
public abstract fun getUrlForDownload ()Ljava/lang/String;
}

public final class net/mamoe/mirai/message/data/OnlineShortVideo$Key : net/mamoe/mirai/message/data/AbstractPolymorphicMessageKey {
public static final field SERIAL_NAME Ljava/lang/String;
}

public final class net/mamoe/mirai/message/data/OrNullDelegate {
public static final synthetic fun box-impl (Ljava/lang/Object;)Lnet/mamoe/mirai/message/data/OrNullDelegate;
public static fun constructor-impl (Ljava/lang/Object;)Ljava/lang/Object;
Expand Down Expand Up @@ -5223,6 +5301,24 @@ public abstract interface class net/mamoe/mirai/message/data/ServiceMessage : ne
public final class net/mamoe/mirai/message/data/ServiceMessage$Key : net/mamoe/mirai/message/data/AbstractPolymorphicMessageKey {
}

public abstract interface class net/mamoe/mirai/message/data/ShortVideo : net/mamoe/mirai/message/data/ConstrainSingle, net/mamoe/mirai/message/data/MessageContent {
public static final field Key Lnet/mamoe/mirai/message/data/ShortVideo$Key;
public abstract fun getFileFormat ()Ljava/lang/String;
public abstract fun getFileMd5 ()[B
public abstract fun getFileSize ()J
public abstract fun getFilename ()Ljava/lang/String;
public fun getKey ()Lnet/mamoe/mirai/message/data/MessageKey;
public abstract fun getVideoId ()Ljava/lang/String;
}

public final class net/mamoe/mirai/message/data/ShortVideo$Key : net/mamoe/mirai/message/data/AbstractPolymorphicMessageKey {
}

public final class net/mamoe/mirai/message/data/ShortVideoKt {
public static final synthetic fun OfflineShortVideo (Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;[BJ[BJ)Lnet/mamoe/mirai/message/data/OfflineShortVideo;
public static synthetic fun OfflineShortVideo$default (Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;[BJ[BJILjava/lang/Object;)Lnet/mamoe/mirai/message/data/OfflineShortVideo;
}

public final class net/mamoe/mirai/message/data/ShowImageFlag : net/mamoe/mirai/message/data/AbstractMessageKey, net/mamoe/mirai/message/data/ConstrainSingle, net/mamoe/mirai/message/data/MessageMetadata {
public static final field INSTANCE Lnet/mamoe/mirai/message/data/ShowImageFlag;
public static final field SERIAL_NAME Ljava/lang/String;
Expand Down
96 changes: 96 additions & 0 deletions mirai-core-api/compatibility-validation/jvm/api/jvm.api
Original file line number Diff line number Diff line change
Expand Up @@ -366,6 +366,10 @@ public abstract interface class net/mamoe/mirai/contact/Contact : kotlinx/corout
public static fun uploadImage (Lnet/mamoe/mirai/contact/Contact;Lnet/mamoe/mirai/utils/ExternalResource;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
public fun uploadImage (Lnet/mamoe/mirai/utils/ExternalResource;)Lnet/mamoe/mirai/message/data/Image;
public abstract fun uploadImage (Lnet/mamoe/mirai/utils/ExternalResource;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
public fun uploadShortVideo (Lnet/mamoe/mirai/utils/ExternalResource;Lnet/mamoe/mirai/utils/ExternalResource;Ljava/lang/String;)Lnet/mamoe/mirai/message/data/ShortVideo;
public abstract fun uploadShortVideo (Lnet/mamoe/mirai/utils/ExternalResource;Lnet/mamoe/mirai/utils/ExternalResource;Ljava/lang/String;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
public static synthetic fun uploadShortVideo$default (Lnet/mamoe/mirai/contact/Contact;Lnet/mamoe/mirai/utils/ExternalResource;Lnet/mamoe/mirai/utils/ExternalResource;Ljava/lang/String;ILjava/lang/Object;)Lnet/mamoe/mirai/message/data/ShortVideo;
public static synthetic fun uploadShortVideo$default (Lnet/mamoe/mirai/contact/Contact;Lnet/mamoe/mirai/utils/ExternalResource;Lnet/mamoe/mirai/utils/ExternalResource;Ljava/lang/String;Lkotlin/coroutines/Continuation;ILjava/lang/Object;)Ljava/lang/Object;
}

public final class net/mamoe/mirai/contact/Contact$Companion {
Expand Down Expand Up @@ -1888,6 +1892,13 @@ public final class net/mamoe/mirai/event/events/BeforeImageUploadEvent : net/mam
public fun toString ()Ljava/lang/String;
}

public final class net/mamoe/mirai/event/events/BeforeShortVideoUploadEvent : net/mamoe/mirai/event/AbstractEvent, net/mamoe/mirai/event/CancellableEvent, net/mamoe/mirai/event/events/BotActiveEvent, net/mamoe/mirai/event/events/BotEvent, net/mamoe/mirai/internal/event/VerboseEvent {
public fun getBot ()Lnet/mamoe/mirai/Bot;
public final fun getTarget ()Lnet/mamoe/mirai/contact/Contact;
public final fun getThumbnailSource ()Lnet/mamoe/mirai/utils/ExternalResource;
public final fun getVideoSource ()Lnet/mamoe/mirai/utils/ExternalResource;
}

public abstract interface class net/mamoe/mirai/event/events/BotActiveEvent : net/mamoe/mirai/event/events/BotEvent {
}

Expand Down Expand Up @@ -2948,6 +2959,30 @@ public final class net/mamoe/mirai/event/events/OtherClientOnlineEvent : net/mam
public fun toString ()Ljava/lang/String;
}

public abstract class net/mamoe/mirai/event/events/ShortVideoUploadEvent : net/mamoe/mirai/event/AbstractEvent, net/mamoe/mirai/event/events/BotActiveEvent, net/mamoe/mirai/event/events/BotEvent, net/mamoe/mirai/internal/event/VerboseEvent {
public fun getBot ()Lnet/mamoe/mirai/Bot;
public abstract fun getTarget ()Lnet/mamoe/mirai/contact/Contact;
public abstract fun getThumbnailSource ()Lnet/mamoe/mirai/utils/ExternalResource;
public abstract fun getVideoSource ()Lnet/mamoe/mirai/utils/ExternalResource;
}

public final class net/mamoe/mirai/event/events/ShortVideoUploadEvent$Failed : net/mamoe/mirai/event/events/ShortVideoUploadEvent {
public final fun getErrno ()I
public final fun getMessage ()Ljava/lang/String;
public fun getTarget ()Lnet/mamoe/mirai/contact/Contact;
public fun getThumbnailSource ()Lnet/mamoe/mirai/utils/ExternalResource;
public fun getVideoSource ()Lnet/mamoe/mirai/utils/ExternalResource;
public fun toString ()Ljava/lang/String;
}

public final class net/mamoe/mirai/event/events/ShortVideoUploadEvent$Succeed : net/mamoe/mirai/event/events/ShortVideoUploadEvent {
public fun getTarget ()Lnet/mamoe/mirai/contact/Contact;
public fun getThumbnailSource ()Lnet/mamoe/mirai/utils/ExternalResource;
public final fun getVideo ()Lnet/mamoe/mirai/message/data/ShortVideo;
public fun getVideoSource ()Lnet/mamoe/mirai/utils/ExternalResource;
public fun toString ()Ljava/lang/String;
}

public final class net/mamoe/mirai/event/events/SignEvent : net/mamoe/mirai/event/AbstractEvent, net/mamoe/mirai/event/events/BotEvent, net/mamoe/mirai/internal/network/Packet {
public fun getBot ()Lnet/mamoe/mirai/Bot;
public final fun getRank ()Ljava/lang/Integer;
Expand Down Expand Up @@ -4830,6 +4865,39 @@ public abstract class net/mamoe/mirai/message/data/OfflineMessageSource : net/ma
public final class net/mamoe/mirai/message/data/OfflineMessageSource$Key : net/mamoe/mirai/message/data/AbstractPolymorphicMessageKey {
}

public abstract interface class net/mamoe/mirai/message/data/OfflineShortVideo : net/mamoe/mirai/message/data/ShortVideo {
public static final field Key Lnet/mamoe/mirai/message/data/OfflineShortVideo$Key;
public static final field SERIAL_NAME Ljava/lang/String;
}

public final class net/mamoe/mirai/message/data/OfflineShortVideo$Builder {
public static final field Companion Lnet/mamoe/mirai/message/data/OfflineShortVideo$Builder$Companion;
public final fun build ()Lnet/mamoe/mirai/message/data/OfflineShortVideo;
public final fun getFileFormat ()Ljava/lang/String;
public final fun getFileMd5 ()[B
public final fun getFileName ()Ljava/lang/String;
public final fun getFileSize ()J
public final fun getThumbnailMd5 ()[B
public final fun getThumbnailSize ()J
public final fun getVideoId ()Ljava/lang/String;
public static final fun newBuilder (Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;[BJ)Lnet/mamoe/mirai/message/data/OfflineShortVideo$Builder;
public final fun setFileFormat (Ljava/lang/String;)V
public final fun setFileMd5 ([B)V
public final fun setFileName (Ljava/lang/String;)V
public final fun setFileSize (J)V
public final fun setThumbnailMd5 ([B)V
public final fun setThumbnailSize (J)V
public final fun setVideoId (Ljava/lang/String;)V
}

public final class net/mamoe/mirai/message/data/OfflineShortVideo$Builder$Companion {
public final fun newBuilder (Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;[BJ)Lnet/mamoe/mirai/message/data/OfflineShortVideo$Builder;
}

public final class net/mamoe/mirai/message/data/OfflineShortVideo$Key : net/mamoe/mirai/message/data/AbstractPolymorphicMessageKey {
public static final field SERIAL_NAME Ljava/lang/String;
}

public abstract interface class net/mamoe/mirai/message/data/OnlineAudio : net/mamoe/mirai/message/data/Audio {
public static final field Key Lnet/mamoe/mirai/message/data/OnlineAudio$Key;
public static final field SERIAL_NAME Ljava/lang/String;
Expand Down Expand Up @@ -4978,6 +5046,16 @@ public abstract class net/mamoe/mirai/message/data/OnlineMessageSource$Outgoing$
public final class net/mamoe/mirai/message/data/OnlineMessageSource$Outgoing$ToTemp$Key : net/mamoe/mirai/message/data/AbstractPolymorphicMessageKey {
}

public abstract interface class net/mamoe/mirai/message/data/OnlineShortVideo : net/mamoe/mirai/message/data/ShortVideo {
public static final field Key Lnet/mamoe/mirai/message/data/OnlineShortVideo$Key;
public static final field SERIAL_NAME Ljava/lang/String;
public abstract fun getUrlForDownload ()Ljava/lang/String;
}

public final class net/mamoe/mirai/message/data/OnlineShortVideo$Key : net/mamoe/mirai/message/data/AbstractPolymorphicMessageKey {
public static final field SERIAL_NAME Ljava/lang/String;
}

public final class net/mamoe/mirai/message/data/OrNullDelegate {
public static final synthetic fun box-impl (Ljava/lang/Object;)Lnet/mamoe/mirai/message/data/OrNullDelegate;
public static fun constructor-impl (Ljava/lang/Object;)Ljava/lang/Object;
Expand Down Expand Up @@ -5223,6 +5301,24 @@ public abstract interface class net/mamoe/mirai/message/data/ServiceMessage : ne
public final class net/mamoe/mirai/message/data/ServiceMessage$Key : net/mamoe/mirai/message/data/AbstractPolymorphicMessageKey {
}

public abstract interface class net/mamoe/mirai/message/data/ShortVideo : net/mamoe/mirai/message/data/ConstrainSingle, net/mamoe/mirai/message/data/MessageContent {
public static final field Key Lnet/mamoe/mirai/message/data/ShortVideo$Key;
public abstract fun getFileFormat ()Ljava/lang/String;
public abstract fun getFileMd5 ()[B
public abstract fun getFileSize ()J
public abstract fun getFilename ()Ljava/lang/String;
public fun getKey ()Lnet/mamoe/mirai/message/data/MessageKey;
public abstract fun getVideoId ()Ljava/lang/String;
}

public final class net/mamoe/mirai/message/data/ShortVideo$Key : net/mamoe/mirai/message/data/AbstractPolymorphicMessageKey {
}

public final class net/mamoe/mirai/message/data/ShortVideoKt {
public static final synthetic fun OfflineShortVideo (Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;[BJ[BJ)Lnet/mamoe/mirai/message/data/OfflineShortVideo;
public static synthetic fun OfflineShortVideo$default (Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;[BJ[BJILjava/lang/Object;)Lnet/mamoe/mirai/message/data/OfflineShortVideo;
}

public final class net/mamoe/mirai/message/data/ShowImageFlag : net/mamoe/mirai/message/data/AbstractMessageKey, net/mamoe/mirai/message/data/ConstrainSingle, net/mamoe/mirai/message/data/MessageMetadata {
public static final field INSTANCE Lnet/mamoe/mirai/message/data/ShowImageFlag;
public static final field SERIAL_NAME Ljava/lang/String;
Expand Down
22 changes: 20 additions & 2 deletions mirai-core-api/src/commonMain/kotlin/contact/Contact.kt
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,6 @@ public interface Contact : ContactOrBot, CoroutineScope {
/**
* 上传一个 [资源][ExternalResource] 作为图片以备发送.
*
* **无论上传是否成功都不会关闭 [resource]. 需要调用方手动关闭资源**
*
* 也可以使用其他扩展: [ExternalResource.uploadAsImage] 使用 [File], [InputStream] 等上传.
*
* @see Image 查看有关图片的更多信息, 如上传图片
Expand All @@ -88,6 +86,26 @@ public interface Contact : ContactOrBot, CoroutineScope {
*/
public suspend fun uploadImage(resource: ExternalResource): Image

/**
* 上传 [资源][ExternalResource] 作为短视频发送.
* 同时需要上传缩略图作为视频消息显示的封面.
*
* @see ShortVideo 查看有关短视频的更多信息
*
* @see BeforeShortVideoUploadEvent 短视频发送前事件,可通过中断来拦截视频上传.
* @see ShortVideoUploadEvent 短视频上传完成事件,不可拦截.
*
* @param thumbnail 短视频封面图,为图片资源.
* @param video 视频资源,目前仅支持上传 mp4 格式的视频.
* @param fileName 文件名,若为 `null` 则根据 [video] 自动生成.
*/
public suspend fun uploadShortVideo(
thumbnail: ExternalResource,
video: ExternalResource,
fileName: String? = null
): ShortVideo

@JvmBlockingBridge
public companion object {
/**
* 读取 [InputStream] 到临时文件并将其作为图片发送到指定联系人
Expand Down
Loading

0 comments on commit 5b3e508

Please sign in to comment.