Discussion Board

Results 1 to 15 of 25

Hybrid View

  1. #1
    Regular Contributor hiteshrawat's Avatar
    Join Date
    Jun 2009
    Posts
    69
    Hi all,

    I'm trying to run the following code, however its gives me nothing. Other than the video, everything's running fine. Please check through the code if you find anything going wrong.


    else if (c == Demo)
    {

    form1.deleteAll();
    form1.setTitle("Demo Video");
    form1.removeCommand(Next1);
    form1.removeCommand(Exit);


    playFromResource();



    }


    public void playFromResource()

    {

    try

    {

    InputStream in = getClass().getResourceAsStream("/Video/Hitesh.mpeg");
    if (in != null)
    {
    mPlayer = Manager.createPlayer(in, "video/mpeg");
    }else
    {
    alert = new Alert("Alert", "No video", null, null);
    display.setCurrent(alert);
    return;

    }
    mPlayer.prefetch();

    mPlayer.realize();
    if((mVidc = (VideoControl)mPlayer.getControl("VideoControl"))!=null)

    {

    mVideoItem = (Item)mVidc.initDisplayMode(VideoControl.USE_GUI_PRIMITIVE, null);
    form1.append(mVideoItem);
    }

    mPlayer.prefetch();
    mPlayer.start();
    // form1.removeCommand(mPlayCommand);
    display.setCurrent(form1);


    }
    catch (Exception e)

    {e.printStackTrace();}

    }

    waiting for response.

  2. #2
    Regular Contributor ansh.chauhan's Avatar
    Join Date
    Jul 2008
    Location
    Faridabad(Delhi NCR)
    Posts
    343
    Are you getting any exception if yes then please let us know so that we can slove your problem
    Anshu Chauhan
    J2me Developer

  3. #3
    Regular Contributor hiteshrawat's Avatar
    Join Date
    Jun 2009
    Posts
    69
    Yes, when i tried running it with .3gp it gave me a media error but when i play with mpeg, it gives me that alert for input stream to be null.

    i checked the location of the file and matched it correctly on the code also checked the .jar file....the file structure is same there too......

  4. #4
    Regular Contributor ansh.chauhan's Avatar
    Join Date
    Jul 2008
    Location
    Faridabad(Delhi NCR)
    Posts
    343
    change Manager.createPlayer(in, "video/mpeg"); with
    Manager.createPlayer(is, "video/3gpp");

    becoz you are using 3gp file. I m sure it will work

    and for mpeg file i think your mobile will not support that
    Anshu Chauhan
    J2me Developer

  5. #5
    Regular Contributor hiteshrawat's Avatar
    Join Date
    Jun 2009
    Posts
    69
    it gives me an error below



    javax.microedition.media.MediaException: Cannot create a Player for: video/3gpp
    at javax.microedition.media.Manager.getPlayerFromType(Manager.java:818)
    at javax.microedition.media.Manager.createPlayer(Manager.java:868)
    at javax.microedition.media.Manager.createPlayer(Manager.java:745)
    at AirtelMainMidlet.playFromResource(AirtelMainMidlet.java:109)
    at AirtelMainMidlet.commandAction(AirtelMainMidlet.java:310)

  6. #6
    Regular Contributor ansh.chauhan's Avatar
    Join Date
    Jul 2008
    Location
    Faridabad(Delhi NCR)
    Posts
    343
    ON which handset you are trying to run your application can you please mention that. or you playing video file on emulator
    Anshu Chauhan
    J2me Developer

  7. #7
    Regular Contributor hiteshrawat's Avatar
    Join Date
    Jun 2009
    Posts
    69
    well i believe there is somethings wrong with the code.............cause i have tried running this code on most of the phones...............

    the error was on emulator.

    phones i have tried on - Nokia N70, Sony Erricson K750i, I-mate(which hangs god knows why) and HTC(don't know the model)

Similar Threads

  1. cant play large video
    By zhouliwx in forum Mobile Java General
    Replies: 3
    Last Post: 2010-07-12, 11:28
  2. Play video with a active call in progress
    By mawe in forum Symbian Media (Closed)
    Replies: 14
    Last Post: 2008-11-20, 14:23
  3. Unable To Play a Video File In symbian 9.1 device
    By mailkamlesh in forum Symbian Media (Closed)
    Replies: 3
    Last Post: 2006-08-14, 18:06
  4. Unable To Play a Video File In symbian 9.1 device
    By mailkamlesh in forum Symbian C++
    Replies: 0
    Last Post: 2006-08-14, 08:15
  5. Play video on Canvas with N 6600 doesnt work. Please help!!!
    By Robert111 in forum Mobile Java Media (Graphics & Sounds)
    Replies: 2
    Last Post: 2006-02-22, 08:45

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Nokia Developer aims to help you create apps and publish them so you can connect with users around the world.

京ICP备05048969号  © Copyright Nokia 2013 All rights reserved