Fix WinRT Audio elements cannot play Qt resouce audio files

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>
This commit is contained in:
Peng Wu
2015-03-12 00:45:02 -07:00
committed by Yoann Lopes
parent 64b75cc1d7
commit 10354f4127

View File

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