bilibili / flv.js

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

点播flv格式文件,拖动进度条超过缓存,缓存会自动清空问题,并因此视频停止在这里 #409

Open VirusCIH opened 5 years ago

VirusCIH commented 5 years ago

前面的问题都翻了一遍也没有找到可用的解决方案,下面是我的配置,(在chrome浏览器下播放,并在已缓存的部分拖动没有问题,当拖动进度条到缓存临界值前再让它自然播放也没问题,它也会自动去取剩余的数据,自动发起请求,但是当我拖动进度条超出缓存部分就会把原有的缓存清空并卡住在这里): image

image

xqq commented 5 years ago
  1. 点播文件 seek 要求 onMetaData 中有 keyframes 关键帧索引表

  2. 若跨域播放,正确设置 range 请求头造成的跨域要求配置 https://github.com/Bilibili/flv.js/blob/master/docs/cors.md#preflight-options-for-range-seek

fishami commented 5 years ago

public void addResourceHandlers(ResourceHandlerRegistry registry) { registry.addResourceHandler("/media/**").addResourceLocations("file:"+convertPath); } 层主你的问题解决了吗?我的前端是通过localhost:8080/media/1.flv来获取资源,后端配置了一个资源处理器直接访问这个视频,点播后端需要怎么写?

fishami commented 5 years ago

我的也是这个问题,前端没配置好,后端也不知道该怎么实现。

VirusCIH commented 5 years ago

没有相关的文档最终我没有用flv.js, 最后还是用的flash来播放

------------------ 原始邮件 ------------------ 发件人: "fishami"notifications@github.com; 发送时间: 2019年1月16日(星期三) 上午10:20 收件人: "bilibili/flv.js"flv.js@noreply.github.com; 抄送: "VirusCIH"601406107@qq.com; "Author"author@noreply.github.com; 主题: Re: [bilibili/flv.js] 点播flv格式文件,拖动进度条超过缓存,缓存会自动清空问题,并因此视频停止在这里 (#409)

public void addResourceHandlers(ResourceHandlerRegistry registry) { registry.addResourceHandler("/media/**").addResourceLocations("file:"+convertPath); } 层主你的问题解决了吗?我的前端是通过localhost:8080/media/1.flv来获取资源,后端配置了一个资源处理器直接访问这个视频,点播后端需要怎么写?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or mute the thread.

fishami commented 5 years ago

好的,谢谢层主的解答。

hnyaoqingping commented 5 years ago

不跨域也有这个问题,seek到没缓存的位置,就卡住不动了。

hnyaoqingping commented 5 years ago

我的问题已经解决了,多段flv视频可随便seek。关键是flv文件的"keyframes 关键帧索引表"要弄好。

eagleCloudShangYuFei commented 1 month ago

我的问题已经解决了,多段flv视频可随便seek。关键是flv文件的"keyframes 关键帧索引表"要弄好。

你好,请问是怎么做到的

eagleCloudShangYuFei commented 1 month ago

@hnyaoqingping