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