Skip to content

操作权限速查 ​

适用读者 编写操作 Hook 或调用工具的作者。前置条件 已运行播放规则模板。学习目标 查清拦截、观察和主动调用各自的权限。预计 6 分钟。

在插件的 manifest.uses.permissions 声明表中的权限,用户授权后才可使用相应接口。拦截使用 ctx.hooks.on,完成事件使用 ctx.events.on(在操作名末尾加 :done)。可主动调用的操作见最后一列,传给 ctx.app.call 的 permissionKey 是项目给权限声明选的键。表中「宿主入口」表示该项由宿主场景触发。

时限是每个处理器的执行预算。对能调用 next 的处理器,等待下游执行的时间另计。输入满足 TypeScript 类型后,仍需满足每项操作的限制,例如删除歌单不能把目标换成其他歌单,歌词不能改变所属歌曲。

操作拦截权限完成事件权限可取消处理器时限主动调用权限
player.playplayer.interceptplayer.read是800 msplayer.control
queue.addplayer.interceptplayer.read是800 msplayer.control
queue.removeplayer.interceptplayer.read是800 msplayer.control
queue.clearplayer.interceptplayer.read是800 msplayer.control
queue.shuffleplayer.interceptplayer.read否800 ms宿主入口
player.pauseplayer.interceptplayer.read是800 msplayer.control
player.resumeplayer.interceptplayer.read是800 msplayer.control
player.previousplayer.interceptplayer.read是800 msplayer.control
player.nextplayer.interceptplayer.read是800 msplayer.control
player.errorplayer.interceptplayer.read是800 ms宿主入口
player.queueEndedplayer.interceptplayer.read是800 ms宿主入口
player.setModeplayer.interceptplayer.read是800 msplayer.control
player.seekplayer.interceptplayer.read否800 msplayer.control
player.setVolumeplayer.interceptplayer.read否800 msplayer.control
player.resolveplayer.interceptplayer.read否800 ms宿主入口
account.switchaccount.interceptaccount.profile是3000 ms宿主入口
search.querysearch.interceptsearch.read是800 ms宿主入口
search.suggestsearch.interceptsearch.read否800 ms宿主入口
search.resultssearch.interceptsearch.read否800 ms宿主入口
track.likelibrary.interceptlibrary.read是800 mslibrary.write
playlist.createlibrary.interceptlibrary.read是3000 mslibrary.write
playlist.deletelibrary.interceptlibrary.read是3000 mslibrary.delete
playlist.addTrackslibrary.interceptlibrary.read是3000 mslibrary.write
playlist.removeTrackslibrary.interceptlibrary.read是3000 mslibrary.delete
playlist.exportlibrary.interceptlibrary.read是3000 mslibrary.read
playlist.importlibrary.interceptlibrary.read是3000 mslibrary.write
window.closewindow.interceptwindow.read是800 mswindow.control
lyrics.loadlyrics.interceptplayer.read否3000 ms宿主入口
lyrics.transformlyrics.interceptplayer.read否3000 ms宿主入口
download.createdownloads.interceptdownloads.manage是3000 msdownloads.create
download.filenamedownloads.interceptdownloads.manage否3000 ms宿主入口
share.createsharing.interceptmusic.read是3000 mssharing.publish
link.openlinks.interceptlinks.read是3000 msexternal.open
notification.shownotifications.interceptnotifications.read是3000 ms无需额外权限

输入和结果的完整 JSON Schema 见 3.0.0 操作目录。实际宿主是否触发还取决于版本和具体调用入口。第一次写处理器按实战教程练习。

查询每个操作的输入与结果 ​

展开操作名,查看当前版本对应的输入和返回约束。required 中的字段必填,enum 列出允许值,minimum、maximum 等字段给出边界。输入属于本次操作;涉及私有曲目时请保留本轮句柄。只由宿主触发的操作也可以用下面的 schema 编写 Hook 测试。

player.play 播放指定歌曲

输入

{
  "type": "object",
  "properties": {
    "track": {
      "type": "object",
      "properties": {
        "ref": {
          "type": "object",
          "properties": {
            "kind": {
              "const": "track"
            },
            "providerId": {
              "type": "string",
              "minLength": 1,
              "maxLength": 128,
              "pattern": "^[A-Za-z0-9._-]+$"
            },
            "id": {
              "type": "string",
              "minLength": 1,
              "maxLength": 512
            }
          },
          "required": [
            "kind",
            "providerId",
            "id"
          ],
          "additionalProperties": false
        },
        "title": {
          "type": "string",
          "minLength": 0,
          "maxLength": 512
        },
        "metadata": {
          "type": "object",
          "properties": {
            "artists": {
              "type": "array",
              "items": {
                "type": "string",
                "minLength": 0,
                "maxLength": 256
              },
              "maxItems": 32
            }
          },
          "required": [
            "artists"
          ],
          "additionalProperties": false
        }
      },
      "required": [
        "ref",
        "title",
        "metadata"
      ],
      "additionalProperties": false
    },
    "queueIndex": {
      "type": "integer",
      "minimum": 0,
      "maximum": 9007199254740991
    }
  },
  "required": [
    "track"
  ],
  "additionalProperties": false
}

返回

{
  "type": "null"
}
queue.add 添加歌曲到播放队列

输入

{
  "type": "object",
  "properties": {
    "tracks": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "ref": {
            "type": "object",
            "properties": {
              "kind": {
                "const": "track"
              },
              "providerId": {
                "type": "string",
                "minLength": 1,
                "maxLength": 128,
                "pattern": "^[A-Za-z0-9._-]+$"
              },
              "id": {
                "type": "string",
                "minLength": 1,
                "maxLength": 512
              }
            },
            "required": [
              "kind",
              "providerId",
              "id"
            ],
            "additionalProperties": false
          },
          "title": {
            "type": "string",
            "minLength": 0,
            "maxLength": 512
          },
          "metadata": {
            "type": "object",
            "properties": {
              "artists": {
                "type": "array",
                "items": {
                  "type": "string",
                  "minLength": 0,
                  "maxLength": 256
                },
                "maxItems": 32
              }
            },
            "required": [
              "artists"
            ],
            "additionalProperties": false
          }
        },
        "required": [
          "ref",
          "title",
          "metadata"
        ],
        "additionalProperties": false
      },
      "maxItems": 1000,
      "minItems": 1
    },
    "position": {
      "type": "string",
      "enum": [
        "next",
        "end"
      ]
    }
  },
  "required": [
    "tracks",
    "position"
  ],
  "additionalProperties": false
}

