如何通过videojs contrib-hls向浏览器端由m3u8清单触发的请求添加参数

How to add a parameter via videojs contrib-hls to requests triggered by m3u8 manifest from the browser side

有没有办法在 videojs contrib-hls 中从浏览器端向每个由 m3u8 清单触发的请求添加参数?

例如 - 通过自定义加载程序(如 in this question)。

videojs-contrib-hls 由 http-streaming 继承,默认包含在 Video.js v7 中。您可以设置一个函数来修改每个请求 player.hls.xhr.beforeRequest.

这仅在 http-streaming 使用媒体源扩展播放 HLS 时才有效,无法通过浏览器的本机播放更改请求。对于某些支持本机 HLS 的浏览器,override native 选项可用于确保 http-streaming 播放视频,但这在不支持 MSE 的 iOS 上尤其不可能。