Get current time of playbin

4 views
Skip to first unread message

Kenneth Haansen

unread,
Dec 4, 2023, 5:01:57 AM12/4/23
to gstreamer-java
Hi, 
I would like to use the arrow keys to skip 5 seconds forward and backward in my video which is played with playbin. Therefore I need to find out how far into the video I am so I can add or subtract 5 seconds and use seek simple to go to the right time. 
Hope you can help me!

Neil C Smith

unread,
Dec 4, 2023, 5:04:37 AM12/4/23
to gstream...@googlegroups.com
On Mon, 4 Dec 2023 at 10:01, Kenneth Haansen <kenneth...@gmail.com> wrote:
> I would like to use the arrow keys to skip 5 seconds forward and backward in my video which is played with playbin. Therefore I need to find out how far into the video I am so I can add or subtract 5 seconds and use seek simple to go to the right time.
> Hope you can help me!

Take a look at the Swing video player example, which links a slider to
show and control the video position using seek simple.

https://github.com/gstreamer-java/gst1-java-examples/blob/master/SwingPlayer/src/main/java/org/freedesktop/gstreamer/examples/SwingPlayer.java#L145

Best wishes,

Neil

--
Neil C Smith
Codelerity Ltd.
www.codelerity.com

Codelerity Ltd. is a company registered in England and Wales
Registered company number : 12063669
Registered office address : 3rd Floor Suite, 207 Regent Street,
London, W1B 3HH, England
Reply all
Reply to author
Forward
0 new messages