返回

{
  "type": "null"
}
queue.remove 从播放队列移除歌曲

输入

{
  "type": "object",
  "properties": {
    "tracks": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "ref": {
            "type": "object",
            "properties": {
              "kind": {
                "const": "track"
              },
              "providerId": {
                "type": "string",
                "minLength": 1,
                "maxLength": 128,
                "pattern": "^[A-Za-z0-9._-]+$"
              },
              "id": {
                "type": "string",
                "minLength": 1,
                "maxLength": 512
              }
            },
            "required": [
              "kind",
              "providerId",
              "id"
            ],
            "additionalProperties": false
          },
          "title": {
            "type": "string",
            "minLength": 0,
            "maxLength": 512
          },
          "metadata": {
            "type": "object",
            "properties": {
              "artists": {
                "type": "array",
                "items": {
                  "type": "string",
                  "minLength": 0,
                  "maxLength": 256
                },
                "maxItems": 32
              }
            },
            "required": [
              "artists"
            ],
            "additionalProperties": false
          }
        },
        "required": [
          "ref",
          "title",
          "metadata"
        ],
        "additionalProperties": false
      },
      "maxItems": 1000
    }
  },
  "required": [
    "tracks"
  ],
  "additionalProperties": false
}

返回

{
  "type": "null"
}
queue.clear 清空播放队列

输入

{
  "type": "object",
  "properties": {
    "tracks": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "ref": {
            "type": "object",
            "properties": {
              "kind": {
                "const": "track"
              },
              "providerId": {
                "type": "string",
                "minLength": 1,
                "maxLength": 128,
                "pattern": "^[A-Za-z0-9._-]+$"
              },
              "id": {
                "type": "string",
                "minLength": 1,
                "maxLength": 512
              }
            },
            "required": [
              "kind",
              "providerId",
              "id"
            ],
            "additionalProperties": false
          },
          "title": {
            "type": "string",
            "minLength": 0,
            "maxLength": 512
          },
          "metadata": {
            "type": "object",
            "properties": {
              "artists": {
                "type": "array",
                "items": {
                  "type": "string",
                  "minLength": 0,
                  "maxLength": 256
                },
                "maxItems": 32
              }
            },
            "required": [
              "artists"
            ],
            "additionalProperties": false
          }
        },
        "required": [
          "ref",
          "title",
          "metadata"
        ],
        "additionalProperties": false
      },
      "maxItems": 1000
    }
  },
  "required": [],
  "additionalProperties": false
}

返回

{
  "type": "null"
}
queue.shuffle

输入

{
  "type": "object",
  "properties": {
    "items": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "ref": {
            "type": "object",
            "properties": {
              "kind": {
                "const": "track"
              },
              "providerId": {
                "type": "string",
                "minLength": 1,
                "maxLength": 128,
                "pattern": "^[A-Za-z0-9._-]+$"
              },
              "id": {
                "type": "string",
                "minLength": 1,
                "maxLength": 512
              }
            },
            "required": [
              "kind",
              "providerId",
              "id"
            ],
            "additionalProperties": false
          },
          "title": {
            "type": "string",
            "minLength": 0,
            "maxLength": 512
          },
          "metadata": {
            "type": "object",
            "properties": {
              "artists": {
                "type": "array",
                "items": {
                  "type": "string",
                  "minLength": 0,
                  "maxLength": 256
                },
                "maxItems": 32
              }
            },
            "required": [
              "artists"
            ],
            "additionalProperties": false
          }
        },
        "required": [
          "ref",
          "title",
          "metadata"
        ],
        "additionalProperties": false
      },
      "maxItems": 1000
    }
  },
  "required": [
    "items"
  ],
  "additionalProperties": false
}

返回

{
  "type": "null"
}
player.pause 暂停播放

输入

{
  "type": "object",
  "properties": {},
  "required": [],
  "additionalProperties": false
}

返回

{
  "type": "null"
}
player.resume 继续播放

输入

{
  "type": "object",
  "properties": {},
  "required": [],
  "additionalProperties": false
}

返回

{
  "type": "null"
}
player.previous 播放上一首

输入

{
  "type": "object",
  "properties": {},
  "required": [],
  "additionalProperties": false
}

返回

{
  "type": "null"
}
player.next 播放下一首

输入

{
  "type": "object",
  "properties": {
    "reason": {
      "type": "string",
      "enum": [
        "user",
        "ended",
        "error"
      ]
    },
    "track": {
      "type": "object",
      "properties": {
        "ref": {
          "type": "object",
          "properties": {
            "kind": {
              "const": "track"
            },
            "providerId": {
              "type": "string",
              "minLength": 1,
              "maxLength": 128,
              "pattern": "^[A-Za-z0-9._-]+$"
            },
            "id": {
              "type": "string",
              "minLength": 1,
              "maxLength": 512
            }
          },
          "required": [
            "kind",
            "providerId",
            "id"
          ],
          "additionalProperties": false
        },
        "title": {
          "type": "string",
          "minLength": 0,
          "maxLength": 512
        },
        "metadata": {
          "type": "object",
          "properties": {
            "artists": {
              "type": "array",
              "items": {
                "type": "string",
                "minLength": 0,
                "maxLength": 256
              },
              "maxItems": 32
            }
          },
          "required": [
            "artists"
          ],
          "additionalProperties": false
        }
      },
      "required": [
        "ref",
        "title",
        "metadata"
      ],
      "additionalProperties": false
    }
  },
  "required": [
    "reason"
  ],
  "additionalProperties": false
}

返回

{
  "type": "null"
}
player.error

输入

