bilibili / flv.js

HTML5 FLV Player
Apache License 2.0
22.91k stars 3.39k forks source link

flv. js本身有支援身份認證的功能 #814

Open yanhua1012 opened 4 months ago

yanhua1012 commented 4 months ago

請問 flv. js本身有支援身份認證的功能嗎?例如以 jwt, cookies 、header 的方式帶 token 、帳密的方式。 可以參考文件的哪一個章節,謝謝。

xqq commented 4 months ago

@yanhua1012

This repository could not be maintained by me anymore. You'd better migrate to mpegts.js.

You can append custom headers through config.headers by providing an object of Key-Value pairs of custom headers. It will be appended when requesting HTTP streaming.

If you want to pass cookies, enable the withCredentials field inside the MediaDataSource.

Both of them will be limited by the browser's CORS policy.

For further discussions, please post new issues in the mpegts.js repository.

yanhua1012 commented 4 months ago

謝謝您的專業回覆,很具參考加值。我會改至 mpegts.js 討論。 另外能否請教,如果以 webSocket 的方式進行連線, 上述的 header 與 withCredential 仍有作用嗎?