Play audio file on BlackBerry Storm - blackberry

I want to play an mp4 audio file from a URL. This code works for a non-touch device, but I am facing a problem playing on the Storm.
Player player = javax.microedition.media.Manager.createPlayer(url);//_source
System.out.println("******************LoginScreen.player" + LoginScreen.player);
playerListener = new MediaPlayerListener();
LoginScreen.player.addPlayerListener(playerListener);
LoginScreen.player.realize();
LoginScreen.player.prefetch();
LoginScreen.player.start();

As you are using a HTTP location, you should specify an interface.
For wifi: ;interface=wifi
Thus your url should be like so:
String url= "http://yoursite.com/file.m4a;deviceside=true;interface=wifi";
Player player = javax.microedition.media.Manager.createPlayer(url);//_source

Check if your file is created with the supported codecs for Blackberry Storm
http://docs.blackberry.com/en/smartphone_users/deliverables/18349/711-01774-123_Supported_Media_Types_on_BlackBerry_Smartphones.pdf
that will be the reason why you can´t reproduce your audio file
for a MP4 Audio files playing in BlackBerry Storm smartphones the
supported codecs are: AAC-LC, AAC+, eAAC+
AMR-NB QCELP EVRC
for my experience sometimes you can reproduce files created with other codecs but you will find some problems on playin... =(
hope it helps

Related

iOS webm, ogg, ogv, mp4 playback in app

I have an app where we use OGVKit pod at the moment in order to play/stream webm/ogg/ogv/mov videos (non-local). Now there's the new requirement to be able to play mp4 videos from an URL (non-local) and OGVKit kust supports local playback of mp4 files.
Is there a good library which supports playback of all these video file formats from non-local storage (stream) or do we need to switch between the AVPlayerVoewController/AVPlayerLayer?
I already tried to implement a switch which uses AVPlayerLayer if the file is not webm or ogg which partially worked but I couldn't get the layouting work correctly.
I also tried to search for an appropriate library but haven't found any yet.
Any ideas?

ios Can I use MPMoviePlayerController to play .mp3 url

My app needs to play some music files, like .mp3. I would like to use MPMoviePlayerController because it has implemented all the UI stuff for me, i.e. I do not want to bother implementing progress slide bar and things like this.
I tested to use it to play a .mp3 file and it worked fine but I do not know if it is fine to use it to do this because its name says "movie player" and it seems it is supposed to play a movie. Would apple reject this? Thank you.
For playing audio from a file or memory, AVAudioPlayer is your best option but unfortunately it doesn't support a network stream while MPMoviePlayerController can
From documentation :
An instance of the AVAudioPlayer class, called an audio player,
provides playback of audio data from a file or memory.
Apple recommends that you use this class for audio playback unless you
are playing audio captured from a network stream or require very low
I/O latency.
For the Apple validation I don't think that your application can be rejected because you're using the Media Player Framework to play an audio file. In fact here they explicitly say that you can do just that:
Choose the right technology for your needs:
To play the audio items in a user’s iPod library, or to play local or
streamed movies, use the Media Player framework. Classes in this
framework automatically support sending audio and video to AirPlay
devices such as Apple TV.
Not sure about performance and memory issues though!
Best of luck.

how to do live streaming in iphone from the server?

I want to broadcast the video from the local server into the iPhone.
I only get link which is coming from the web-service with any extension of the video.
Video can be in any format..
LIKE :#"avi",#"wmv",#"rmvb",#"flv",#"f4v",#"swf",#"mkv",#"dat",#"vob",#"mts",#"ogg",#"mpg",#"wma"
so,which player is better for my app.
1)MPMovieplaycontroller or
2)AVPlayer controller
Please help me.
From the MPMoviePlayerController docs:
Supported Formats
This class supports any movie or audio files that already play correctly on an iPod or iPhone. This includes both streamed content and fixed-length files. For movie files, this typically means files with the extensions .mov, .mp4,.mpv, and .3gp and using one of the following compression standards:
H.264 Baseline Profile Level 3.0 video, up to 640 x 480 at 30 fps. (The Baseline profile does not support B frames.)
MPEG-4 Part 2 video (Simple Profile) If you use this class to play audio files, it displays a white screen with a QuickTime logo while the audio plays. For audio files, this class supports AAC-LC audio at up to 48 kHz, and MP3 (MPEG-1 Audio Layer 3) up to 48 kHz, stereo audio
You have to use 3rd Party libraries for your mentioned case
The built in media player won't support any of those formats.
Your only option is really a third party library like VLCKit. I've never used it, but it likely supports more formats that you require:
https://wiki.videolan.org/VLCKit/
Though I've never tried before, but I am sure you will get help from this apple documentation.
There is a nice discussion here about your problem. Sorry for not giving a direct answer. Hope this helps.. :)
This AVPlayer SDK DOC may be helpful for you. But as per your requirement you have go for third part or your custom implementations.

How to play video and audio extracted from mkv file in metro app

I have managed to read matroska container and able to extract video and audio streams from a mkv file in my metro app. Now, I don't know how to feed the streams for playing. I want to know the concept of throwing media data on display. I have another option to repack the video and audio(s) with subtitles into MP4 container which will be played by MediaElement by default but that will not look like having a matroska codec in my metro app.
So, basically my question is: How to use MediaElement or any display graph to read the video and audio pulled out from any video container.
Please guide me. Thanks.

Simultaneously playing and recording video on blackberry smartphone

I intend to record and play video at the same time on my application. I am using BlackBerry JDE 5.0 and the Blackberry 9550 .
I initialize two players, one to play media, and another one to record media. I used Manager.createPlayer(rtsp://server ip: port) to play video.
String myEncoding = "encoding=video/3gpp&width=360&height=480&fps=6&vi​?deo_rate=16000&rate=8000";
mRecordPlayer = javax.microedition.media.Manager.createPlayer("cap​ture://video?" + myEncoding);
mRecordPlayer.realize();
_recordControl = (RecordControl)mRecordPlayer.getControl("RecordCon​trol");
mRecordPlayer.start();
I have recorded to a file . but the file always is 0 kB. I do not believe this way :createPlayer("capture://video?" + myEncoding) can record video from other player. It just records video from camera.
Is it possible to achieve the desired functionality with the API's exposed by RIM.
I would really appreciate if anyone could provide some pointer or help to solve the above mentioned problems.

Resources