为了确保您的开发体验,建议您使用Apifox浏览器插件或客户端进行调试。
lyric_update,立即补发一条;若尚无缓存(播放器未启动,或启动后还没推出第一行歌词),连接建立时不发送任何内容,第一条会等到实际有歌词时才到达。本端点不会发送 data:{} 空对象。data: {"type":"lyric_update","player":"wesing","data":{"index":1,"text":"往事就像流星刹那划过心房","sub_text":"","timestamp":31.483,"play_time":31.282999,"position":31.282999,"progress":0.105743244,"text_detailed":{}}}data: {"type":"lyric_update","player":"wesing","data":{"index":2,"text":"灰暗的深夜 是寂寞的世界","sub_text":"","timestamp":37.716,"play_time":37.516,"position":37.516,"progress":0.1268581,"text_detailed":{}}}(连接建立,当前无歌词)
data: {"type":"lyric_update","player":"wesing","data":{}}
(用户开始播放歌曲)
data: {"type":"lyric_update","player":"wesing","data":{"index":0,"text":"是冰冻的时分 已过夜深的夜晚","sub_text":"","timestamp":25.44,"play_time":25.24,"position":25.24,"progress":0.08530405,"text_detailed":{}}}
data: {"type":"lyric_update","player":"wesing","data":{"index":1,"text":"往事就像流星刹那划过心房","sub_text":"","timestamp":31.483,"play_time":31.282999,"position":31.282999,"progress":0.105743244,"text_detailed":{}}}
(切歌 — 服务端不发送清空消息,前端自行根据新歌数据重置显示)
data: {"type":"lyric_update","player":"wesing","data":{"index":0,"text":"啊","sub_text":"","timestamp":3.012,"play_time":2.812,"position":2.812,"progress":0.009628378,"text_detailed":{}}}lyric_update,不推送 all_lyrics。需要歌词全文请调用 /all_lyrics,或改用 WebSocket 端点type 字段)Content-Type: text/event-stream; charset=utf-8data:{})Access-Control-Allow-Origin: *