Java spring启动-文件系统资源支持字节范围?
我想要在spring boot中支持字节范围的流视频 我使用此功能:Java spring启动-文件系统资源支持字节范围?,java,spring,spring-boot,stream,video-streaming,Java,Spring,Spring Boot,Stream,Video Streaming,我想要在spring boot中支持字节范围的流视频 我使用此功能: @GetMapping("/stream/file-system-resource") @ResponseBody public FileSystemResource streamVideo() { return new FileSystemResource("local_storage/video/test3.mp4"); }
@GetMapping("/stream/file-system-resource")
@ResponseBody
public FileSystemResource streamVideo() {
return new FileSystemResource("local_storage/video/test3.mp4");
}
和html文件:
<video width="320" height="240" controls>
<source src="/video/stream/file-system-resource" type="video/mp4">
Your browser does not support the video tag.
</video>
您的浏览器不支持视频标记。
我使用SpringBoot2.3.3版本,一切都很好!FileSystemResource内部支持字节范围!?使用字节范围支持流式传输视频的最佳实践是什么