×

Discussion Board

Results 1 to 6 of 6
  1. #1
    Registered User
    Join Date
    Feb 2007
    Posts
    25

    Exclamation Problems with media player

    I am tryin to create a media player that uses the MMAPI to open up a media file stored on the phone.

    i have tried using the MIDP: Mobile Media API develpoers guide with no success. When i load a stream nothing happens

    Code:
    inputStream is = getClass().getResourceAsStream(address);
                Player player = Manager.createPlayer(is,"video/3gpp");
                player.addPlayerListener(this);
                player.realize();
                player.prefetch();
                   
                VideoControl vc = (VideoControl)player.getControl("VideoControl");
                if (videoControl == null) {
                    midlet.alertError("VideoControl not supported"); 
                } else {
                  
                    vc.initDisplayMode(VideoControl.USE_DIRECT_VIDEO, this);
                    videoControl.setVisible(true);
                    player.start();  
                }
    i have also tried with :
    Code:
            try {
                //inputStream is = getClass().getResourceAsStream(address);
                Player player = Manager.createPlayer(address);
                player.addPlayerListener(this);
                player.realize();
                player.prefetch();
                   
                VideoControl vc = (VideoControl)player.getControl("VideoControl");
                if (videoControl == null) {
                    midlet.alertError("VideoControl not supported"); 
                } else {
                  
                    vc.initDisplayMode(VideoControl.USE_DIRECT_VIDEO, this);
                    videoControl.setVisible(true);
                    player.start();  
                }
    and have also tried
    Code:
            try {
                //inputStream is = getClass().getResourceAsStream(address);
                Player player = Manager.createPlayer(address);
                player.addPlayerListener(this);
                player.realize();
                player.prefetch();
                player.start();   
                VideoControl vc = (VideoControl)player.getControl("VideoControl");
                if (videoControl == null) {
                    midlet.alertError("VideoControl not supported"); 
                } else {
                  
                    vc.initDisplayMode(VideoControl.USE_DIRECT_VIDEO, this);
                    videoControl.setVisible(true);
                      
                }
    this one the sound will play but no video
    the other two examples just the alertError is created. Any help would be greatly appreciated. The try statements are caught but i just left that part of the code out to save room.
    Address is an app property that points on an address on the phone in this case file:///C:/Data/Vidoes/t2.3gp
    i have tried more than one file but none see to work.
    Last edited by michaelhann89; 2007-04-18 at 02:10.

  2. #2
    Registered User
    Join Date
    Jul 2003
    Posts
    14

    Re: Problems with media player

    Hi,

    You need to use fileconnection:

    import javax.microedition.io.file.*;

    FileConnection fc = (FileConnection)Connector.open(filepath);
    Player player = Manager.createPlayer(fc.openInputStream(),"video/3gpp");

    You also need to setup file access permissions.

    BR,

    Mik
    miklabs.com

  3. #3
    Registered User
    Join Date
    Feb 2007
    Posts
    25

    Re: Problems with media player

    i tried using the file connection like u said but it still comes up the the error that video control is not supported.i have no idea y. any help would be great.

    oh and its a nokia N80 if that helps
    Last edited by michaelhann89; 2007-04-18 at 01:54.

  4. #4
    Super Contributor
    Join Date
    Nov 2003
    Location
    Bangalore , India
    Posts
    4,429

    Re: Problems with media player

    Give a try with MIDP: Mobile Media API Example - Media Sampler
    http://www.forum.nokia.com/info/sw.n..._v1_0.zip.html

    Regards
    Gopal

    __________________
    MobiQuil.com
    An initiative by Developers for Developers.
    http://www.mobiquil.com - Alpha - Launched.

  5. #5
    Registered User
    Join Date
    Feb 2007
    Posts
    25

    Re: Problems with media player

    hey balagopalks.

    am using that to make this program but for some reason mine wont work. have trid varying it in many ways. just not sure what i am doin wrong

  6. #6
    Registered User
    Join Date
    Feb 2007
    Posts
    25

    Re: Problems with media player

    i figured out the problem.

    it was an error with som eof the naming.

    thank you all for your help

Similar Threads

  1. Create 3GP player with J2ME for Mobile
    By dexxa05 in forum Mobile Java Media (Graphics & Sounds)
    Replies: 57
    Last Post: 2012-01-10, 11:44
  2. Nokia 3250 Media Player Problems
    By smash555 in forum General Development Questions
    Replies: 2
    Last Post: 2007-02-26, 12:03
  3. Nokia E60 - Media player problems...
    By Guntis in forum Audio
    Replies: 0
    Last Post: 2007-02-05, 23:50
  4. SIP content type
    By hlothman in forum Symbian Networking & Messaging (Closed)
    Replies: 8
    Last Post: 2006-05-17, 09:26

Posting Permissions

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