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

Video content is not being served. #749

Closed
nojaf opened this issue Jun 1, 2022 · 5 comments
Closed

Video content is not being served. #749

nojaf opened this issue Jun 1, 2022 · 5 comments

Comments

@nojaf
Copy link
Collaborator

nojaf commented Jun 1, 2022

Hello,

I'm trying to include a video on a static HTML page.
The videos (*.mp4 and *.webm) are currently not playing and I believe that is because the mime types are not set by Suave.

let startWebServer rootOutputFolderAsGiven localPort =
let defaultBinding = defaultConfig.bindings.[0]
let withPort = { defaultBinding.socketBinding with port = uint16 localPort }
let serverConfig =
{ defaultConfig with
bindings = [ { defaultBinding with socketBinding = withPort } ]
homeFolder = Some rootOutputFolderAsGiven }
let app =
choose
[ path "/" >=> Redirection.redirect "/index.html"
path "/websocket" >=> handShake socketHandler
Writers.setHeader "Cache-Control" "no-cache, no-store, must-revalidate"
>=> Writers.setHeader "Pragma" "no-cache"
>=> Writers.setHeader "Expires" "0"
>=> Files.browseHome ]
startWebServerAsync serverConfig app |> snd |> Async.Start

https://github.com/SuaveIO/suave/blob/57d69e39e67a5b1a1c60b7c015c698a1901a9420/src/Suave/Combinators.fs#L90-L114

The Suave docs explain how to add an additional mime type: https://suave.io/files.html

Can I include some more mime types? Hardcoded or via settings?

@nojaf
Copy link
Collaborator Author

nojaf commented Jun 2, 2022

I actually already have another one: site.webmanifest.
Something flexible using settings might be the way to go here.

@nojaf
Copy link
Collaborator Author

nojaf commented Jun 30, 2022

Hello @dsyme and
@eiriktsarpalis, this issue was fixed in #752.
I've been using my local repository to start using this fix but someone else would be taking over that work. Could we have a release of this please?

@nojaf nojaf closed this as completed Jun 30, 2022
@dsyme
Copy link
Contributor

dsyme commented Jul 1, 2022

Yup. To make a release you can send a PR to release notes updating version and release should be automatic once merged

@dsyme
Copy link
Contributor

dsyme commented Jul 1, 2022

Please let me know if this doesn't go though OK

https://github.com/fsprojects/FSharp.Formatting/actions/runs/2593557770

@nojaf
Copy link
Collaborator Author

nojaf commented Jul 1, 2022

This worked, many thanks @dsyme

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

Successfully merging a pull request may close this issue.

2 participants