{
  "type": "object",
  "properties": {
    "track": {
      "type": "object",
      "properties": {
        "ref": {
          "type": "object",
          "properties": {
            "kind": {
              "const": "track"
            },
            "providerId": {
              "type": "string",
              "minLength": 1,
              "maxLength": 128,
              "pattern": "^[A-Za-z0-9._-]+$"
            },
            "id": {
              "type": "string",
              "minLength": 1,
              "maxLength": 512
            }
          },
          "required": [
            "kind",
            "providerId",
            "id"
          ],
          "additionalProperties": false
        },
        "title": {
          "type": "string",
          "minLength": 0,
          "maxLength": 512
        },
        "metadata": {
          "type": "object",
          "properties": {
            "artists": {
              "type": "array",
              "items": {
                "type": "string",
                "minLength": 0,
                "maxLength": 256
              },
              "maxItems": 32
            }
          },
          "required": [
            "artists"
          ],
          "additionalProperties": false
        }
      },
      "required": [
        "ref",
        "title",
        "metadata"
      ],
      "additionalProperties": false
    },
    "error": {
      "type": "string",
      "enum": [
        "resolve",
        "start",
        "media",
        "playback"
      ]
    }
  },
  "required": [
    "track",
    "error"
  ],
  "additionalProperties": false
}

返回

{
  "type": "null"
}
player.queueEnded

输入

{
  "type": "object",
  "properties": {
    "tracks": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "ref": {
            "type": "object",
            "properties": {
              "kind": {
                "const": "track"
              },
              "providerId": {
                "type": "string",
                "minLength": 1,
                "maxLength": 128,
                "pattern": "^[A-Za-z0-9._-]+$"
              },
              "id": {
                "type": "string",
                "minLength": 1,
                "maxLength": 512
              }
            },
            "required": [
              "kind",
              "providerId",
              "id"
            ],
            "additionalProperties": false
          },
          "title": {
            "type": "string",
            "minLength": 0,
            "maxLength": 512
          },
          "metadata": {
            "type": "object",
            "properties": {
              "artists": {
                "type": "array",
                "items": {
                  "type": "string",
                  "minLength": 0,
                  "maxLength": 256
                },
                "maxItems": 32
              }
            },
            "required": [
              "artists"
            ],
            "additionalProperties": false
          }
        },
        "required": [
          "ref",
          "title",
          "metadata"
        ],
        "additionalProperties": false
      },
      "maxItems": 1000
    }
  },
  "required": [],
  "additionalProperties": false
}

返回

{
  "type": "null"
}
player.setMode 设置播放模式

输入

{
  "type": "object",
  "properties": {
    "mode": {
      "type": "string",
      "enum": [
        "sequence",
        "single",
        "random"
      ]
    }
  },
  "required": [
    "mode"
  ],
  "additionalProperties": false
}

返回

{
  "type": "null"
}
player.seek 跳转到指定毫秒位置

输入

{
  "type": "object",
  "properties": {
    "positionMs": {
      "type": "integer",
      "minimum": 0,
      "maximum": 9007199254740991
    }
  },
  "required": [
    "positionMs"
  ],
  "additionalProperties": false
}

返回

{
  "type": "null"
}
player.setVolume 设置音量

输入

{
  "type": "object",
  "properties": {
    "volume": {
      "type": "number",
      "minimum": 0,
      "maximum": 1
    }
  },
  "required": [
    "volume"
  ],
  "additionalProperties": false
}

返回

{
  "type": "null"
}
player.resolve

输入

{
  "type": "object",
  "properties": {
    "track": {
      "type": "object",
      "properties": {
        "ref": {
          "type": "object",
          "properties": {
            "kind": {
              "const": "track"
            },
            "providerId": {
              "type": "string",
              "minLength": 1,
              "maxLength": 128,
              "pattern": "^[A-Za-z0-9._-]+$"
            },
            "id": {
              "type": "string",
              "minLength": 1,
              "maxLength": 512
            }
          },
          "required": [
            "kind",
            "providerId",
            "id"
          ],
          "additionalProperties": false
        },
        "title": {
          "type": "string",
          "minLength": 0,
          "maxLength": 512
        },
        "metadata": {
          "type": "object",
          "properties": {
            "artists": {
              "type": "array",
              "items": {
                "type": "string",
                "minLength": 0,
                "maxLength": 256
              },
              "maxItems": 32
            }
          },
          "required": [
            "artists"
          ],
          "additionalProperties": false
        }
      },
      "required": [
        "ref",
        "title",
        "metadata"
      ],
      "additionalProperties": false
    },
    "quality": {
      "type": "string",
      "minLength": 0,
      "maxLength": 64,
      "pattern": "^[\\w.-]*$"
    }
  },
  "required": [
    "track",
    "quality"
  ],
  "additionalProperties": false
}

返回

{
  "type": "object",
  "properties": {
    "ok": {
      "type": "boolean"
    }
  },
  "required": [
    "ok"
  ],
  "additionalProperties": false
}
account.switch

输入

{
  "type": "object",
  "properties": {
    "pluginId": {
      "type": "string",
      "minLength": 1,
      "maxLength": 128
    },
    "accountId": {
      "type": "string",
      "minLength": 1,
      "maxLength": 128
    },
    "fromConnectionId": {
      "anyOf": [
        {
          "type": "string",
          "minLength": 1,
          "maxLength": 128
        },
        {
          "type": "null"
        }
      ]
    },
    "connectionId": {
      "type": "string",
      "minLength": 1,
      "maxLength": 128
    }
  },
  "required": [
    "pluginId",
    "accountId",
    "fromConnectionId",
    "connectionId"
  ],
  "additionalProperties": false
}

返回

{
  "type": "null"
}
search.query

输入

{
  "type": "object",
  "properties": {
    "query": {
      "type": "string",
      "minLength": 1,
      "maxLength": 4096
    },
    "sourceId": {
      "type": "string",
      "minLength": 1,
      "maxLength": 128,
      "pattern": "^[\\w.-]+$"
    },
    "kinds": {
      "type": "array",
      "items": {
        "type": "string",
        "minLength": 1,
        "maxLength": 64
      },
      "maxItems": 32,
      "minItems": 1
    }
  },
  "required": [
    "query",
    "sourceId",
    "kinds"
  ],
  "additionalProperties": false
}

返回

{
  "type": "null"
}
search.suggest

输入

