caprica/vlcj — Issue #3: when play video in full screen mode , it's don't appear in some computers !! ..
Author: Jason4Ever
Created: 2012-02-01 15:12:47+00:00
State: open

Hello ,

i have problem in my application , and i tried many solutions but
it didn't solve any thing ! , so please i need your help :

when i play some video in fullscreen mode , it's play very good in
computers , but i tried it from computer run under win7 32bit , but
some problem occured , the problem is the video play but with video
sound only !! , and don't show the video screen !! .... but when i
reviewed the log error , i found this error :

=======================================================
[1ebf8410] direct3d vout display error: Could not create the D3D
device! (hr=0x88760868)
[1ebf8410] direct3d vout display error: Direct3D could not be opened
[1ebf8410] directx vout display error: cannot get primary surface
(error -2005532447)
[1ebf8410] directx vout display error: cannot initialize DirectX
DirectDraw
[1ebf8410] main vout display error: Failed to set on top
[1ebf8410] direct2d vout display error: Cannot resize render target
(width = 1970611201, height = 1108468800, hr = 0x8899001d)!
[1ebf8410] direct2d vout display error: Cannot resize render target
(width = 1970611201, height = 1108468800, hr = 0x8899001d)!
[1ebf8410] direct2d vout display error: Cannot resize render target
(width = 1970611201, height = 1108468800, hr = 0x8899001d)!
[1ebf8410] direct2d vout display error: Cannot resize render target
(width = 1970611201, height = 1108468800, hr = 0x8899001d)!
[1ebf8410] direct2d vout display error: Cannot resize render target
(width = 1970611201, height = 1108468800, hr = 0x8899001d)!

this is my Media Class which i use it to play any media Videos & Sounds:

============================================
package game.core;

import java.awt.Canvas;
import java.awt.Color;
import java.awt.GraphicsEnvironment;
import java.awt.GridLayout;
import java.net.URL;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.swing.JFrame;
import javax.swing.JPanel;
import uk.co.caprica.vlcj.player.MediaPlayerFactory;
import uk.co.caprica.vlcj.player.embedded.EmbeddedMediaPlayer;
import uk.co.caprica.vlcj.player.headless.HeadlessMediaPlayer;

public class Media extends JPanel implements Runnable{

private URL url;

Canvas c = new Canvas();
String[] libvlcArgs = {"--clock-jitter=0","--no-video-title-show","--no-xlib","--no-osd","--no-overlay"};
private MediaPlayerFactory mediaPlayerFactory = new MediaPlayerFactory(libvlcArgs);
public EmbeddedMediaPlayer mediaPlayer = mediaPlayerFactory.newEmbeddedMediaPlayer(null);
private String filename = null;
private Thread runner = null;

public Media(String file){
filename = file;
runner = new Thread(this);
}

// play once time
public void play(){
mediaPlayer.playMedia(filename);
}

// play once time
public synchronized void playVideo(JFrame frame,boolean fullscreen,Color co){

this.setLayout(new GridLayout());
this.setBackground(co);

if(frame.isVisible()){
this.add(c);
}

if(fullscreen){
mediaPlayer.setFullScreen(true);
GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice().setFullScreenWindow(frame);
}

frame.setContentPane(this);
frame.setVisible(true);

mediaPlayer.setVideoSurface(mediaPlayerFactory.newVideoSurface(c));
mediaPlayer.playMedia(filename);

}

public synchronized void stop(){
mediaPlayer.stop();
}

public synchronized void loop(int count){
mediaPlayer.setRepeat(true);
}

@Override
public void run() {
}

}

so i don't know what is the problem !! ....

finally please tell me final solve please because i tried many methods
after reading in this group posts , but it's didn't solved any
thing !!

Thank you !..