Coder Social home page Coder Social logo

No video displayed (screen black) about vlcj HOT 5 CLOSED

caprica avatar caprica commented on September 26, 2024
No video displayed (screen black)

from vlcj.

Comments (5)

caprica avatar caprica commented on September 26, 2024

You know that when allocating objects on the heap they go out of scope and become eligible for garbage collection when the method they're declared in ends?

private Player(String[] args) {
        ...
        EmbeddedMediaPlayer mediaPlayer = mediaPlayerFactory.newEmbeddedMediaPlayer(); // <--- heap variable
        ...
} // <--- goes out of scope

You need to make sure your object doesn't go out of scope - usually this just means declaring it as a field in your class.

You should probably start with the vlcj sample BasicEmbeddedMediaPlayerComponentTest and compare it to your own code.

from vlcj.

caprica avatar caprica commented on September 26, 2024

I think this is something that changed in vlc 2.0.0, you have to use a file URL, not a path.

You do this:

mediaPlayer.playMedia("C:/Default/Player/big_buck_bunny_480p_surround-fix.avi")

You need to do something like this instead:

mediaPlayer.playMedia("file://C:/Default/Player/big_buck_bunny_480p_surround-fix.avi")

from vlcj.

ugomeda avatar ugomeda commented on September 26, 2024

Sorry for the delay of the response.

You made my day, the problem was effectively comming from the malformed url. I changed it to this and now it works :

mediaPlayer.playMedia("C:\\Default\\Player\\big_buck_bunny_480p_surround-fix.avi");

Thanks a LOT !

from vlcj.

caprica avatar caprica commented on September 26, 2024

Because of this issue, I changed the playMedia and prepareMedia methods to return a boolean indicator to show whether or not the native media item was successfully created. That would at least tell you that the MRL you passed in was or was not valid.

from vlcj.

caprica avatar caprica commented on September 26, 2024

With vlcj 2.2.0 you should no longer need to use the URL-based syntax.

from vlcj.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.