| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183 |
- {
- "name": "quickly-video-library",
- "displayName": "一键成片 - 视频库管理",
- "description": "查询一键成片历史视频列表,支持按 taskId、日期筛选和分页,并可记录视频下载次数。",
- "category": "video-creation",
- "version": "1.0.0",
- "endpoint": {
- "method": "POST",
- "url": "https://server.fmode.cn/api/functions",
- "headers": {
- "Content-Type": "application/json"
- }
- },
- "actions": {
- "list": {
- "description": "分页查询视频库(主操作)",
- "parameters": {
- "type": "object",
- "required": [],
- "properties": {
- "page": {
- "type": "integer",
- "description": "页码,从1开始",
- "default": 1,
- "minimum": 1
- },
- "pageSize": {
- "type": "integer",
- "description": "每页条数",
- "default": 20,
- "minimum": 1,
- "maximum": 100
- },
- "taskId": {
- "type": "string",
- "description": "按任务ID筛选,不传则查全部"
- },
- "dateStart": {
- "type": "string",
- "description": "开始日期 ISO 8601,如 '2026-03-01T00:00:00.000Z'"
- },
- "dateEnd": {
- "type": "string",
- "description": "结束日期 ISO 8601,如 '2026-03-31T23:59:59.000Z'"
- }
- }
- }
- },
- "recordDownload": {
- "description": "记录视频下载次数(用户保存视频后调用)",
- "parameters": {
- "videoId": {
- "type": "string",
- "required": true,
- "description": "视频 objectId(优先)或 preId"
- }
- }
- }
- },
- "requestTransform": {
- "description": "根据 action 构建 Parse 云函数调用参数",
- "list": {
- "body": {
- "id": "sWvRr8RvPT",
- "_ApplicationId": "ncloudmaster",
- "action": "list",
- "page": "{{page}}",
- "pageSize": "{{pageSize}}",
- "taskId": "{{taskId}}",
- "dateStart": "{{dateStart}}",
- "dateEnd": "{{dateEnd}}"
- }
- },
- "recordDownload": {
- "body": {
- "id": "sWvRr8RvPT",
- "_ApplicationId": "ncloudmaster",
- "action": "recordDownload",
- "videoId": "{{videoId}}"
- }
- }
- },
- "response": {
- "type": "object",
- "description": "视频库查询结果",
- "properties": {
- "code": {
- "type": "integer",
- "description": "200 = 成功"
- },
- "success": {
- "type": "boolean"
- },
- "total": {
- "type": "integer",
- "description": "符合筛选条件的总视频数"
- },
- "data": {
- "type": "array",
- "description": "当前页视频列表",
- "items": {
- "type": "object",
- "properties": {
- "objectId": { "type": "string", "description": "视频记录唯一ID" },
- "taskId": { "type": "string", "description": "生成任务ID" },
- "preId": { "type": "string", "description": "预定视频ID" },
- "coverUrl": { "type": "string", "description": "封面图URL" },
- "videoUrl": { "type": "string", "description": "视频播放URL(mp4)" },
- "videoName": { "type": "string", "description": "视频名称" },
- "videoDuration": { "type": "number", "description": "时长(秒)" },
- "downloadCount": { "type": "integer", "description": "全局下载次数(所有用户累计)" },
- "createdAt": { "type": "string", "description": "生成时间 ISO 8601" }
- }
- }
- }
- }
- },
- "mobileDownloadStrategy": {
- "description": "移动端保存视频到相册的策略",
- "steps": [
- {
- "priority": 1,
- "condition": "navigator.share && navigator.canShare({ files: [videoFile] })",
- "action": "调用 navigator.share() 分享视频文件",
- "onSuccess": "标记 actuallySaved=true,显示'视频已保存'",
- "onCancel": "AbortError 时 actuallySaved=false,不标记已保存"
- },
- {
- "priority": 2,
- "condition": "Share API 不可用(微信/UC/QQ浏览器等)",
- "action": "显示保存引导弹窗,播放原始视频URL(非blob URL)",
- "videoAttributes": ["controls", "autoplay", "playsinline", "webkit-playsinline", "x5-video-player-type=h5", "preload=auto"],
- "tip": "长按上方视频,选择「保存视频」即可保存到手机相册",
- "onClose": "关闭弹窗时标记已保存,调用 recordDownload",
- "warning": "必须使用原始HTTP视频URL,不能用 blob URL,否则微信长按无法触发保存"
- }
- ]
- },
- "usageExamples": [
- {
- "name": "查询所有视频(首页加载)",
- "input": {
- "action": "list",
- "page": 1,
- "pageSize": 20
- },
- "description": "加载视频库第一页"
- },
- {
- "name": "按任务ID查询视频",
- "input": {
- "action": "list",
- "taskId": "987654321"
- },
- "description": "查询指定任务生成的所有视频"
- },
- {
- "name": "按日期筛选(近7天)",
- "input": {
- "action": "list",
- "page": 1,
- "pageSize": 20,
- "dateStart": "2026-03-24T00:00:00.000Z",
- "dateEnd": "2026-03-31T23:59:59.000Z"
- },
- "description": "查询近7天的视频"
- },
- {
- "name": "记录视频下载",
- "input": {
- "action": "recordDownload",
- "videoId": "abc123objectId"
- },
- "description": "用户保存视频后调用,全局下载计数+1"
- }
- ],
- "timeout": 15000,
- "retry": {
- "maxAttempts": 3,
- "delay": 1000,
- "backoffMultiplier": 2
- }
- }
|