{
  "type": "object",
  "properties": {
    "query": {
      "type": "string",
      "minLength": 1,
      "maxLength": 4096
    },
    "items": {
      "type": "array",
      "items": {
        "type": "string",
        "minLength": 1,
        "maxLength": 512
      },
      "maxItems": 100
    }
  },
  "required": [
    "query",
    "items"
  ],
  "additionalProperties": false
}

返回

{
  "type": "null"
}
search.results

输入

{
  "type": "object",
  "properties": {
    "query": {
      "type": "string",
      "minLength": 1,
      "maxLength": 4096
    },
    "sourceId": {
      "type": "string",
      "minLength": 1,
      "maxLength": 128
    },
    "page": {
      "type": "object",
      "properties": {
        "kind": {
          "type": "string",
          "enum": [
            "track",
            "playlist"
          ]
        },
        "items": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "ref": {
                "type": "object",
                "properties": {
                  "kind": {
                    "type": "string",
                    "enum": [
                      "track",
                      "playlist"
                    ]
                  },
                  "providerId": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 128
                  },
                  "id": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 256
                  }
                },
                "required": [
                  "kind",
                  "providerId",
                  "id"
                ],
                "additionalProperties": false
              },
              "title": {
                "type": "string",
                "minLength": 0,
                "maxLength": 512
              },
              "subtitle": {
                "type": "string",
                "minLength": 0,
                "maxLength": 512
              },
              "metadata": {
                "type": "object",
                "properties": {
                  "artists": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "minLength": 0,
                      "maxLength": 256
                    },
                    "maxItems": 32
                  }
                },
                "required": [
                  "artists"
                ],
                "additionalProperties": false
              }
            },
            "required": [
              "ref",
              "title"
            ],
            "additionalProperties": false
          },
          "maxItems": 500
        }
      },
      "required": [
        "kind",
        "items"
      ],
      "additionalProperties": false
    }
  },
  "required": [
    "query",
    "sourceId",
    "page"
  ],
  "additionalProperties": false
}

返回

{
  "type": "null"
}
track.like 设置歌曲的收藏状态

输入

{
  "type": "object",
  "properties": {
    "track": {
      "type": "object",
      "properties": {
        "ref": {
          "type": "object",
          "properties": {
            "kind": {
              "const": "track"
            },
            "providerId": {
              "type": "string",
              "minLength": 1,
              "maxLength": 128,
              "pattern": "^[A-Za-z0-9._-]+$"
            },
            "id": {
              "type": "string",
              "minLength": 1,
              "maxLength": 512
            }
          },
          "required": [
            "kind",
            "providerId",
            "id"
          ],
          "additionalProperties": false
        },
        "title": {
          "type": "string",
          "minLength": 0,
          "maxLength": 512
        },
        "metadata": {
          "type": "object",
          "properties": {
            "artists": {
              "type": "array",
              "items": {
                "type": "string",
                "minLength": 0,
                "maxLength": 256
              },
              "maxItems": 32
            }
          },
          "required": [
            "artists"
          ],
          "additionalProperties": false
        }
      },
      "required": [
        "ref",
        "title",
        "metadata"
      ],
      "additionalProperties": false
    },
    "liked": {
      "type": "boolean"
    }
  },
  "required": [
    "track",
    "liked"
  ],
  "additionalProperties": false
}

返回

{
  "type": "null"
}
playlist.create 创建歌单

输入

{
  "type": "object",
  "properties": {
    "name": {
      "type": "string",
      "minLength": 1,
      "maxLength": 512
    },
    "location": {
      "type": "string",
      "enum": [
        "local",
        "cloud"
      ]
    }
  },
  "required": [
    "name",
    "location"
  ],
  "additionalProperties": false
}

返回

{
  "type": "null"
}
playlist.delete 删除歌单

输入

{
  "type": "object",
  "properties": {
    "playlist": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "minLength": 1,
          "maxLength": 256
        },
        "name": {
          "type": "string",
          "minLength": 1,
          "maxLength": 512
        },
        "location": {
          "type": "string",
          "enum": [
            "local",
            "cloud",
            "both"
          ]
        }
      },
      "required": [
        "id",
        "name",
        "location"
      ],
      "additionalProperties": false
    }
  },
  "required": [
    "playlist"
  ],
  "additionalProperties": false
}

返回

{
  "type": "null"
}
playlist.addTracks 添加歌曲到歌单

输入

{
  "type": "object",
  "properties": {
    "playlist": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "minLength": 1,
          "maxLength": 256
        },
        "name": {
          "type": "string",
          "minLength": 1,
          "maxLength": 512
        },
        "location": {
          "type": "string",
          "enum": [
            "local",
            "cloud",
            "both"
          ]
        }
      },
      "required": [
        "id",
        "name",
        "location"
      ],
      "additionalProperties": false
    },
    "tracks": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "ref": {
            "type": "object",
            "properties": {
              "kind": {
                "const": "track"
              },
              "providerId": {
                "type": "string",
                "minLength": 1,
                "maxLength": 128,
                "pattern": "^[A-Za-z0-9._-]+$"
              },
              "id": {
                "type": "string",
                "minLength": 1,
                "maxLength": 512
              }
            },
            "required": [
              "kind",
              "providerId",
              "id"
            ],
            "additionalProperties": false
          },
          "title": {
            "type": "string",
            "minLength": 0,
            "maxLength": 512
          },
          "metadata": {
            "type": "object",
            "properties": {
              "artists": {
                "type": "array",
                "items": {
                  "type": "string",
                  "minLength": 0,
                  "maxLength": 256
                },
                "maxItems": 32
              }
            },
            "required": [
              "artists"
            ],
            "additionalProperties": false
          }
        },
        "required": [
          "ref",
          "title",
          "metadata"
        ],
        "additionalProperties": false
      },
      "maxItems": 1000
    }
  },
  "required": [
    "playlist",
    "tracks"
  ],
  "additionalProperties": false
}

返回

{
  "type": "null"
}
playlist.removeTracks 从歌单移除歌曲

输入

