11-06-2012 07:54 AM
Hi,
I already have a thread but the post was not in the right category. http://supportforums.blackberry.com/t5/Native-Deve
I was trying to play audio/video. Presently I followed this (https://developer.blackberry.com/cascades/document
Also the audio/video streaming is not working.
I followed this (https://developer.blackberry.com/cascades/document
11-06-2012 10:56 AM
Hi,
I have the very same problem here.
On the Dev Alpha (beta3) I succeded in streaming an mp4 file from an http source, but can't see any video output at all.
Looking forward for any advice.
Thanks,
Antonio
11-06-2012 07:43 PM
you might want to post some code to help you identify the issue?
probably an issue with how you configured your foreigncontrol...
11-07-2012 01:51 AM - edited 11-07-2012 02:01 AM
I did a small research and found that there were some issue in videoOutput property of MediaPlayer class.
i tried the below code and able to play Local Audio/Video file.
attachedObjects: [
MediaPlayer {
id: myPlayer
// sourceUrl: ""
videoOutput: VideoOutput.PrimaryDisplay
windowId: videoSurface.windowId // name of the window to create
}
]
ForeignWindowControl {
id: videoSurface
windowId: "myVideoSurface"
updatedProperties: WindowProperty.Size | WindowProperty.Position | WindowProperty.Visible
visible: boundToWindow
// preferredWidth: 1280
// preferredHeight: 768
preferredWidth: 640
preferredHeight: 480
}call the url from Button clicked
Button {
id: Button4
text: qsTr("Play Video Local WMV")
layoutProperties: StackLayoutProperties {
spaceQuota: 1.0
}
onClicked: {
videoSurface.visible = true;
myPlayer.setSourceUrl("asset:///sounds/BB10DevAlph a.wmv")
myPlayer.play()
}
}
The above code helps me to play local audio/video, not remote(streaming). Now my question is.
1. How can I play streaming (RTSP/HTTP) audio/video using the same MediaPlayer class.
2. How can I play streaming (RTSP/HTTP) audio/video using Media Previewer using Invocation Framework, so that I can launch default Media Player of the device and starts playing content. I mean how to Invoke the Media Previewer to play a file.
I followed this https://developer.blackberry.com/cascades/document
Button {
id: Button5
text: qsTr("Launch Default Player ")
layoutProperties: StackLayoutProperties {
spaceQuota: 1.0
} attachedObjects: [
Invocation {
id: invoke
query: InvokeQuery {
mimeType: "video/audio"
uri: "http://www.mydomain.com/60820828.mp4"
}
}
]
onClicked: {
invoke.trigger("bb.action.OPEN")
}
} I saw this tutorial http://rapidberry.net/native-api-deep-dive-multime
11-07-2012 05:25 AM
Hi Guys,
Now I am able to play local Audio/video in default player also. But getting Error 13 when put an remote url. Here is the code.
void MultimediaTest1::handleInvokeButtonClick()
{
//exit(1);
InvokeRequest cardrequest;
cardrequest.setMimeType("audio/video");
cardrequest.setTarget("sys.mediaplayer.previewer") ;
cardrequest.setUri("file:///accounts/1000/shared/m usic/sample.mp3");
InvokeManager invokemanager;
invokemanager.invoke(cardrequest);
}
I call this Qt C++ function from my QML file, and it plays local videos, but if I set an URL in setUri() method , getting the error.
11-07-2012 09:31 AM - edited 11-07-2012 10:08 AM
Hey Guys,
I got one more update, I can play remote audio/video if the url doesn't have space or %20 in it.
How can I play urls which has %20 in it. I tried QUrl::fromEncoded("http://... %20...") but is not woking.
Could any please help me how to play encoded url.
11-07-2012 09:37 AM - edited 11-07-2012 09:38 AM
Did you manage to play remote mp4 videos or just audio?
I still have sound but no video output at all on a remote mp4 file (HTTP protocol).
11-07-2012 10:11 AM
I am able to play Audio/Video from Local and Remote location in Custome player and Device default player.
The only issue I have is I can't play Encoded Remote Url, a Url which has Space or %20 in it.
It would be really nice if anyone can help me to play encoded Url. I think its the QUrl which is causing the issue.
11-07-2012 10:34 AM
Still no luck here...
I'm using this piece of QML, based on the official docs, and I still get white screen (but I can hear the sound of the stream correctly).
import bb.cascades 1.0
import bb.multimedia 1.0
Page {
attachedObjects: [
MediaPlayer {
id: myPlayer
sourceUrl: "http://somewhereintheweb/video.mp4"
videoOutput: VideoOutput.PrimaryDisplay
windowId: videoSurface.windowId
}
]
ForeignWindowControl {
id: videoSurface
windowId: "myVideoSurface"
updatedProperties: WindowProperty.Size | WindowProperty.Position | WindowProperty.Visible
visible: boundToWindow
preferredWidth: 640
preferredHeight: 480
}
onCreationCompleted: {
myPlayer.play();
}
}From the C++ side I have this very small snippet:
// Test video
QmlDocument *qml = QmlDocument::create("asset:///testvideo.qml");
Page* root = qml->createRootObject<Page>();
Application::instance()->setScene(root);
11-07-2012 11:14 AM