现各个视频页面(视频、番剧、课程)都能在 window
下找到一致的播放器 API
#4341
timongh
started this conversation in
分享 / Share
Replies: 3 comments
-
|
Beta Was this translation helpful? Give feedback.
0 replies
-
此数据存储在 本地存储(localStorage)->
注:使用此接口切换不会同步更新 UI 的显示,UI 中高亮选项是通过 CSS 的 |
Beta Was this translation helpful? Give feedback.
0 replies
-
此方法已失效(#4795)
示例: {
"hover": false,
"enable": true,
"isclosed": false,
"lan": "zh-CN", // 主字幕语言
"minorLan": "ai-zh", // 副字幕语言
"fade": false,
"color": "16777215",
"scale": true,
"shadow": "0",
"opacity": 0.4,
"fontsize": 1,
"bilingual": true, // 双语字幕
"position": "bottom-center",
"languageList": [
{
"id": 0, // ...
"lan": "zh-CN",
"lan_doc": "中文(中国)",
"is_lock": false,
"subtitle_url": "...", // 字幕地址
"type": 0,
"id_str": "...", // 注:和 id 不一样
"ai_type": 0,
"ai_status": 0
},
{
"id": 0, // ...
"lan": "ai-zh",
"lan_doc": "中文(自动生成)",
"is_lock": false,
"subtitle_url": "...",
"type": 1,
"id_str": "...",
"ai_type": 0,
"ai_status": 2
}
]
} |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
window.player
,window.nano
window.player
,window.nano
window.playerRaw
,window.nano
使用示例:
player.seek(60)
:跳转进度到第 60 秒player.goto(1)
:跳转到列表第 2 个视频player.getManifest()
:获取包括 aid、bvid、cid、seasonId、episodeId 等视频信息(see: 通过 player manifest 获取视频信息 #4330)player.setHandoff(nano.HandoffKind.Auto)
:开启自动连播player.setHandoff(nano.HandoffKind.Abort)
:关闭自动连播player.on(nano.EventType.Player_Initialized, () => { /* ... */ })
:监听视频开始播放player.once(nano.EventType.Player_Initialized, () => { /* ... */ })
:监听视频开始播放,只执行一次player.off(nano.EventType.Player_Initialized, listener)
:停止监听Beta Was this translation helpful? Give feedback.
All reactions