×

Discussion Board

Results 1 to 5 of 5
  1. #1
    Registered User
    Join Date
    Oct 2006
    Posts
    12

    Nokia 6234 (Series 40, 320x240) full screen video playback, seeking

    Hi all,

    I'm dabbling in J2ME in order to learn a bit about the platform and, at the same time, scratch an itch.

    I'd like to write a MIDlet that plays back MPEG4 video at full screen and allows seeking. I'm not sure this is even possible, so I'd settle for playing back videos in sequence without gaps (these two would be an improvement on the 6234's built-in video player).

    I have written a small MIDlet that already does some things:

    Code:
    package net.sf.meplayer;
    
    import javax.microedition.lcdui.Alert;
    import javax.microedition.lcdui.AlertType;
    import javax.microedition.lcdui.Canvas;
    import javax.microedition.lcdui.Display;
    import javax.microedition.lcdui.Graphics;
    import javax.microedition.media.Manager;
    import javax.microedition.media.Player;
    import javax.microedition.media.control.VideoControl;
    import javax.microedition.midlet.MIDlet;
    import javax.microedition.midlet.MIDletStateChangeException;
    
    
    
    public class MEPlayer extends MIDlet {
    
    	protected void destroyApp(boolean arg0) throws MIDletStateChangeException {
    		//
      }
    
    	protected void pauseApp() {
    		//
      }
    
    	protected void startApp() throws MIDletStateChangeException {
    		try {
    		  Player player = Manager.createPlayer("file:///E:/a.mp4");
    		  
    		  player.realize();
    		  
    			VideoControl videoControl = (VideoControl) player.getControl("VideoControl");
    			
    			VideoCanvas canvas = new VideoCanvas();
    			videoControl.initDisplayMode(VideoControl.USE_DIRECT_VIDEO, canvas);
    			
    			videoControl.setDisplayFullScreen(true);
    			videoControl.setVisible(true);
    			videoControl.setDisplayLocation(0, 0);
    			videoControl.setDisplaySize(canvas.getWidth(), canvas.getHeight());
    			
    			canvas.setFullScreenMode(true);
    			Display.getDisplay(this).setCurrent(canvas);
    			
    			player.start();
    			
    	    Thread.sleep(50000);
    
    			
    		}
    		catch(Exception e) {
    			Display.getDisplay(this).setCurrent(new Alert("error", e.toString(), null, AlertType.ERROR ));
    		}
    	}
    	
    
    }
    
    class VideoCanvas extends Canvas {
    	protected void paint(Graphics g) {
        g.setColor(0x00FFFF00); // yellow
        g.fillRect(0, 0, getWidth(), getHeight());
      }
    	
    	public int getWidth() {
    	  return super.getWidth();
    	}
    	
    	public int getHeight() {
    	  return super.getHeight();
    	}
    
    }
    This doesn't work completely yet, but if you try to playback an MPEG4 video (named a.mp4 in the root directory of the Micro SD card), you'll get the sound and if you hit the quit button, you'll see that the video is being played back, but it's not updated as it plays. It's also playing fullscreen, but at about 240x240 of the 240x320 display.

    I'm looking for ways to:

    * Have the video update
    * Rotate the video so that it goes 240x320 like the bundled video player

    After that I'll investigate seeking (I'm not sure if this will be possible) and add an interface to be able to choose videos.

    I'd appreciate any input on any of the above.

    Kind regards,

    Alex

    (p.d. if anyone points me towards an existing application or way of achieving this, I will also be very grateful (although my self-learning inertia might go away))

  2. #2
    Registered User
    Join Date
    Oct 2006
    Posts
    12

    Re: Nokia 6234 (Series 40, 320x240) full screen video playback, seeking

    A progress update...

    I have managed to play video fullscreen, smoothly, with audio.

    Caveat: I have to rotate the file on the PC, so it's 240x320.

    But now I believe Player.setMediaTime() is not working for my mpeg4 video.

    Is there any way to override this? I'll probably make several small mp4 files to simulate seeking, but I'd like to make "sane videos" (i.e. not rotated, full-length).

    Ideas, thoughts?

    Alex

  3. #3
    Registered User
    Join Date
    May 2007
    Posts
    5

    Re: Nokia 6234 (Series 40, 320x240) full screen video playback, seeking

    Quote Originally Posted by koala
    A progress update...

    I have managed to play video fullscreen, smoothly, with audio.

    Caveat: I have to rotate the file on the PC, so it's 240x320.

    But now I believe Player.setMediaTime() is not working for my mpeg4 video.

    Is there any way to override this? I'll probably make several small mp4 files to simulate seeking, but I'd like to make "sane videos" (i.e. not rotated, full-length).

    Ideas, thoughts?

    Alex
    How do you manage to actually play the video? In mine it simply opened an yellow window with part of it black, and the sound playing in the background.

    Please, keep me updated. I'll see if I can help you in this journey.

    Thanks

  4. #4
    Registered User
    Join Date
    Oct 2006
    Posts
    12

    Re: Nokia 6234 (Series 40, 320x240) full screen video playback, seeking

    I managed to play some video and release a videoplayer that kinda seeks (you need to encode your videos in a special way to achieve it)...

    http://freshmeat.net/projects/nokia-vid-player/

  5. #5
    Registered User
    Join Date
    Aug 2009
    Posts
    1

    Re: Nokia 6234 (Series 40, 320x240) full screen video playback, seeking

    wow...have been searching for something like this for quite some time...thanks dude...by the what are the settings required for encoding? I'm using a nokia 6275 and will convert the video using super

Similar Threads

  1. Replies: 2
    Last Post: 2007-11-10, 13:19
  2. Screen Rotation on Nokia 7650's and 9200 series
    By davidmiron in forum Symbian User Interface
    Replies: 1
    Last Post: 2002-10-04, 12:00
  3. Http connection problem in 6310i
    By teahola in forum Mobile Java General
    Replies: 1
    Last Post: 2002-10-03, 18:46

Posting Permissions

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