{
  "type": "object",
  "properties": {
    "playlist": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "minLength": 1,
          "maxLength": 256
        },
        "name": {
          "type": "string",
          "minLength": 1,
          "maxLength": 512
        },
        "location": {
          "type": "string",
          "enum": [
            "local",
            "cloud",
            "both"
          ]
        }
      },
      "required": [
        "id",
        "name",
        "location"
      ],
      "additionalProperties": false
    },
    "tracks": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "ref": {
            "type": "object",
            "properties": {
              "kind": {
                "const": "track"
              },
              "providerId": {
                "type": "string",
                "minLength": 1,
                "maxLength": 128,
                "pattern": "^[A-Za-z0-9._-]+$"
              },
              "id": {
                "type": "string",
                "minLength": 1,
                "maxLength": 512
              }
            },
            "required": [
              "kind",
              "providerId",
              "id"
            ],
            "additionalProperties": false
          },
          "title": {
            "type": "string",
            "minLength": 0,
            "maxLength": 512
          },
          "metadata": {
            "type": "object",
            "properties": {
              "artists": {
                "type": "array",
                "items": {
                  "type": "string",
                  "minLength": 0,
                  "maxLength": 256
                },
                "maxItems": 32
              }
            },
            "required": [
              "artists"
            ],
            "additionalProperties": false
          }
        },
        "required": [
          "ref",
          "title",
          "metadata"
        ],
        "additionalProperties": false
      },
      "maxItems": 1000
    }
  },
  "required": [
    "playlist",
    "tracks"
  ],
  "additionalProperties": false
}

返回

{
  "type": "null"
}
playlist.export 导出歌单

输入

{
  "type": "object",
  "properties": {
    "playlist": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "minLength": 1,
          "maxLength": 256
        },
        "name": {
          "type": "string",
          "minLength": 1,
          "maxLength": 512
        },
        "location": {
          "type": "string",
          "enum": [
            "local",
            "cloud",
            "both"
          ]
        }
      },
      "required": [
        "id",
        "name",
        "location"
      ],
      "additionalProperties": false
    },
    "format": {
      "type": "string",
      "enum": [
        "cmpl",
        "cpl"
      ]
    }
  },
  "required": [
    "playlist",
    "format"
  ],
  "additionalProperties": false
}

返回

{
  "type": "null"
}
playlist.import 导入歌单

输入

{
  "type": "object",
  "properties": {
    "value": {
      "type": "string",
      "minLength": 1,
      "maxLength": 4096
    },
    "importerId": {
      "type": "string",
      "minLength": 3,
      "maxLength": 257,
      "pattern": "^[\\w.-]{1,128}:[\\w.-]{1,128}$"
    }
  },
  "required": [
    "value"
  ],
  "additionalProperties": false
}

返回

{
  "type": "null"
}
window.close 按用户设置关闭主窗口

输入

{
  "type": "object",
  "properties": {},
  "required": [],
  "additionalProperties": false
}

返回

{
  "type": "null"
}
lyrics.load

输入

{
  "type": "object",
  "properties": {
    "track": {
      "type": "object",
      "properties": {
        "ref": {
          "type": "object",
          "properties": {
            "kind": {
              "const": "track"
            },
            "providerId": {
              "type": "string",
              "minLength": 1,
              "maxLength": 128,
              "pattern": "^[A-Za-z0-9._-]+$"
            },
            "id": {
              "type": "string",
              "minLength": 1,
              "maxLength": 512
            }
          },
          "required": [
            "kind",
            "providerId",
            "id"
          ],
          "additionalProperties": false
        },
        "title": {
          "type": "string",
          "minLength": 0,
          "maxLength": 512
        },
        "metadata": {
          "type": "object",
          "properties": {
            "artists": {
              "type": "array",
              "items": {
                "type": "string",
                "minLength": 0,
                "maxLength": 256
              },
              "maxItems": 32
            }
          },
          "required": [
            "artists"
          ],
          "additionalProperties": false
        }
      },
      "required": [
        "ref",
        "title",
        "metadata"
      ],
      "additionalProperties": false
    }
  },
  "required": [
    "track"
  ],
  "additionalProperties": false
}

返回

{
  "anyOf": [
    {
      "type": "object",
      "properties": {
        "format": {
          "const": "crlyric"
        },
        "version": {
          "const": 1
        },
        "track": {
          "type": "object",
          "properties": {
            "kind": {
              "const": "track"
            },
            "providerId": {
              "type": "string",
              "minLength": 1,
              "maxLength": 128,
              "pattern": "^[A-Za-z0-9._-]+$"
            },
            "id": {
              "type": "string",
              "minLength": 1,
              "maxLength": 512
            }
          },
          "required": [
            "kind",
            "providerId",
            "id"
          ],
          "additionalProperties": false
        },
        "offsetMs": {
          "type": "number"
        },
        "plainText": {
          "type": "string",
          "minLength": 0,
          "maxLength": 1048576
        },
        "lines": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "startTimeMs": {
                "type": "number",
                "minimum": 0
              },
              "endTimeMs": {
                "type": "number",
                "minimum": 0
              },
              "text": {
                "type": "string",
                "minLength": 0,
                "maxLength": 65536
              },
              "translation": {
                "type": "string",
                "minLength": 0,
                "maxLength": 65536
              },
              "romanization": {
                "type": "string",
                "minLength": 0,
                "maxLength": 65536
              },
              "translations": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "text": {
                      "type": "string",
                      "minLength": 0,
                      "maxLength": 65536
                    },
                    "language": {
                      "type": "string",
                      "minLength": 0,
                      "maxLength": 128
                    },
                    "words": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "startTimeMs": {
                            "type": "number",
                            "minimum": 0
                          },
                          "endTimeMs": {
                            "type": "number",
                            "minimum": 0
                          },
                          "text": {
                            "type": "string",
                            "minLength": 0,
                            "maxLength": 65536
                          },
                          "translation": {
                            "type": "string",
                            "minLength": 0,
                            "maxLength": 65536
                          },
                          "romanization": {
                            "type": "string",
                            "minLength": 0,
                            "maxLength": 65536
                          }
                        },
                        "required": [
                          "startTimeMs",
                          "endTimeMs",
                          "text"
                        ],
                        "additionalProperties": false
                      },
                      "maxItems": 10000
                    }
                  },
                  "required": [
                    "text"
                  ],
                  "additionalProperties": false
                },
                "maxItems": 16
              },
              "romanizations": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "text": {
                      "type": "string",
                      "minLength": 0,
                      "maxLength": 65536
                    },
                    "language": {
                      "type": "string",
                      "minLength": 0,
                      "maxLength": 128
                    },
                    "words": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "startTimeMs": {
                            "type": "number",
                            "minimum": 0
                          },
                          "endTimeMs": {
                            "type": "number",
                            "minimum": 0
                          },
                          "text": {
                            "type": "string",
                            "minLength": 0,
                            "maxLength": 65536
                          },
                          "translation": {
                            "type": "string",
                            "minLength": 0,
                            "maxLength": 65536
                          },
                          "romanization": {
                            "type": "string",
                            "minLength": 0,
                            "maxLength": 65536
                          }
                        },
                        "required": [
                          "startTimeMs",
                          "endTimeMs",
                          "text"
                        ],
                        "additionalProperties": false
                      },
                      "maxItems": 10000
                    }
                  },
                  "required": [
                    "text"
                  ],
                  "additionalProperties": false
                },
                "maxItems": 16
              },
              "words": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "startTimeMs": {
                      "type": "number",
                      "minimum": 0
                    },
                    "endTimeMs": {
                      "type": "number",
                      "minimum": 0
                    },
                    "text": {
                      "type": "string",
                      "minLength": 0,
                      "maxLength": 65536
                    },
                    "translation": {
                      "type": "string",
                      "minLength": 0,
                      "maxLength": 65536
                    },
                    "romanization": {
                      "type": "string",
                      "minLength": 0,
                      "maxLength": 65536
                    }
                  },
                  "required": [
                    "startTimeMs",
                    "endTimeMs",
                    "text"
                  ],
                  "additionalProperties": false
                },
                "maxItems": 10000
              },
              "isBackground": {
                "type": "boolean"
              },
              "isDuet": {
                "type": "boolean"
              }
            },
            "required": [
              "startTimeMs",
              "text"
            ],
            "additionalProperties": false
          },
          "maxItems": 20000
        }
      },
      "required": [
        "format",
        "version",
        "track",
        "offsetMs",
        "lines"
      ],
      "additionalProperties": false
    },
    {
      "type": "null"
    }
  ]
}
lyrics.transform

