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

Java Development

Reply
Highlighted
Developer
Posts: 139
Registered: ‎05-25-2009
My Device: Not Specified
Accepted Solution

Could not able to play video in the application?

Hi friends,

        I wish to run one video files in my application.I created one SDCard .If i keep the file directly inside video folder i can able to play if i keep the same file inside another folder and keep the folder inside the video means i could not play..can anyone clarify me why i could not play the video .

BlackBerry Development Advisor
Posts: 15,753
Registered: ‎07-09-2008
My Device: BlackBerry PRIV
My Carrier: Bell

Re: Could not able to play video in the application?

What BlackBerry Smartphone model and BlackBerry device software version are you testing on?  You can find this under Options, About on the BlackBerry Smartphone.  How are you trying to play the video?  Are you invoking the built in media player or using the Player class?  What error or exception are you seeing?

Mark Sohm
BlackBerry Development Advisor

Please refrain from posting new questions in solved threads.
Problem solved? Click the Accept As Solution button.
Found a bug? Report it using Issue Tracker
Developer
Posts: 3,951
Registered: ‎07-15-2008
My Device: Not Specified

Re: Could not able to play video in the application?

Can you post the two paths which you are using?


Use Search. "Accept Solution" If the problem is resolved.
Developer
Posts: 638
Registered: ‎07-02-2009
My Device: Not Specified

Re: Could not able to play video in the application?

[ Edited ]

Hi saravanakumaran,

 

with your permission, am also adding my query to this post. as am alos facing the same issue. i followed the KB article to play video in the app, i just modified it according my path, i included my video file into the project for the sake of testing.

 

but i failed to run the app. when i debug, i found the error at the videoControl, as it is not intializing and returning null. hence null pointer exception.

 

sorry to intercept into your post. the following is my code....

try
{
// String []supportedformats = javax.microedition.media.Manager.getSupportedContentTypes(null);
// for(int i =0;i<supportedformats.length;i++)
// ms.add(new LabelField(supportedformats[i]));
//Create a new Player pointing to the video file.
//This can use any valid URL.
// player = Manager.createPlayer("file:///SDCard/Pearl.avi");
InputStream is = getClass().getResourceAsStream("video/10.mpeg");
// player = Manager.createPlayer("file:///SDCard/videos/TheLastColdOne_JS_Oct-09.wav");
player = Manager.createPlayer(is, "video/mpeg");

player.realize();

//Create a new VideoControl.
videoControl = (VideoControl)player.getControl("VideoControl");
//Initialize the video mode using a Field.
videoControl.initDisplayMode(VideoControl.USE_GUI_PRIMITIVE, "net.rim.device.api.ui.Field");

//Set the video control to be visible.
videoControl.setVisible(true);
}
catch (Exception ex)
{
System.out.println(ex.toString());

 

 

 

Thanks and Regards,
PraveenGoparaju.
Developer
Posts: 3,951
Registered: ‎07-15-2008
My Device: Not Specified

Re: Could not able to play video in the application?

Got a chance to try other video format.. like 3gp?


Use Search. "Accept Solution" If the problem is resolved.
Developer
Posts: 638
Registered: ‎07-02-2009
My Device: Not Specified

Re: Could not able to play video in the application?

i didnt tried with 3gp, but when run this piece of code, it gvives mpeg also as teh supported format. so i think it should work.

 

 

String []supportedformats = javax.microedition.media.Manager.getSupportedContentTypes(null);
        	for(int i =0;i<supportedformats.length;i++)
        			ms.add(new LabelField(supportedformats[i]));

 

that to i dont have any 3gp format, right now with me. and anyway i need to play the clients video file of type mpeg. so can you suggest me solution.

 

Thanks and Regards,
PraveenGoparaju.
Developer
Posts: 3,951
Registered: ‎07-15-2008
My Device: Not Specified

Re: Could not able to play video in the application?

What is your testing environment?


Use Search. "Accept Solution" If the problem is resolved.
Developer
Posts: 139
Registered: ‎05-25-2009
My Device: Not Specified

Re: Could not able to play video in the application?

Thanks friends i can able to play the video now i changed the format to .3gp now its working fine.

Developer
Posts: 638
Registered: ‎07-02-2009
My Device: Not Specified

Re: Could not able to play video in the application?

 


 

Thanks friends i can able to play the video now i changed the format to .3gp now its working fine.

 


 

 

@BBdeveloper am working  on storm 4.7, with eclipse ide.

 

does blackberry support  mpeg???and i found this in teh supported format list. but my mpeg is not playing...Smiley Sad

 

@saravankumaran what make your app working fine, did you add any additional code for that?

 

 

Thanks and Regards,
PraveenGoparaju.
Developer
Posts: 3,951
Registered: ‎07-15-2008
My Device: Not Specified

Re: Could not able to play video in the application?

Devices will play, may be the issue with Simulator?


Use Search. "Accept Solution" If the problem is resolved.