Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

when play video in full screen mode , it's don't appear in some computers !! .. #3

Closed
Jason4Ever opened this issue Feb 1, 2012 · 1 comment
Labels

Comments

@Jason4Ever
Copy link

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:

Note : i use playVideo() method in this Class to play Videos

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 !..

@caprica
Copy link
Owner

caprica commented Feb 1, 2012

So it seems you have an environment-specific issue, like a JDK incompatibility or an OS incompatibility.

There's nothing you can do in the Java layer (i.e. vlcj) to resolve this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants