Namespaces
Variants
Actions

Video streaming using Java ME not displayed correctly after orientation switch on Symbian (Known Issue)

Jump to: navigation, search
Article Metadata

Tested with
Devices(s): Nokia N96, Nokia 5800 XpressMusic

Compatibility
Platform(s): S60 3rd Edition FP2, S60 5th Edition

Article
Keywords: Manager.createPlayer("rtsp://<streaming some media file>");
Created: User:Technical writer 1 (12 May 2009)
Last edited: hamishwillee (01 Aug 2012)

Description

Streaming video is not correctly displayed in full-screen mode after orientation switch. In some devices, only part of the video will be shown on the screen display, whereas in some devices no video will be displayed at all.

How to reproduce

1. Implement a test MIDlet using the following source code:

 import java.io.InputStream;
import javax.microedition.lcdui.*;
import javax.microedition.midlet.*;
import javax.microedition.media.*;
import javax.microedition.media.control.VideoControl;
 
public class RTSPFullScreen extends MIDlet implements CommandListener, PlayerListener
{
private Display d;
private Player p;
private Canvas c;
 
private Command exitCommand = new Command("Exit", Command.EXIT, 1);
VideoControl vc;
 
public RTSPFullScreen()
{
 
d = Display.getDisplay(this);
 
 
}
 
public void startApp()
{
c = new Canvas()
{
protected void paint(Graphics g)
{
 
g.setColor(0,0,0);
g.fillRect(0,0,getWidth(),getHeight());
 
 
}
};
 
c.setFullScreenMode( true );
c.addCommand( exitCommand );
c.setCommandListener( this );
d.setCurrent( c );
 
try
{
 
 
p = Manager.createPlayer("rtsp://<streaming some media file>");
p.addPlayerListener( this );
p.prefetch();
 
vc = ( VideoControl )p.getControl( "javax.microedition.media.control.VideoControl" );
vc.initDisplayMode( VideoControl.USE_DIRECT_VIDEO, c );
 
 
p.start();
}
catch( Exception e )
{
showAlert( "startApp: " + e.toString() );
}
}
 
public void commandAction( Command c, Displayable s )
{
if (c == exitCommand)
{
destroyApp(false);
notifyDestroyed();
}
}
 
public void pauseApp()
{
}
 
public void destroyApp( boolean uc )
{
if( p != null )
{
p.close();
}
}
 
public void playerUpdate(Player player, java.lang.String event, java.lang.Object eventData)
{
if( event == "started" && player.getState() == Player.STARTED )
{
 
try
{
 
vc.setDisplayFullScreen(true);
vc.setVisible( true );
}
catch( Exception e )
{
showAlert( "playerUpdate: " + e.toString() );
}
}
 
}
 
public void showAlert( String aAlertText )
{
Alert alert = new Alert( "Alert", aAlertText, null, AlertType.ERROR );
alert.setTimeout( 10000 );
d.setCurrent( alert );
}
 
}

2. Launch the MIDlet with the device in portrait orientation.

3. After streaming has started, switch the orientation to landscape.

For the affected devices, either only part of the video will be shown on the screen display or no video will be displayed at all.


Solution

This issue is expected to be fixed in future software versions starting from S60 3rd Edition, Feature Pack 2 and S60 5th Edition.

This page was last modified on 1 August 2012, at 07:41.
119 page views in the last 30 days.
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