Http file url to not-sequential QIODevice
-
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. -
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.