hudec117/Mpv.NET-lib-

PlaylistMove function doesn't work

Closed this issue · 1 comments

I've using latest version of Mpv.NET and .Net 4.7.2
I've following code:

player = new MpvPlayer(this.Handle)
                    {
                        Loop = true,
                        Volume = (int)key.GetValue("PlayerValume")
                    };
                   
                    string DemoVideo = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, @"Videos\demo_video.mp4");

                    player.LoadPlaylist(new List<string>() { (string)key.GetValue("MediaFolder"), DemoVideo}, true);
                    player.Resume();
                    PlayerTimer = new Timer();
                    PlayerTimer.Tick += new EventHandler(PlayerTimer_Tick);
                    PlayerTimer.Interval = 5000; // in miliseconds
                    PlayerTimer.Start();

//After onClick button:
player.PlaylistMove(0 player.PlaylistIndex);

But the video isn’t moving anywhere.
It had to go back to the first video on the playlist.
I need back to first video on the playlist. How can i do it?
Thanks!

If I understand correctly, you are trying to go back to the first entry in the playlist?

The player has the PlaylistIndex property but it does not have a setter, I will add one in version 2.

In the meantime, you can achieve this yourself by doing:
player.API.SetPropertyLong("playlist-pos", 0);