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

Reply
New Developer
jlsuarezcabrera
Posts: 11
Registered: ‎02-16-2014
My Device: BlackBerry Q5
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
shupor
Posts: 65
Registered: ‎08-29-2010
My Device: Z10

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 :smileyhappy:
New Developer
jlsuarezcabrera
Posts: 11
Registered: ‎02-16-2014
My Device: BlackBerry Q5

Re: Streaming audio BlackBerry Cascades

Please, somebody help us! 

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

Re: Streaming audio BlackBerry Cascades

Regular Contributor
shupor
Posts: 65
Registered: ‎08-29-2010
My Device: Z10

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.