Getting the set time or set position to work with LIBVLC
Posted: 15 Apr 2019 11:35
In Windows: I tried the RC interface and the keyboard shortcut keys work as expected, but I can't tie the video to a control on the screen so that is out. Then I tried HTTP and that also worked with the keyboard shortcuts, but again no anchor to any control on the screen.
With LibVLC I was able to get the player to work and tie it to a control on the screen. This keeps it from overlapping my program BUT I cannot get the keyboard shortcuts to work. And I think I just discovered why:
I need embedded windows so I have to do my own positioning. That is no problem except that the libvlc_media_player_set_time and libvlc_media_player_set_position don't seem to work for me. The playback either stops or starts from the beginning.
The code is in WinDev and looks like this:
In the latter case the return is 0 (success) and the time retrieved matches what I was trying to set it to, but the video did not go there. It either keeps playing or stops.
I don't know if it has anything to do with this but the result from libvlc_media_player_is_playing is 0 and libvlc_media_player_is_seekable is 1.
Thank you.
With LibVLC I was able to get the player to work and tie it to a control on the screen. This keeps it from overlapping my program BUT I cannot get the keyboard shortcuts to work. And I think I just discovered why:
Code: Select all
--keyboard-events, --no-keyboard-events
Key press events
(default enabled)
This enables VLC hotkeys from the (non-embedded) video window.
The code is in WinDev and looks like this:
Code: Select all
PROCEDURE PositionSet(rPos is real,bFast is boolean)
API(:sDLL,"libvlc_media_player_set_position",:mp,rPos,bFast)
Code: Select all
PROCEDURE TimeSet(nMSeconds is 8-byte int, bFast is boolean)
nRes is int = API(:sDLL,"libvlc_media_player_set_time",:mp,nMSeconds,bFast)
I don't know if it has anything to do with this but the result from libvlc_media_player_is_playing is 0 and libvlc_media_player_is_seekable is 1.
Thank you.