输入

{
  "type": "object",
  "properties": {
    "track": {
      "type": "object",
      "properties": {
        "ref": {
          "type": "object",
          "properties": {
            "kind": {
              "const": "track"
            },
            "providerId": {
              "type": "string",
              "minLength": 1,
              "maxLength": 128,
              "pattern": "^[A-Za-z0-9._-]+$"
            },
            "id": {
              "type": "string",
              "minLength": 1,
              "maxLength": 512
            }
          },
          "required": [
            "kind",
            "providerId",
            "id"
          ],
          "additionalProperties": false
        },
        "title": {
          "type": "string",
          "minLength": 0,
          "maxLength": 512
        },
        "metadata": {
          "type": "object",
          "properties": {
            "artists": {
              "type": "array",
              "items": {
                "type": "string",
                "minLength": 0,
                "maxLength": 256
              },
              "maxItems": 32
            }
          },
          "required": [
            "artists"
          ],
          "additionalProperties": false
        }
      },
      "required": [
        "ref",
        "title",
        "metadata"
      ],
      "additionalProperties": false
    },
    "lyric": {
      "anyOf": [
        {
          "type": "object",
          "properties": {
            "format": {
              "const": "crlyric"
            },
            "version": {
              "const": 1
            },
            "track": {
              "type": "object",
              "properties": {
                "kind": {
                  "const": "track"
                },
                "providerId": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 128,
                  "pattern": "^[A-Za-z0-9._-]+$"
                },
                "id": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 512
                }
              },
              "required": [
                "kind",
                "providerId",
                "id"
              ],
              "additionalProperties": false
            },
            "offsetMs": {
              "type": "number"
            },
            "plainText": {
              "type": "string",
              "minLength": 0,
              "maxLength": 1048576
            },
            "lines": {
              "type": "array",
              "items": {
                "type": "object",
                "properties": {
                  "startTimeMs": {
                    "type": "number",
                    "minimum": 0
                  },
                  "endTimeMs": {
                    "type": "number",
                    "minimum": 0
                  },
                  "text": {
                    "type": "string",
                    "minLength": 0,
                    "maxLength": 65536
                  },
                  "translation": {
                    "type": "string",
                    "minLength": 0,
                    "maxLength": 65536
                  },
                  "romanization": {
                    "type": "string",
                    "minLength": 0,
                    "maxLength": 65536
                  },
                  "translations": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "text": {
                          "type": "string",
                          "minLength": 0,
                          "maxLength": 65536
                        },
                        "language": {
                          "type": "string",
                          "minLength": 0,
                          "maxLength": 128
                        },
                        "words": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "startTimeMs": {
                                "type": "number",
                                "minimum": 0
                              },
                              "endTimeMs": {
                                "type": "number",
                                "minimum": 0
                              },
                              "text": {
                                "type": "string",
                                "minLength": 0,
                                "maxLength": 65536
                              },
                              "translation": {
                                "type": "string",
                                "minLength": 0,
                                "maxLength": 65536
                              },
                              "romanization": {
                                "type": "string",
                                "minLength": 0,
                                "maxLength": 65536
                              }
                            },
                            "required": [
                              "startTimeMs",
                              "endTimeMs",
                              "text"
                            ],
                            "additionalProperties": false
                          },
                          "maxItems": 10000
                        }
                      },
                      "required": [
                        "text"
                      ],
                      "additionalProperties": false
                    },
                    "maxItems": 16
                  },
                  "romanizations": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "text": {
                          "type": "string",
                          "minLength": 0,
                          "maxLength": 65536
                        },
                        "language": {
                          "type": "string",
                          "minLength": 0,
                          "maxLength": 128
                        },
                        "words": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "startTimeMs": {
                                "type": "number",
                                "minimum": 0
                              },
                              "endTimeMs": {
                                "type": "number",
                                "minimum": 0
                              },
                              "text": {
                                "type": "string",
                                "minLength": 0,
                                "maxLength": 65536
                              },
                              "translation": {
                                "type": "string",
                                "minLength": 0,
                                "maxLength": 65536
                              },
                              "romanization": {
                                "type": "string",
                                "minLength": 0,
                                "maxLength": 65536
                              }
                            },
                            "required": [
                              "startTimeMs",
                              "endTimeMs",
                              "text"
                            ],
                            "additionalProperties": false
                          },
                          "maxItems": 10000
                        }
                      },
                      "required": [
                        "text"
                      ],
                      "additionalProperties": false
                    },
                    "maxItems": 16
                  },
                  "words": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "startTimeMs": {
                          "type": "number",
                          "minimum": 0
                        },
                        "endTimeMs": {
                          "type": "number",
                          "minimum": 0
                        },
                        "text": {
                          "type": "string",
                          "minLength": 0,
                          "maxLength": 65536
                        },
                        "translation": {
                          "type": "string",
                          "minLength": 0,
                          "maxLength": 65536
                        },
                        "romanization": {
                          "type": "string",
                          "minLength": 0,
                          "maxLength": 65536
                        }
                      },
                      "required": [
                        "startTimeMs",
                        "endTimeMs",
                        "text"
                      ],
                      "additionalProperties": false
                    },
                    "maxItems": 10000
                  },
                  "isBackground": {
                    "type": "boolean"
                  },
                  "isDuet": {
                    "type": "boolean"
                  }
                },
                "required": [
                  "startTimeMs",
                  "text"
                ],
                "additionalProperties": false
              },
              "maxItems": 20000
            }
          },
          "required": [
            "format",
            "version",
            "track",
            "offsetMs",
            "lines"
          ],
          "additionalProperties": false
        },
        {
          "type": "null"
        }
      ]
    }
  },
  "required": [
    "track",
    "lyric"
  ],
  "additionalProperties": false
}

