Created
February 25, 2016 07:55
-
-
Save shazin/52853a91083300c4b57d to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@RequestMapping(method = RequestMethod.GET, value = "/{video:.+}") | |
public StreamingResponseBody stream(@PathVariable String video) | |
throws FileNotFoundException { | |
File videoFile = videos.get(video); | |
final InputStream videoFileStream = new FileInputStream(videoFile); | |
return (os) -> { | |
readAndWrite(videoFileStream, os); | |
}; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment