04-29-2013 01:28 PM
Hey Garette, The project contains 3 things, Audio with MediaPlayer, Image with ImageView and Audio with NotificationDialog (Sorry i include it here too for reporting)
1. The Audio with MediaPlayer works on 10.1.0.1485 since I use file picker. But my other app uses QDir, QFile, QFileInfoList, QFileInfo and
canonicalFilePath() to obtain the URL and it doesn't work. Sorry i don't have time to rewrite but basically when i debugging, I see in console at the step:
MediaPlayer::setSourceUrl: url=QUrl("/accounts/1000/shared/music/01. Escape.wav")
The MediaPlayer insert the "asset://" at the beginning of the QUrl and that's why it looks for the song in the assets folder and thus it failed to play since the song is not in assets folder.
2. ImageView: Doesn't work, doesn't show the Image, It shows on 10.0.
3. NotificationDialog sound: If the audio file name contains space, it doesn't play, in stead, it will play the default tone Essential. If you try the audio file without space in filename, it will play perfectly.
Please help testing and reporting.
Thank you so much Garette.
PS: Let me know if you need anything else.
04-29-2013 02:28 PM
Thanks! I reproduced the image issue and was actually able to also replicate the issue reported by rnickel, the only change was that I updated my SDK to 10.1.0.1483.
bbkeeper, could you toss an entry in JIRA for this? I will take ownership and escalate right after.
For the workaround, as you have noted, specifying "file://" before the file path appears to resolve the issue.
04-30-2013 02:41 PM
As an update, I've found out that this issue should only occur if using SDK version 10.1 or higher.
Working now to determine the best course of action forward. Will keep you posted.
05-01-2013 10:56 PM
Sorry, the solution to my problem was to add "file:///" in front of the picture path.
It's weird since when i use C++ to set the imagesource, I don't need that prefix
05-01-2013 11:03 PM
C++ might not need that. Thanks for the report.
05-03-2013 10:41 AM
So after digging through this it seems that referencing the absolute path from QML without using file:// was a bug that should not have occurred. As of 10.1 this has been changed so it is no longer supported.
What does this all mean?
If your app was compiled with a version of the SDK pre-10.1 it will continue to work as-is, no need to prefix your absolute paths with "file://", though this would be good to do anyways.
Also, if setting the imageSource/file reference from C++ you do not need to prefix the path with "file://" because C++ does not have the same parenting as in a QML file, QML treats references as relative whereas C++ wills ee them as absolute.
If using 10.1 SDK or higher and setting any resource paths within QML you will need to prefix the URI with "file://", this will include file paths returned from the FilePicker control.
I am submitting a feature request for the FilePicker so that you will have the option to decide whether the returned path begins with "file://" or not. This will maintain backwards compatibility and also allow devs to easily grab a path if assigning to a resource or without this prefix if used for some other purpose where it is not desired/needed.
I hope that clarifies the entire situation as it stands. If I missed anything or you have any questions pleasse let me know.
05-08-2013 02:59 PM
This has not been KBd:
Working to get docs and release notes updated to more overtly explain this change.
Thanks to all in the thread for helping narrow this one down!