Reg : JavaFX Mediaplayer time property listener issue

341 views
Skip to first unread message

krishna bhaskara rao

unread,
Aug 14, 2014, 1:33:38 AM8/14/14
to control...@googlegroups.com
Hi,

I am trying to play MP4 video using JavaFX Media player on Mac OS 10.9.1. While playing video i am trying to update time slider value by setting change listener to mediaplayer.currentTimeproperty(). Video is playing but time slider value not getting updated. Means listener not getting called while playing the video.
Below is the code snippet.

mediaPlayer.currentTimeProperty().addListener(new ChangeListener<Duration>() {

            @Override

            public void Changed(ObservableValue<? extends Duration> observable, Duration oldValue, Duration newValue) {

                 updateSliderValue();

            }

       });


Note : I have tried with invalidation listener also.


Can you please any one help me on this.


With Regards,

Krishna Bhaskar.

samir.ha...@gmail.com

unread,
Aug 14, 2014, 4:15:05 AM8/14/14
to control...@googlegroups.com
Hi,

I suggest you take a look at the official example of media player here : http://docs.oracle.com/javafx/2/media/playercontrol.htm#CMHEJIBA

I tested to attach a listener on a media player and it's working fine on my side. So it have to be something on your code that you're doing wrong. Anyway, this forum is specialized for ControlsFX components and we won't be able to help you very much on others controls like the media player.

Best regards,
Reply all
Reply to author
Forward
0 new messages