返回

{
  "anyOf": [
    {
      "type": "object",
      "properties": {
        "format": {
          "const": "crlyric"
        },
        "version": {
          "const": 1
        },
        "track": {
          "type": "object",
          "properties": {
            "kind": {
              "const": "track"
            },
            "providerId": {
              "type": "string",
              "minLength": 1,
              "maxLength": 128,
              "pattern": "^[A-Za-z0-9._-]+$"
            },
            "id": {
              "type": "string",
              "minLength": 1,
              "maxLength": 512
            }
          },
          "required": [
            "kind",
            "providerId",
            "id"
          ],
          "additionalProperties": false
        },
        "offsetMs": {
          "type": "number"
        },
        "plainText": {
          "type": "string",
          "minLength": 0,
          "maxLength": 1048576
        },
        "lines": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "startTimeMs": {
                "type": "number",
                "minimum": 0
              },
              "endTimeMs": {
                "type": "number",
                "minimum": 0
              },
              "text": {
                "type": "string",
                "minLength": 0,
                "maxLength": 65536
              },
              "translation": {
                "type": "string",
                "minLength": 0,
                "maxLength": 65536
              },
              "romanization": {
                "type": "string",
                "minLength": 0,
                "maxLength": 65536
              },
              "translations": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "text": {
                      "type": "string",
                      "minLength": 0,
                      "maxLength": 65536
                    },
                    "language": {
                      "type": "string",
                      "minLength": 0,
                      "maxLength": 128
                    },
                    "words": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "startTimeMs": {
                            "type": "number",
                            "minimum": 0
                          },
                          "endTimeMs": {
                            "type": "number",
                            "minimum": 0
                          },
                          "text": {
                            "type": "string",
                            "minLength": 0,
                            "maxLength": 65536
                          },
                          "translation": {
                            "type": "string",
                            "minLength": 0,
                            "maxLength": 65536
                          },
                          "romanization": {
                            "type": "string",
                            "minLength": 0,
                            "maxLength": 65536
                          }
                        },
                        "required": [
                          "startTimeMs",
                          "endTimeMs",
                          "text"
                        ],
                        "additionalProperties": false
                      },
                      "maxItems": 10000
                    }
                  },
                  "required": [
                    "text"
                  ],
                  "additionalProperties": false
                },
                "maxItems": 16
              },
              "romanizations": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "text": {
                      "type": "string",
                      "minLength": 0,
                      "maxLength": 65536
                    },
                    "language": {
                      "type": "string",
                      "minLength": 0,
                      "maxLength": 128
                    },
                    "words": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "startTimeMs": {
                            "type": "number",
                            "minimum": 0
                          },
                          "endTimeMs": {
                            "type": "number",
                            "minimum": 0
                          },
                          "text": {
                            "type": "string",
                            "minLength": 0,
                            "maxLength": 65536
                          },
                          "translation": {
                            "type": "string",
                            "minLength": 0,
                            "maxLength": 65536
                          },
                          "romanization": {
                            "type": "string",
                            "minLength": 0,
                            "maxLength": 65536
                          }
                        },
                        "required": [
                          "startTimeMs",
                          "endTimeMs",
                          "text"
                        ],
                        "additionalProperties": false
                      },
                      "maxItems": 10000
                    }
                  },
                  "required": [
                    "text"
                  ],
                  "additionalProperties": false
                },
                "maxItems": 16
              },
              "words": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "startTimeMs": {
                      "type": "number",
                      "minimum": 0
                    },
                    "endTimeMs": {
                      "type": "number",
                      "minimum": 0
                    },
                    "text": {
                      "type": "string",
                      "minLength": 0,
                      "maxLength": 65536
                    },
                    "translation": {
                      "type": "string",
                      "minLength": 0,
                      "maxLength": 65536
                    },
                    "romanization": {
                      "type": "string",
                      "minLength": 0,
                      "maxLength": 65536
                    }
                  },
                  "required": [
                    "startTimeMs",
                    "endTimeMs",
                    "text"
                  ],
                  "additionalProperties": false
                },
                "maxItems": 10000
              },
              "isBackground": {
                "type": "boolean"
              },
              "isDuet": {
                "type": "boolean"
              }
            },
            "required": [
              "startTimeMs",
              "text"
            ],
            "additionalProperties": false
          },
          "maxItems": 20000
        }
      },
      "required": [
        "format",
        "version",
        "track",
        "offsetMs",
        "lines"
      ],
      "additionalProperties": false
    },
    {
      "type": "null"
    }
  ]
}
download.create 创建歌曲下载任务

