-
Notifications
You must be signed in to change notification settings - Fork 836
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
url 配置为数组是提示不支持视频格式 #1400
Comments
hi,我遇到过类似的需求。你可以尝试在 new Player 的时候传入一个函数, ...getVideoConfig(url)。然后函数里面根据流地址的格式,去形成集成不同的插件配置。 function getVideoConfig(url: string) {
const extension = url.toLowerCase().split('.').pop();
switch (extension) {
case 'm3u8':
return {
plugins: [HlsPlugin],
};
case 'flv':
return {
plugins: [FlvPlugin],
isLive: true,
};
} |
hello,那有没有遇到过 url 配制成数组但是无法播放的情况呢,目前我只能配一个播放地址,并不能让播放器自动选择可以播放的播放地址 |
url 配置成数组,我还没有测试过 |
因为我在开发的时候,没有遇到把 mp4\flv\hls 同时播放的情况 |
好的好的,感谢回答 |
您使用的西瓜播放器版本是多少? What version of xgplayer are you using?
"xgplayer": "^3.0.14",
您使用的操作系统和浏览器分别是? What OS and browser are you using?
mac 13.5.1 chrome 124.0.6367.60
如何复现问题? How to reproduce the problem?
配置 url 为数组即可复现
您期望的播放器正常行为是? What did you expect to happen?
正常播放
实际播放器的表现是? What actually happened?
可填写您所在的公司和相关产品业务,方便我们提供更好的技术支持 You can write your company and product which uses xgplayer, for helping us provide better technical support.
The text was updated successfully, but these errors were encountered: