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

mp4文件浏览器可以访问,视频播放器播放不了 #419

Open
wengxianxun opened this issue Mar 20, 2024 · 2 comments
Open

mp4文件浏览器可以访问,视频播放器播放不了 #419

wengxianxun opened this issue Mar 20, 2024 · 2 comments

Comments

@wengxianxun
Copy link

代码:
File file = File(videoModel.video_path!);
return shelf.Response.ok(File(file.path!).openRead(),
headers: {'Content-Type': 'video/mp4'});

url: http://192.168.31.46:8080/kkk/1.mp4

当我像上面那样设置返回一个视频,在浏览器可以正常打开视频, 但是用视频播放器打开播放不了,还需要设置什么参数吗?

@pedia
Copy link

pedia commented Mar 21, 2024

I think you should support http range request

应该实现 http range,dlna 播放器依赖 range 实现进度控制

Web server 需要申明 accept-ranges, shelf_static较好实现了这个功能。

@wengxianxun
Copy link
Author

I think you should support http range request

应该实现 http range,dlna 播放器依赖 range 实现进度控制

Web server 需要申明 accept-ranges, shelf_static较好实现了这个功能。

用shelf_static实现了,感谢大哥提点。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants