I want to use a Video
/MediaPlayer
QML element in my app, and have it play a video from a custom stream. QMediaPlayer
seems to support this since you can tell it to read from a QIODevice
which can do anything you want. But MediaPlayer
only supports a URL.
Is there any way I can register my own URL scheme that uses my own streaming protocol? For example, say I wanted to make rtsp2://...
, could I do something vaguely like:
class Rtsp2 : public QIODevice
{
// open, read, seek, close, etc.
}
QCoreApplication::registerUrlProtocol("rtsp2", Rtsp2);