1

I'm using libvlc with Qt and I noticed that when the media player reaches the end of the video it doesn't respond anymore to window resizing or "play" to restart the video, it just stop working and that is it.

This is what happens if I try to resize when the media player reaches the end:

Behavior while playing: normal

Behavior after end reaches:

bug

It doesn't happen in the regular Vlc only on the library. Is there any configuration I'm missing or they do something in that situation that I'm not aware of?

vajehu
  • 181
  • 1
  • 2
  • 10
  • Please provide the version of libvlc you are using. Does this issue also happen with the latest nightly builds? – cube45 Nov 18 '17 at 00:33
  • I'm using vlc-2.2.6. I tried to put a `libvlc_media_player_stop` on the `libvlc_MediaPlayerEndReached` but it doesn't work, it just freezes the application. – vajehu Nov 18 '17 at 00:44
  • You must provide a [Minimal, Complete, and Verifiable example](https://stackoverflow.com/help/mcve) – eyllanesc Nov 18 '17 at 01:24
  • @eyllanesc You can have the implementation here https://github.com/vlc-qt/vlc-qt – vajehu Nov 18 '17 at 12:31
  • I was thinking about removing the media from the mediaplayer when the end reaches but I don't know how to do that. – vajehu Nov 18 '17 at 12:31

1 Answers1

2

SOLVED: I watched the VLC behavior to see how it works when the video reaches the end and I noticed that it just get ride of the video just like it's pressing stop so I managed to call stop on the event libvlc_MediaPlayerEndReached. It wasn't working before to me because I was using lambdas as the callback for the connections I just replaced them with real methods and it worked just fine.

vajehu
  • 181
  • 1
  • 2
  • 10
  • I had troubles with calling `Stop()` at this point until I put it on a separate thread (like the docs warn about). There's a [related thread](https://stackoverflow.com/questions/56487740/how-to-achieve-looping-playback-with-libvlcsharp) that may be of interest. – J Trana Jul 16 '21 at 12:29