×

Discussion Board

Results 1 to 15 of 15
  1. #1
    Registered User
    Join Date
    Oct 2008
    Posts
    13

    Cannot create player for playing videos on n70 and 3110c phone

    Hi,

    I am trying to make an application that plays video from a ByteArrayInputStream. The code is working fine on N73 phone, but for the N70 phone or the series 40 Nokia 3110c phone, the code does not work. The application gets stuck at the line in bold:

    input = new ByteArrayInputStream(Send_Msg_Buffer, 0, Send_Msg_Length);

    myPlayer = Manager.createPlayer(input, "encoding=video/3gpp");

    Anyone know the solution to this problem? Btw the phones do play the video from the phone's hard drive.

    Thanks,

    Umair

  2. #2
    Registered User
    Join Date
    Oct 2008
    Posts
    13

    Re: Cannot create player for playing videos on n70 and 3110c phone

    Okay, I found this table. According to it, N70 does not support any codec for video playback. This is the reason why the player is not initialising in Java

    http://www.forum.nokia.com/main/reso...vid_table.html

    If someone has any other explanation or solution, do let me know.

    Thanks!

    Umair

  3. #3
    Nokia Developer Champion
    Join Date
    Apr 2003
    Location
    USA, CA
    Posts
    7,192

    Re: Cannot create player for playing videos on n70 and 3110c phone

    N70 supports video playback, see here for detailed information about multimedia support in Java
    http://www.forum.nokia.com/info/sw.n..._0_en.xls.html

    Are you trying to write in to the stream more data during playback (create the video stream on the fly)? If yes, I think the problem lies there.

    Hartti

  4. #4
    Registered User
    Join Date
    Oct 2008
    Posts
    13

    Re: Cannot create player for playing videos on n70 and 3110c phone

    Quote Originally Posted by hartti View Post
    N70 supports video playback, see here for detailed information about multimedia support in Java
    http://www.forum.nokia.com/info/sw.n..._0_en.xls.html

    Are you trying to write in to the stream more data during playback (create the video stream on the fly)? If yes, I think the problem lies there.

    Hartti
    Yes, I am creating the video on the fly. But this seems to work in N73 which is Series 60 3rd edition phone. It also works on Nokia E61i. So how should I be doing it for the series 60 2nd edition phone?

    According to this code, I use the part of the stream in the variable, 'input' and then use it to create the player. This is working for other phones but not on the series 40 5th edition and the n70 phone.

    Any help in this regard?

  5. #5
    Nokia Developer Champion
    Join Date
    Sep 2008
    Location
    Noida, U.P.
    Posts
    1,330

    Re: Cannot create player for playing videos on n70 and 3110c phone

    Hi umairazfar,

    pls try myPlayer = Manager.createPlayer(input, "encoding=video/mpeg");

    May be this will help u. As im trying for ur problem. As i got the appropriate solution i will reply u.

    thanx

    Jitendra Agarwal.

  6. #6
    Registered User
    Join Date
    Oct 2008
    Posts
    13

    Re: Cannot create player for playing videos on n70 and 3110c phone

    Quote Originally Posted by jitu_goldie View Post
    Hi umairazfar,

    pls try myPlayer = Manager.createPlayer(input, "encoding=video/mpeg");

    May be this will help u. As im trying for ur problem. As i got the appropriate solution i will reply u.

    thanx

    Jitendra Agarwal.
    Thanks Jitendra! I have however tried that encoding but to no avail. I am currently trying to write the file in the record store and then play it from the record store. Maybe that might help, but it is not the best of solutions.

    btw, I was able to play a 3gp video from the harddisk of Nokia 3110c. So I am hoping that the RMS approach might work there as well.

  7. #7
    Registered User
    Join Date
    Oct 2008
    Posts
    13

    Thumbs up Re: Cannot create player for playing videos on n70 and 3110c phone

    Ok, I found the solution somewhat.

    My mistake:
    The streaming video was mp4 while I was trying to decode it using 3gp. changing encoding to mpeg did not solve the problem.

    My solution:
    I took the InputStream and wrote it into a file using an OutputStream. When I used PrintStream, it added too much garbage to the video. The file was then playable in the mobile's native player, but not through the Java player.

    I then wrote the file byte by byte using this code:

    FileConnection filecon = (FileConnection)Connector.open("file:///C:/Nokia/Videos/temp.mp4", Connector.READ_WRITE );
    if(!filecon.exists())
    {
    filecon.create();
    }

    OutputStream os = filecon.openOutputStream();

    for (i=0; i<Play_Msg_Length; i++)
    {
    os.write(is.read()); //Where is is the input stream
    }

    is.close();
    is= null;
    os.close();
    os= null;
    filecon.close();


    now once I had written the file on the hard disk, I played from the hard disk.

    myPlayer = Manager.createPlayer("file:///C:/Nokia/Videos/temp.mp4");

    That did the trick and the video was finally played in both N70 and Nokia 3110c (use "file:///C:/predefgallery/predefvideos/" for 3110c hard disk).

    This sort of gets my software working, but the main problem stays there. I cannot play videos directly from an InputStream on either N70 or 3110c.

    I hope this helps anyone who had a similar problem.

  8. #8
    Regular Contributor
    Join Date
    Jul 2008
    Location
    Faridabad(Delhi NCR)
    Posts
    343

    Re: Cannot create player for playing videos on n70 and 3110c phone

    If I m not wrong u cant play directly Mp4 file on Phone. I have tested this before its require special plug in .Firstly check whether mp4 is playing on ur mobile . I m sure it wil not play thats why some player is created for playing mp4 file and i think they r using sum plug in for it .May Be i will be wrong but i did too R&D on it
    Anshu Chauhan
    J2me Developer

  9. #9
    Registered User
    Join Date
    Oct 2008
    Posts
    13

    Re: Cannot create player for playing videos on n70 and 3110c phone

    Quote Originally Posted by ansh.chauhan View Post
    If I m not wrong u cant play directly Mp4 file on Phone. I have tested this before its require special plug in .Firstly check whether mp4 is playing on ur mobile . I m sure it wil not play thats why some player is created for playing mp4 file and i think they r using sum plug in for it .May Be i will be wrong but i did too R&D on it
    yes, I did check whether it was playing mp4 file from hard disk, which it does, using j2me and that is what I resorted to in the end. So what you need to do is:

    create a file from the inputstream and save the file on t your phone's hard disk. Then open the file from the hard disk to play it.

    I do not know of any plug ins but my firmware was the latest one. It looks like a limitation of the hardware rather than j2me itself.

  10. #10
    Regular Contributor
    Join Date
    Jul 2008
    Location
    Faridabad(Delhi NCR)
    Posts
    343

    Re: Cannot create player for playing videos on n70 and 3110c phone

    Yes ur write. but still i m not able know.There are so many mp4 player for mobile how they can play...may they wil use sum codec and covert mp4 to another format...did u try to play it via setPlateform request may be it work for u
    Anshu Chauhan
    J2me Developer

  11. #11
    Registered User
    Join Date
    Oct 2008
    Posts
    13

    Re: Cannot create player for playing videos on n70 and 3110c phone

    Quote Originally Posted by ansh.chauhan View Post
    Yes ur write. but still i m not able know.There are so many mp4 player for mobile how they can play...may they wil use sum codec and covert mp4 to another format...did u try to play it via setPlateform request may be it work for u
    I do not know about the setPlatform request ... can you please write it down?

  12. #12
    Regular Contributor
    Join Date
    Jul 2008
    Location
    Faridabad(Delhi NCR)
    Posts
    343

    Re: Cannot create player for playing videos on n70 and 3110c phone

    midlet.platformRequest(URL);

    write Url of the video file and check whether is working or not
    Anshu Chauhan
    J2me Developer

  13. #13
    Registered User
    Join Date
    Oct 2008
    Posts
    13

    Thumbs up Re: Cannot create player for playing videos on n70 and 3110c phone

    Quote Originally Posted by ansh.chauhan View Post
    midlet.platformRequest(URL);

    write Url of the video file and check whether is working or not
    OK, I found the solution . If you create a player like this:

    myPlayer = Manager.createPlayer(input, "video/3gpp");

    it works fro both N70 and 3110c

    Now that is really annoying! Anyway, whoever has been having these problems should rest assured that this is how to fix it.

  14. #14
    Regular Contributor
    Join Date
    Jul 2008
    Location
    Faridabad(Delhi NCR)
    Posts
    343

    Re: Cannot create player for playing videos on n70 and 3110c phone

    dont u think its take to much time if u trying to play large file....
    Anshu Chauhan
    J2me Developer

  15. #15
    Registered User
    Join Date
    Oct 2008
    Posts
    13

    Re: Cannot create player for playing videos on n70 and 3110c phone

    for 3110c, yes, it does take a long time ... too long a time. I was testing with 300 kb file and it was quite slow.

    for n70, it was at a good speed. Anyway, the whole point was to make it work, which I did, hence, problem solved

    oh and thanks for all the replies

Posting Permissions

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