prabhu
prabhu

Reputation: 1206

How to play video in video player using platformRequest(URL) in J2ME

In my app I'm trying to play a video from SD card using platformRequest(URL). Here is the code i used to do it - platformRequest("file:///E:/bega.3gp") . I don't know this is the correct way to do it. Is the path format is correct ? please suggest me a way to play a video in video player from my app.

Upvotes: 0

Views: 197

Answers (1)

Vishal
Vishal

Reputation: 355

Just make sure you are passing the correct path. Using below code you will able to know which are the avalable paths you have.

 private String getFullMusicPath() {
    Enumeration drives = FileSystemRegistry.listRoots();
    String root = null;
    while (drives.hasMoreElements()) {
        root = (String) drives.nextElement();
        if (root.equalsIgnoreCase("sdcard/")) {
            return "file:///" + root + musicFolder + "/";
        }
    }
    return (root == null ? null : "file:///" + root + musicFolder + "/");
}

Upvotes: 1

Related Questions