Ich versuche Live-Video von einer IP-Kamera auf meinem BlackBerry-Gerät zu spielen. Ich erhalte eine nicht unterstützte Ausnahme beim Versuch, das Video abzuspielen."Nicht unterstützter Typ" bei der Wiedergabe von Live-Video-Stream auf BlackBerry
package com.bb.play;
import javax.microedition.media.Player;
import javax.microedition.media.Manager;
import javax.microedition.media.control.VideoControl;
import net.rim.device.api.ui.container.MainScreen;
import net.rim.device.api.ui.Field;
import net.rim.device.api.ui.component.LabelField;
import net.rim.device.api.ui.UiApplication;
import net.rim.device.api.system.Characters;
/**
*
*/
public final class PlayVideo extends UiApplication
{
private Player player;
private VideoControl videoControl;
public static void main(String[] args)
{
PlayVideo theApp = new PlayVideo();
theApp.enterEventDispatcher();
}
public PlayVideo()
{
MainScreen ms = new MainScreen(){
public boolean onClose()
{
//Clean up the player resources.
player.close();
videoControl.setVisible(false);
close();
return true;
}
//Override keyChar to capture key commands used to control video playback.
protected boolean keyChar(char c, int status, int time)
{
boolean retVal = false;
if (c == Characters.SPACE)
{
if (player.getState() == Player.STARTED)
{
//Stop playback.
try
{
player.stop();
}
catch (Exception ex)
{
System.out.println("Exception: " + ex.toString());
}
}
else
{
//Start playback.
try
{
player.start();
}
catch (Exception ex)
{
System.out.println("Exception: " + ex.toString());
}
}
retVal = true;
}
return retVal;
}
};
ms.setTitle(new LabelField("Let's play some video..."));
LabelField lf = new LabelField("Press space to start/stop/resume playback.");
ms.add(lf);
pushScreen(ms);
try
{
//Create a new Player pointing to the video file.
//This can use any valid URL.
player = Manager.createPlayer("http://camera1.mairie-brest.fr/axis-cgi/mjpg/video.cgi");
player.realize();
//Create a new VideoControl.
videoControl = (VideoControl)player.getControl("VideoControl");
//Initialize the video mode using a Field.
videoControl.initDisplayMode(VideoControl.USE_GUI_PRIMITIVE, "net.rim.device.api.ui.Field");
//Set the video control to be visible.
videoControl.setVisible(true);
}
catch (Exception ex)
{
System.out.println(ex.toString());
}
}
}
Können Sie mindestens korrektes Englisch schreiben, verwenden Sie die Code-Tags und stellen die vollständige Fehlermeldung und wo sie auftritt. –
Wenn Personen wie Sie, die Antwort nicht wissen, dann machen sie lahme Ausreden wie diese .. Thnx – Shah