SuRGeoNix / Flyleaf

Media Player .NET Library for WinUI 3/ WPF/WinForms (based on FFmpeg/DirectX)
GNU Lesser General Public License v3.0
715 stars 101 forks source link

How can I play multiple video files (local mp4 files or uris) sequentially? #266

Closed robertorossinivigilate closed 1 year ago

robertorossinivigilate commented 1 year ago

Hello, I need to play a list of video files sequentially, but I don't understand how do it in the right way. May I use playlist? Thanks in advance.

SuRGeoNix commented 1 year ago

Hi @robertorossinivigilate, you can either create a playlist temp file (that flyleaflib supports) or having your own playlist at your app level. Currently, FlyleafLib does not support automatically to play the next file in playlist but you can easily implemented by listening to Player.PropertyChanged event and check the Player.Status property if equals to Status.Ended so you can start the next mp4 file. Let me know if you need more help.

robertorossinivigilate commented 1 year ago

Thank you for your answer. I suppose that best way to implement what I need is to create a playlist at app level. Where can I find some examples of playlist implementation at app level?

SuRGeoNix commented 1 year ago

@robertorossinivigilate there is no need for sample as this is pretty easy. Register to Player.PropertyChanged and check Status property that is Status.Ended then you do Player.OpenAsync your next file.

robertorossinivigilate commented 1 year ago

Maybe I was not clear: I need some examples to implement Playlist with many PlayListItems, because I want to use OpenAsync(PlaylistItem item) method. I found something in YoutubeDL and TorrentBitSwarm, but I need something more simple, just like a list of file uris whithin a playlist, in order to call Player.OpenAsync and pass the selected PlaylistItem. Should I implement this way, or better use a list of strings with file uris inside, and then call Player.OpenAsync(string url)?

SuRGeoNix commented 1 year ago

You don't need any advanced Playlists (like BitSwarm/YoutubeDL) so there is no need to create a custom Plugin for that. Just use list of strings.

robertorossinivigilate commented 1 year ago

Ok, thank you for your help.