Hi. I have problem with QWebView and custom QNetworkAccessManager class.
I want to use html5 video function to watch encrypted local videos. My code:
Qt Code:
  1. QWebSecurityOrigin::addLocalScheme("courses");
  2. m_view = new QWebView(this);
  3. m_view->page()->setNetworkAccessManager(new NetworkAccessManager);
  4. m_view->load(QUrl::fromLocalFile("index.html"));
To copy to clipboard, switch view to plain text mode 
Qt Code:
  1. <!DOCTYPE html>
  2. <html>
  3. <head> <meta
  4. charset="utf-8" /></head>
  5. <body>
  6. <img src="courses://test" />
  7. <video controls>
  8. <source src="courses://big_buck_bunny.cmp4" type="video/mp4" />
  9. </video>
  10. </body>
  11. </html>
To copy to clipboard, switch view to plain text mode 

Qt Code:
  1. #include "NetworkAccessManager.h"
  2. #include "NetworkReply.h"
  3. #include <QDebug>
  4.  
  5. NetworkAccessManager::NetworkAccessManager(QObject *parent) :
  6. QNetworkAccessManager(parent)
  7. {
  8. }
  9.  
  10. QNetworkReply *NetworkAccessManager::createRequest(Operation op, const QNetworkRequest &request, QIODevice *outgoingData)
  11. {
  12. qDebug() << request.url() << request.url().scheme();
  13. if (op != GetOperation || request.url().scheme() != "courses")
  14. return QNetworkAccessManager::createRequest(op, request, outgoingData);
  15. return new NetworkReply(this, request);
  16. }
To copy to clipboard, switch view to plain text mode 

QWebView is calling my NetworkAccessManager::createRequest function only for index.html and img, for video first it's says that gstreamer cannot pause - "link", and then: Error, courses URI schema is not implemented.
Could someone tell me how can I implement custom data reading for videos in webkit?