I want to develop a j2me application that will play a video file(.mp4) by selecting a par开发者_开发技巧ticular directory on mobile phone(nokia s40 series).
How do i go about this?can anyone help me to initiate the above said process.
You need to use JSR-135 and JSR-75 to accomplish this. Check http://www.forum.nokia.com/document/Java_Developers_Library_v2/GUID-96C1B6E4-C266-42A9-9581-A6EEDAC44AC4_GUID-B6B3EB3A-05F6-4CD4-920A-8ED818328681.html for Nokia implementation notes for JSR-75 FileConnection.
Check http://www.forum.nokia.com/document/Java_Developers_Library_v2/GUID-96C1B6E4-C266-42A9-9581-A6EEDAC44AC4_GUID-F227753C-29F7-4056-AB46-1BD80F83E109.html for Nokia implementation notes for JSR-135 Mobile Media.
The Javadocs can be found: http://java.sun.com/javame/reference/apis/jsr135/ and http://www.forum.nokia.com/document/Java_Developers_Library_v2/GUID-D69FC49D-783E-45CE-80D4-7A9F3EE08B2A/overview-summary.html .
Note that only certain directories are exposed via Java ME. You can find information on which folders under the System properties link in the JSR-75 link above.
Basically you want to do this:
- Use FileConnection to open a directory and list it contents.
- Let the user choose one of the files in the directory.
- Create a video player via JSR-135 with the file path as input: Player player = Manager.createPlayer("path_to_the_file");
- You also have to attach a VideoControl to the player that associoates a canvas/form to render the video on. (Use VideoControl.initDisplayMode). You also set all the video properties via this control, such as size, location etc.
- Then use player.start() to start the playback.
This is a pretty good starting tutorial: http://today.java.net/pub/a/today/2005/09/27/j2me4.html
精彩评论