Skip to Main Content

Java SE (Java Platform, Standard Edition)

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Play a video and display an image simultaneously

1035621Aug 26 2013 — edited Aug 27 2013

Hello everyone,

I am new to JavaFX and I would like to know if it is possible to simultaneously play a video and display an image above it in the same scene.

Particularly, I want the image to be displayed in a fixed position.

I have tried using a StackPane layout but I get an error in the following line:

sp.getChildren().add(mediaPlayer);

because the mediaPlayer object cannot be taken as a parameter and a Node object is needed

I have also tried adding both the video and the image in the same scene as seen below with no success (the video is being played but the image is not displayed)

root.getChildren().add(imageView);

Is what I'm trying to do feasible? And if yes, what methods should I use?

Thank you in advance for any answer!

This post has been answered by James_D on Aug 26 2013
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Sep 24 2013
Added on Aug 26 2013
2 comments
541 views