×

Discussion Board

Results 1 to 13 of 13
  1. #1
    Regular Contributor
    Join Date
    Oct 2009
    Location
    Assam, India
    Posts
    93

    Exclamation Video player (populating list into it)

    PHP Code:
    I am trying to develop a player to play video files from the device

    Already I have done it by keeping video files in the project's res folder.

    But now I want to list out the available video files from the device only and select a particular one and to play it. 

    Can you tell me how can we bring the list of video files from the device into our application?

    Please help me out of this... 

  2. #2
    Regular Contributor
    Join Date
    Nov 2009
    Posts
    53

    Re: Video player (populating list into it)

    Use JSR 75-File Connection API, get the list of video files in a particular directory. Show the list, select one particular item, play that file.

  3. #3
    Regular Contributor
    Join Date
    Oct 2009
    Location
    Assam, India
    Posts
    93

    Re: Video player (populating list into it)

    In that case is there any chance that the default player of the device might be used?

    I want my player only to be used.

    And again how can we get the lists after connecting to the directory? In this case will it be device specific? Because I think the directory of video files may differ with different devices.

  4. #4
    Regular Contributor
    Join Date
    Oct 2009
    Location
    Assam, India
    Posts
    93

    Re: Video player (populating list into it)

    Please suggest me how can we list out the available video files from the device into our own application.

  5. #5
    Super Contributor
    Join Date
    Apr 2009
    Posts
    572

    Re: Video player (populating list into it)

    have you tried with

    PHP Code:
    String filePath =  System.getProperty("fileconn.dir.videos"); 
    nd when u get the path search for at least 3GP files as most of the multimedia handsets support atleast this format following link will help u in this regard

    nd AFAIK the default device player is only called when we use platform request so you can create your own player and play the files in that only in other words one can use their player to play media content
    Regards,
    Saurabh

  6. #6
    Regular Contributor
    Join Date
    Oct 2009
    Location
    Assam, India
    Posts
    93

    Re: Video player (populating list into it)

    Hi ingsaurabh,

    I have checked the code

    PHP Code:
    String filePath =  System.getProperty("fileconn.dir.videos"); 
    Ya it lists out the video files stored within the device(It gives all the names only). Now will it be possible for our application to play them with their name only. I just want to know whether it gives the location with the name or not? Or we have to write extra code for that.

    And can you tell me what we have to mention in the filePath if we need to list out the audio files?

  7. #7
    Super Contributor
    Join Date
    Apr 2009
    Posts
    572

    Re: Video player (populating list into it)

    Ya it lists out the video files stored within the device(It gives all the names only).
    actually the filpath variable will return the exact complete path of your videos folder of device

    Now will it be possible for our application to play them with their name only. I just want to know whether it gives the location with the name or not? Or we have to write extra code for that.
    no one cant play files with their names only u have to make path by string concatenation of folder path to filenames path

    And can you tell me what we have to mention in the filePath if we need to list out the audio files?
    the link I posted will give you all the file names u can directly show them as list and on coding side when a song is selected u will create the full path by concatenating
    Regards,
    Saurabh

  8. #8
    Super Contributor
    Join Date
    Sep 2008
    Location
    Noida, U.P.
    Posts
    1,330

    Thumbs up Re: Video player (populating list into it)

    Quote Originally Posted by dhiraj.deka View Post
    Please suggest me how can we list out the available video files from the device into our own application.
    For listing Video or any file from FileSystem you have to go with JSR 75 FileConnection API. You have to iterate each folder on ur filesystem and have to check extensions of each file on filesystem. As you find any vidoe file then just add the address of that file to a Vector. As u get all the addresses of video files on FS then just use that address to play the video. Just make a URL like this

    String URL = "file:///"+vector.elementAt(elementnumber)+"Connector.READ";

    If your application targets to only Nokia S60 devices then u can use the native player of the application else while you cant.

    For S60 devices to call native player:
    platformRequest("file:///path of the video file..");

    In other cases:

    U have to take use of MMAPI. :
    Player player = Manager.createPlayer("file:///file path..");
    // PREFETCH THE PLAYER
    //REALIZE THE PLAYER
    // GET VIDEOCONTROL
    START THE PLAYER..
    thanks,
    jitu_goldie..

    KEEP TRYING..

  9. #9
    Regular Contributor
    Join Date
    Oct 2009
    Location
    Assam, India
    Posts
    93

    Re: Video player (populating list into it)

    Hi Jitu,

    Can you tell me how can I check the whole file system for a specific file extension? Is there any link which will give me tutorial for that?

  10. #10
    Super Contributor
    Join Date
    Apr 2009
    Posts
    572

    Re: Video player (populating list into it)

    this you have to do manually I searched though buty couldn't find the exact solution BTW this might be helpful
    Regards,
    Saurabh

  11. #11
    Regular Contributor
    Join Date
    Oct 2009
    Location
    Assam, India
    Posts
    93

    Re: Video player (populating list into it)

    Hi saurabh thanx for your reply.

    But I think the link you have given might not work with j2me.

    Because as I know j2me does not have FileUtils class like java.

    My problem is that I have to search the whole device for particular extensions(such as .amr).

    Will it be good to create a separate thread for this?

  12. #12
    Super Contributor
    Join Date
    Apr 2009
    Posts
    572

    Re: Video player (populating list into it)

    yeah its better to make a separate thread for this as the title is no more relevant to your current problem also you are right the code is for j2se not j2me I gave it just for an idea since I havent tried it yet so dont have the code rt now may be some other seniors here may help u in this regard
    Regards,
    Saurabh

  13. #13
    Regular Contributor
    Join Date
    Oct 2009
    Location
    Assam, India
    Posts
    93

    Re: Video player (populating list into it)

    Ok thanx saurabh. I will start a new thread for my problem.

Similar Threads

  1. Can't find Serial Port
    By AliceC in forum Symbian
    Replies: 3
    Last Post: 2009-10-15, 11:23
  2. Video player on CustomItem
    By dyuen000 in forum Mobile Java Media (Graphics & Sounds)
    Replies: 3
    Last Post: 2007-07-02, 18:32
  3. Play video in nokia 6680 by real player
    By rock2007 in forum Mobile Java Media (Graphics & Sounds)
    Replies: 3
    Last Post: 2007-04-23, 19:36
  4. Replies: 1
    Last Post: 2005-06-16, 12:15

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×