Welcome!

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


Thank you for visiting the BlackBerry Support Community Forums.

BlackBerry will be closing the BlackBerry Support Community Forums Device Forums on April 1st (Developers, see below)

BlackBerry remains committed to providing excellent customer support to our customers. We are delighted to direct you to the CrackBerry Forums, a well-established and thorough support channel, for continued BlackBerry support. Please visit http://forums.crackberry.com or http://crackberry.com/ask. You can also continue to visit BlackBerry Support or the BlackBerry Knowledge Base for official support options available for your BlackBerry Smartphone.

"When we launched CrackBerry.com 10 years ago, we set out to make it a fun and useful destination where BlackBerry Smartphone owners could share their excitement and learn to unleash the full potential of their BlackBerry. A decade later, the CrackBerry community is as active and passionate as ever and I know our knowledgeable members and volunteers will be excited to welcome and assist more BlackBerry owners with their questions."

- Kevin Michaluk, Founder, CrackBerry.com

Developers, for more information about the BlackBerry Developer Community please review Join the Conversation on the BlackBerry Developer Community Forums found on Inside BlackBerry.


Reply
New Developer
Posts: 11
Registered: ‎02-16-2014
My Device: BlackBerry Q5
My Carrier: Claro
Accepted Solution

Streaming audio BlackBerry Cascades

[ Edited ]

Hello,

 

I was trying some example codes about streaming:

Well, unfortunately any of them works for me. This is the code I implemented from the first link:

 

import bb.cascades 1.0
import bb.multimedia 1.0
// ...
Page {
Container {
// ...

attachedObjects: [
MediaPlayer {
id: player
sourceUrl: "http://198.50.238.203:7014"

// Set these properties for video
videoOutput: VideoOutput.PrimaryDisplay
windowId: fwcVideoSurface.windowId

onMediaStateChanged: {
switch (player.mediaState) {
case MediaState.Unprepared:
break;
case MediaState.Prepared:
break;

}
}
}
]
ForeignWindowControl {
id: fwcVideoSurface
windowId: "myVideoSurface"
visible: boundToWindow

updatedProperties: WindowProperty.Size |
WindowProperty.Position |
WindowProperty.Visible
}

// ...

Button {
id: btnPlay
text: "Play"
onClicked: {
if (player.play() != MediaError.None) {
// Your error handling code here.
}
}
}

Button {
id: btnStop
text: "Stop"
onClicked: {
player.stop();
}
}

Button {
id: btnReset
text: "Reset"
onClicked: {
player.reset();
}
}
}
}

 

 

 

I have opened the pls file (http://198.50.238.203:7014/listen.pls). So, I get this url: http://198.50.238.203:7014/
When I pressed play button from the first example, I got this message (I cannot listen the music) in console of QNX Momentics IDE:

 

START 1 MediaPlayer::play 
START 1 MediaPlayer::prepare 
START 1 MediaPlayerPrivate::generateAudioOutputUrl 
MediaPlayerPrivate::generateAudioOutputUrl: audioOutput=Default
=> END 1 ( 1 ms): 
START 1 MediaPlayerPrivate::generateVideoOutputUrl 
MediaPlayerPrivate::generateVideoOutputUrl: videoOutput=PrimaryDisplay
MediaPlayerPrivate::generateVideoOutputUrl: windowId="myVideoSurface"
MediaPlayerPrivate::generateVideoOutputUrl: windowGroupId="mainWindow-174317799-36F3F97AA7224633-0"
=> END 1 ( 2 ms): 
START 1 MediaPlayerPrivate::updateAudioOutputParams 
=> END 1 ( 1 ms): 
START 1 MediaPlayerPrivate::attachInput 
MediaPlayerPrivate::attachInput: url=QUrl("http://198.50.238.203:7014") 
UIToolkitSupport: Unrecognized scheme "http" 
MediaPlayerPrivate::attachInput: Attempting to attach input. url="http://198.50.238.203:7014", type="playlist"
START 1 MediaPlayerPrivate::lastError 
=> END 1 ( 0 ms): 
MediaPlayerPrivate::attachInput: Attempting to attach input. url="http://198.50.238.203:7014", type="autolist"
START 1 MediaPlayerPrivate::lastError 
=> END 1 ( 0 ms): 
MediaPlayerPrivate::attachInput: Unable to attach source input. url="http://198.50.238.203:7014", e=UnsupportedMediaType
=> END 1 ( 503 ms): 
MediaPlayer::prepare: Error attaching input source, error=UnsupportedMediaType
=> END 1 ( 508 ms): 
MediaPlayer::play: Unable to prepare the player. error=UnsupportedMediaType
=> END 1 ( 508 ms): 
START 1 MmrContextNotifier::onReadyRead 
MmrContextNotifier::onReadyRead: QMap(("@play-queue", PpsAttribute(Object, QFlags(0x4) ,  QMap() ) ) )  
START 1 MmrContextNotifier::onPpsPlayQueueChanged 
=> END 1 ( 0 ms): 
=> END 1 ( 1 ms): 
START 1 MmrContextNotifier::onReadyRead 
MmrContextNotifier::onReadyRead: QMap(("@play-queue", PpsAttribute(Object, QFlags(0x2) ,  QMap() ) ) )  
START 1 MmrContextNotifier::onPpsPlayQueueChanged 
=> END 1 ( 0 ms): 
=> END 1 ( 0 ms): 
Regular Contributor
Posts: 65
Registered: ‎08-29-2010
My Device: Z10
My Carrier: T-Mobile USA

Re: Streaming audio BlackBerry Cascades

I too have the same issue with streaming from an http source. Subscribing to this thread so hopefully we can find a solution together Smiley Happy
New Developer
Posts: 11
Registered: ‎02-16-2014
My Device: BlackBerry Q5
My Carrier: Claro

Re: Streaming audio BlackBerry Cascades

Please, somebody help us! 

New Developer
Posts: 11
Registered: ‎02-16-2014
My Device: BlackBerry Q5
My Carrier: Claro

Re: Streaming audio BlackBerry Cascades

Highlighted
Regular Contributor
Posts: 65
Registered: ‎08-29-2010
My Device: Z10
My Carrier: T-Mobile USA

Re: Streaming audio BlackBerry Cascades

Thank youuuuuu!!!

 

In my case i had to add / and ; to the end of the URL and i did not need to include foreignwindowcontrol in the code.