Http file url to not-sequential QIODevice
-
wrote on 4 Oct 2022, 14:40 last edited by Dmitry87 10 Apr 2022, 14:43
Hello everyone. I have an URL to a huge video file stored on an https server. I need to access it using QIODevice in non-sequential mode i.e. read arbitrary pieces of the file. Does Qt provide any interface to implement this thing?
I know QMediaPlayer can request pieces, but I don't see how it is implemented. -
wrote on 6 Oct 2022, 05:05 last edited by
You do this with HTTP range requests (assuming the sending server supports it). You may need to manually add a Range header with QNetworkRequest::setRawHeader() because it is not exposed as a known header. Each response comes back to you as a QIODevice that you typically read sequentially.
1/2