Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Native Development

New Contributor
Posts: 3
Registered: ‎01-02-2013
My Device: None
My Carrier: None

Video streaming in Z30


We are making an video streaming application. The application work fine in Z10, Q10 and Z30, but in Z30, when the video url contains spaces or %20, the MediaPlayer control does not work. Searching in the forums, I found an old post about this problem (for Z10).




I made an upgrade of my Z10 and Z30 to the last system version (Z10= and Z30= and I had the same results. I tried force the url to be escaped using QUrl::toEncode(), but its not working.


Anyone have any idea? 




Posts: 127
Registered: ‎02-27-2012
My Device: Bold
My Carrier: Rogers

Re: Video streaming in Z30

Hi Daniel,

From your post, I am assuming you meant that it works on Z10, Q10 and Q5* (instead of Z30) but it doesn't work on Z30. I'm also concluding that you seem to be having this issue only in 10.2 OS versions, correct? (i.e. the same code works on devices running 10.1 OS version).

If this is what I think it is, we have heard simlar reports for playing URLs which have already been encoded

I reached out to the dev team and they let me know in 10.1, this was actually a bug. In 10.1, you may have gotten around it by using a work around. Unfortunately, if you did use the work around in your app for 10.1, when the users upgrade to 10.2, the platform most likely wouldn’t be able to handle it and the app will break.


Basically, you can try to do something like this if you need to handle the encoded URL differently between the OS versions:


QUrl u;

    bb:Smiley Tonguelatform:Smiley TonguelatformInfo info;

    QString osVersion = info.osVersion();


    if(osVersion.startsWith("10.0") || osVersion.startsWith("10.1")) {

       u.setEncodedUrl(szMediaURI.toAscii());  // <-- In 10.1, you were most likely having to turn the URL into ASCI and encode again

    } else {

       u.setUrl(szMediaURI);  // <--- In 10.2, you aren't having to do anything


    m_pMediaPlayer->setSourceUrl( u );




My apologies on behalf of the platform for the lack of documentation in the release notes; I’m trying to work with the docs team to make sure this gets more attention. 

Let us know if this is indeed the issue you were facing and if this solves it.


Application Development Consultant | Developer Relations



New Contributor
Posts: 3
Registered: ‎01-02-2013
My Device: None
My Carrier: None

Re: Video streaming in Z30

Hi Rashid, 


Thanks for the response, but don't work yet. 


I wrote the next example to explain my problem. Using the Z30 device (, I have a QML with the next code:



import bb.cascades 1.0
import bb.multimedia 1.0
import bb.system 1.0

Page {
Container { layout: DockLayout {} attachedObjects: [ MediaPlayer { id: vidPlayer sourceUrl: "http://www.stormbasicgames.com/test/supercrash.mp4" // work // sourceUrl: "http://www.stormbasicgames.com/test/super%20crash.mp4" // don't work // sourceUrl: "http://www.stormbasicgames.com/test/super crash.mp4" // don't work videoOutput: VideoOutput.PrimaryDisplay // The name of the window to create. windowId: fwcVideoSurface.windowId onMediaStateChanged: { if (vidPlayer.mediaState == MediaState.Prepared) { vidPlayer.play(); } } onSourceUrlChanged: { if (vidPlayer.prepare() != MediaError.None) { myQmlToast.show(); } } onError: { myQmlToast.show(); } onPlaybackCompleted: { // onBack(); } }, SystemToast { id: myQmlToast body: "Error!!!" } ] ForeignWindowControl { id: fwcVideoSurface windowId: "myVideoSurface" verticalAlignment: VerticalAlignment.Center; horizontalAlignment: HorizontalAlignment.Center; updatedProperties: WindowProperty.Size | WindowProperty.Position | WindowProperty.Visible preferredWidth: dispOrientation == UIOrientation.Portrait ? Application.displayWidth : Application.displayHeight; preferredHeight: dispOrientation == UIOrientation.Portrait ? Application.displayHeight : Application.displayWidth; } Button { text: "Play"; onClicked: { vidPlayer.play(); } } }



In the MediaPlayer control there are three URL to test, only the url without spaces works.


The same code in Z10 (os works fine.


Thanks a million.