From 56463a77a66890de48068bd276f9ba0103fb2409 Mon Sep 17 00:00:00 2001 From: tianjiaxing Date: Tue, 22 Jun 2021 15:27:18 +0800 Subject: [PATCH] feat(App): getVideoInfo --- .../uni-app-plus/src/service/api/index.ts | 1 + .../src/service/api/media/getVideoInfo.ts | 26 +++++++++++++++++++ 2 files changed, 27 insertions(+) create mode 100644 packages/uni-app-plus/src/service/api/media/getVideoInfo.ts diff --git a/packages/uni-app-plus/src/service/api/index.ts b/packages/uni-app-plus/src/service/api/index.ts index 390d820cb1..f967da6557 100644 --- a/packages/uni-app-plus/src/service/api/index.ts +++ b/packages/uni-app-plus/src/service/api/index.ts @@ -2,3 +2,4 @@ export * from './file/getFileInfo' export * from './device/compass' export * from './device/vibrate' export * from './media/getImageInfo' +export * from './media/getVideoInfo' diff --git a/packages/uni-app-plus/src/service/api/media/getVideoInfo.ts b/packages/uni-app-plus/src/service/api/media/getVideoInfo.ts new file mode 100644 index 0000000000..4af5437703 --- /dev/null +++ b/packages/uni-app-plus/src/service/api/media/getVideoInfo.ts @@ -0,0 +1,26 @@ +import { extend } from '@vue/shared' +import { + defineAsyncApi, + API_GET_VIDEO_INFO, + API_TYPE_GET_VIDEO_INFO, + GetVideoInfoOptions, + GetVideoInfoProtocol, +} from '@dcloudio/uni-api' +import { + warpPlusSuccessCallback, + warpPlusErrorCallback, +} from '../../../helpers/plus' + +export const getVideoInfo = defineAsyncApi( + API_GET_VIDEO_INFO, + (options, { resolve, reject }) => { + plus.io.getVideoInfo( + extend(options, { + success: warpPlusSuccessCallback(resolve), + fail: warpPlusErrorCallback(reject), + }) + ) + }, + GetVideoInfoProtocol, + GetVideoInfoOptions +) -- GitLab