1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
|
public void showVideo()
{
try
{
InputStream ins = getClass().getResourceAsStream("/video/video.mp4");
String ct = this.guessContentType("resource:/video/video.mp4");
player = Manager.createPlayer(ins, ct);
player.realize();
if ((vidc = (VideoControl) player.getControl("VideoControl")) != null)
{
vidc.initDisplayMode(VideoControl.USE_DIRECT_VIDEO, this.canvas);
vidc.setDisplayLocation(x+50, y+10+margeBug);
vidc.setDisplaySize(canvas.getWidth() - 100, canvas.getHeight() - 140);
vidc.setVisible(true);
}
Control [] controls = player.getControls();
player.start();
}
catch (IOException ioe)
{
System.out.println("=========> Erreur :"+ioe.toString());
} catch (MediaException me)
{
System.out.println("=========> Erreur2 :"+me.toString());
}
} |
Partager