输入

{
  "type": "object",
  "properties": {
    "tracks": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "ref": {
            "type": "object",
            "properties": {
              "kind": {
                "const": "track"
              },
              "providerId": {
                "type": "string",
                "minLength": 1,
                "maxLength": 128,
                "pattern": "^[A-Za-z0-9._-]+$"
              },
              "id": {
                "type": "string",
                "minLength": 1,
                "maxLength": 512
              }
            },
            "required": [
              "kind",
              "providerId",
              "id"
            ],
            "additionalProperties": false
          },
          "title": {
            "type": "string",
            "minLength": 0,
            "maxLength": 512
          },
          "metadata": {
            "type": "object",
            "properties": {
              "artists": {
                "type": "array",
                "items": {
                  "type": "string",
                  "minLength": 0,
                  "maxLength": 256
                },
                "maxItems": 32
              }
            },
            "required": [
              "artists"
            ],
            "additionalProperties": false
          }
        },
        "required": [
          "ref",
          "title",
          "metadata"
        ],
        "additionalProperties": false
      },
      "maxItems": 1000
    },
    "quality": {
      "type": "string",
      "minLength": 1,
      "maxLength": 64,
      "pattern": "^[\\w.-]+$"
    },
    "directory": {
      "type": "string",
      "pattern": "^[a-f0-9-]{36}$"
    }
  },
  "required": [
    "tracks",
    "quality"
  ],
  "additionalProperties": false
}

返回

{
  "type": "null"
}
download.filename

输入

{
  "type": "object",
  "properties": {
    "track": {
      "type": "object",
      "properties": {
        "ref": {
          "type": "object",
          "properties": {
            "kind": {
              "const": "track"
            },
            "providerId": {
              "type": "string",
              "minLength": 1,
              "maxLength": 128,
              "pattern": "^[A-Za-z0-9._-]+$"
            },
            "id": {
              "type": "string",
              "minLength": 1,
              "maxLength": 512
            }
          },
          "required": [
            "kind",
            "providerId",
            "id"
          ],
          "additionalProperties": false
        },
        "title": {
          "type": "string",
          "minLength": 0,
          "maxLength": 512
        },
        "metadata": {
          "type": "object",
          "properties": {
            "artists": {
              "type": "array",
              "items": {
                "type": "string",
                "minLength": 0,
                "maxLength": 256
              },
              "maxItems": 32
            }
          },
          "required": [
            "artists"
          ],
          "additionalProperties": false
        }
      },
      "required": [
        "ref",
        "title",
        "metadata"
      ],
      "additionalProperties": false
    },
    "name": {
      "type": "string",
      "minLength": 1,
      "maxLength": 255
    }
  },
  "required": [
    "track",
    "name"
  ],
  "additionalProperties": false
}

返回

{
  "type": "null"
}
share.create 生成歌曲分享链接

输入

{
  "type": "object",
  "properties": {
    "track": {
      "type": "object",
      "properties": {
        "ref": {
          "type": "object",
          "properties": {
            "kind": {
              "const": "track"
            },
            "providerId": {
              "type": "string",
              "minLength": 1,
              "maxLength": 128,
              "pattern": "^[A-Za-z0-9._-]+$"
            },
            "id": {
              "type": "string",
              "minLength": 1,
              "maxLength": 512
            }
          },
          "required": [
            "kind",
            "providerId",
            "id"
          ],
          "additionalProperties": false
        },
        "title": {
          "type": "string",
          "minLength": 0,
          "maxLength": 512
        },
        "metadata": {
          "type": "object",
          "properties": {
            "artists": {
              "type": "array",
              "items": {
                "type": "string",
                "minLength": 0,
                "maxLength": 256
              },
              "maxItems": 32
            }
          },
          "required": [
            "artists"
          ],
          "additionalProperties": false
        }
      },
      "required": [
        "ref",
        "title",
        "metadata"
      ],
      "additionalProperties": false
    }
  },
  "required": [
    "track"
  ],
  "additionalProperties": false
}

返回

{
  "anyOf": [
    {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "minLength": 1,
          "maxLength": 4096
        },
        "url": {
          "type": "string",
          "minLength": 1,
          "maxLength": 8192,
          "format": "uri"
        },
        "template": {
          "type": "string",
          "minLength": 0,
          "maxLength": 16384
        }
      },
      "required": [
        "id",
        "url"
      ],
      "additionalProperties": false
    },
    {
      "type": "null"
    }
  ]
}
link.open 处理公开链接

输入

{
  "type": "object",
  "properties": {
    "url": {
      "type": "string",
      "minLength": 1,
      "maxLength": 8192,
      "format": "uri"
    },
    "from": {
      "type": "string",
      "enum": [
        "paste",
        "drop",
        "deeplink"
      ]
    }
  },
  "required": [
    "url",
    "from"
  ],
  "additionalProperties": false
}

返回

{
  "type": "null"
}
notification.show 显示软件内文字提示

输入

{
  "type": "object",
  "properties": {
    "title": {
      "type": "string",
      "minLength": 0,
      "maxLength": 512
    },
    "body": {
      "type": "string",
      "minLength": 0,
      "maxLength": 8192
    },
    "level": {
      "type": "string",
      "enum": [
        "info",
        "success",
        "warning",
        "error"
      ]
    }
  },
  "required": [
    "title",
    "body",
    "level"
  ],
  "additionalProperties": false
}

返回

{
  "type": "null"
}

实际读一行:拖动播放进度 ​

在表中找到 player.seek。拦截权限决定能否处理用户拖动,完成事件权限决定能否观察最终结果,主动调用权限决定按钮能否发起一次跳转。“可取消”列为“否”,作者可以校正输入中的 positionMs,不能用取消点播的办法阻止拖动。800 ms 是该处理器的预算,把网络查询放到拖动发生以前。

若只想让用户按按钮跳到第十秒,在API 教程按 player.control 实现;若要处理用户从其他入口发起的拖动,先在Hook 模板写授权与撤权场景。两条路径用同一首长于十秒的本地音频复验。

Released under the Apache License 2.0 License.