For your first question, the Range parameter isn't a calculation. So the (-) hyphen there can be read as, 'grab a range of bytes starting at byte 65(up too)128'. So it wouldn't be negative.
Your second questions is really good. This is where the simplicity of NodeJS Readable Stream API comes in. When this stream is in the data flowing mode, it will call the _read() method whenever there is room in the buffer (and the stream is not paused). So you don't need to write in a loop, the super class Readable handles all this for you!
Hope this helps! If you have any other questions please let me know!
That would need to be handled on the frontend. Once the S3DownloadStream grabs a range, it just pushes it through to the output. Seeking would be handled by the video player
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
For your first question, the Range parameter isn't a calculation. So the (-) hyphen there can be read as, 'grab a range of bytes starting at byte 65(up too)128'. So it wouldn't be negative.
Your second questions is really good. This is where the simplicity of NodeJS Readable Stream API comes in. When this stream is in the
data flowing
mode, it will call the_read()
method whenever there is room in the buffer (and the stream is not paused). So you don't need to write in a loop, the super classReadable
handles all this for you!Hope this helps! If you have any other questions please let me know!
How can we handle seeking of the video?
I have created a simple video element but I am not able to seek video. Is there anything we have to do in
S3DownloadStream
class to make it work?I am using Next.js for UI.
@about14sheep
That would need to be handled on the frontend. Once the S3DownloadStream grabs a range, it just pushes it through to the output. Seeking would be handled by the video player