Skip to content
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

Open
YWSGM opened this issue Apr 22, 2024 · 8 comments
Open

url 配置为数组是提示不支持视频格式 #1400

YWSGM opened this issue Apr 22, 2024 · 8 comments
Labels
multi-plugins Use multiple plugins at the same time

Comments

@YWSGM
Copy link

YWSGM commented Apr 22, 2024

您使用的西瓜播放器版本是多少? 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?
image

可填写您所在的公司和相关产品业务,方便我们提供更好的技术支持 You can write your company and product which uses xgplayer, for helping us provide better technical support.

@YWSGM
Copy link
Author

YWSGM commented Apr 22, 2024

image 这两个地址 在 在线播放器中试过,均可播放,但是在西瓜视频里按照图示配置则提示问题中的错误信息,麻烦官方解答一下 视频地址:https://test-streams.mux.dev/x36xhzz/x36xhzz.m3u8 https://sf1-cdn-tos.huoshanstatic.com/obj/media-fe/xgplayer_doc_video/flv/xgplayer-demo-720p.flv

@YWSGM
Copy link
Author

YWSGM commented Apr 22, 2024

如果是这样配置则可以显示视频请求,但是 http 状态ma码 是206,还是无法播放
image

@YWSGM
Copy link
Author

YWSGM commented Apr 22, 2024

两个插件同时使用时。m3u8视频无法播放
image

@itchaox
Copy link

itchaox commented Apr 24, 2024

如果是这样配置则可以显示视频请求,但是 http 状态ma码 是206,还是无法播放 image

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,
      };

}

@YWSGM
Copy link
Author

YWSGM commented Apr 24, 2024

如果是这样配置则可以显示视频请求,但是 http 状态ma码 是206,还是无法播放 image

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 配制成数组但是无法播放的情况呢,目前我只能配一个播放地址,并不能让播放器自动选择可以播放的播放地址

@itchaox
Copy link

itchaox commented Apr 24, 2024

如果是这样配置则可以显示视频请求,但是 http 状态ma码 是206,还是无法播放 image

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 配置成数组,我还没有测试过

@itchaox
Copy link

itchaox commented Apr 24, 2024

如果是这样配置则可以显示视频请求,但是 http 状态ma码 是206,还是无法播放 image

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 配制成数组但是无法播放的情况呢,目前我只能配一个播放地址,并不能让播放器自动选择可以播放的播放地址

因为我在开发的时候,没有遇到把 mp4\flv\hls 同时播放的情况

@YWSGM
Copy link
Author

YWSGM commented Apr 24, 2024

如果是这样配置则可以显示视频请求,但是 http 状态ma码 是206,还是无法播放 image

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 配制成数组但是无法播放的情况呢,目前我只能配一个播放地址,并不能让播放器自动选择可以播放的播放地址

因为我在开发的时候,没有遇到把 mp4\flv\hls 同时播放的情况

好的好的,感谢回答

@gemxx gemxx added the multi-plugins Use multiple plugins at the same time label May 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
multi-plugins Use multiple plugins at the same time
Projects
None yet
Development

No branches or pull requests

3 participants