Fix WinRT Audio elements cannot play Qt resouce audio files
authorPeng Wu <peng.wu@intopalo.com>
Thu, 12 Mar 2015 07:45:02 +0000 (00:45 -0700)
committerYoann Lopes <yoann.lopes@theqtcompany.com>
Tue, 17 Mar 2015 14:32:31 +0000 (14:32 +0000)
URL argument of Windows media API SetSourceFromByteStream can not be
empty. Initial proper value for playing audio stream case.

Task-number: QTBUG-42263
Change-Id: If0bb44b60d517228bfe8b6cb30afeeb4a8ac62d3
Reviewed-by: Andrew Knight <qt@panimo.net>
Reviewed-by: Yoann Lopes <yoann.lopes@theqtcompany.com>
src/plugins/winrt/qwinrtmediaplayercontrol.cpp

index 50f76fd..333a6d1 100644 (file)
@@ -752,7 +752,7 @@ void QWinRTMediaPlayerControl::setMedia(const QMediaContent &media, QIODevice *s
     }
     emit mediaChanged(media);
 
-    QString urlString;
+    QString urlString = media.canonicalUrl().toString();
     if (!d->stream) {
         // If we can read the file via Qt, use the byte stream approach
         foreach (const QMediaResource &resource, media.resources()) {