-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
VWeb; No function to send raw data #21743
Comments
For this usecase you can call If your usecase is sending a file you can also use veb's new The pub fn (mut app App) video(mut ctx Context) vweb.Result {
return ctx.file('path/to/mp4/file')
} (haven't tested the code) |
Thank you for the response.
pub fn (mut app App) video2() vweb.Result {
return app.Context.file('path/to/mp4/file')
} Yes, indeed it is "faster" but the seeking option for the video file not working now... So thank you, but your answer is not good. On the other hand, I found the workaround this way: app.Context.send_response_to_client('video/mp4', buf.bytestr())
return vweb.not_found() |
|
I rewrote just this part, to |
Describe the bug
With a previous version of vweb I wrote a code, to serve video files.
I used this code:
And worked.
Now there is a fix, whereas the
ok
function now sets the statusWhich is working as expected, but this eliminated the possibility of sending other kind of code.
I looked at all the other function, which can send code, back to the client, with the return type vweb.Result, and found none which can do what I need.
I saw that here is the
send_response_to_client
function, which will do what I need, but that does not return thevweb.Result
type.I propose to add a
send
orsend_raw
or something like this function, to accommodate this use-case above.Reproduction Steps
Expected Behavior
Can send arbitrary mimetype and status code
Current Behavior
Cant send arbitrary mimetype and status code
Possible Solution
Additional Information/Context
Video streaming and using
Partial Content 206
andvideo/mp4
V version
V 0.4.6 100b3b0.dfdd752
Environment details (OS name and version, etc.)
OS: windows, Microsoft Windows 11 Pro v22631 64-bit
Processor: 6 cpus, 64bit, little endian,
Note
You can use the 👍 reaction to increase the issue's priority for developers.
Please note that only the 👍 reaction to the issue itself counts as a vote.
Other reactions and those to comments will not be taken into account.
The text was updated successfully, but these errors were encountered: