Comments (5)
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.
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.
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.
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.
With vlcj 2.2.0 you should no longer need to use the URL-based syntax.
from vlcj.
Related Issues (20)
- New native audio output mode HOT 1
- Add new native parse flag "no skip" with value 0x10 HOT 1
- macos: Native Discovery fails vlcj 5.0.0 and VLC 4 HOT 5
- VLC 4.0 internal api changes HOT 3
- Getting Null exception in overlayApi class, sometime when panel resize, or video finish HOT 3
- Remove native method libvlc_media_thumbnail_request_cancel HOT 1
- Can not show Embedded subtitle? HOT 1
- What causes main libvlc error: stale plugins cache: modified HOT 6
- Seeing a hard-crash when running under JDK-20 HOT 1
- Various native _retain() methods now return the retained instance HOT 3
- Issue: VlcJ 4 - EmbeddedMediaPlayerComponent black when moving between components HOT 4
- Native parsed flag changes HOT 1
- Native library changes
- what is a media-player-events thread?? HOT 8
- Is it possible to use vlcj in a sandboxed macOS app? HOT 4
- Pom is missing from 5.0.0-SNAPSHOT HOT 5
- When libvlc.so is a link to a shared library, file.exists() returns false and crashes the program HOT 1
- Apple M1 (darwin-aarch64/libvlc.dylib) not found HOT 9
- SeekableCallbackMedia stops reading buffer HOT 14
- How to release a list player instance. HOT 8
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from vlcj.