

We have above the “ Play” method this method lets us play a media item passed to the media player. The most basic functionality a media-playing app should have is to play/pause media. In the code behind our main page, I put the event handler methods for each of these actions performed on the UI. We will go through each of these functionalities one by one. The buttons will serve for (Play, Pause, Forward…) the sliders will be for volume and seek. For this, I added a set of buttons, sliders on our main page. The next thing is to let our users control the media just like any awesome media-playing app we know. Now we know that playing media with VLC Media Player in Xamarin Forms is easy. When playing multiple media items with VLC, it is better to use one libvlc instance only and multiple media players.After streaming your media, you should consider handling the disposal of the libvlcsharp objects (libvlc, media player, media).Important things to consider when using VLC Media PlayerĪfter using VLC library, and talking with the guys maintaining this awesome library I learned from them some important things to take into consideration when using VLC media player. This plays media in your app, even when the app is in the background. NOTE: If you want to play music, you need only to create the media player as we did above, and call its “Play” method. First, on my main page, in XAML, I added the video view. In this demo, we will play video, and this is done just as you would do if you want to play audio. Every Project (Platforms + shared project):.You first have to add appropriate nuget packages into your projects. It is very easy to get started with VLC media player. Here is the source code for this demo Adding VLC Media Player in Xamarin Forms Projects Streaming media from sources that require authentication.Controlling media with VLC media player.Important things to consider when using VLC Media Player.Adding VLC Media Player to your Xamarin Forms project.The answer is simple, the native media players on each of these platforms are not powerful enough to handle certain scenarios like HLs streaming, Some file formats, and protocols… The VLC media player can be a great solution to implement these features in your app. You might ask yourself why do we need another media player, when Android and iOS have their native media players. Why Use VLC Media Player in Xamarin Forms
