![]() As in for any internet audio source, it would not be able to load the meta data of it. On UWP Windows runtime, it wasn’t loading Audio meta data for sources which are stored online. Oh also on Windows 10 lock screen at the bottom right corner… □Įven though I managed to build this cool little demo, with the help of MediaManager Plugin, I did notice some issues with it. The same page will have the functionality to load local MP3 files and add to the Queue on the go… Then another page which will display the current audio Queue loaded into the Player. The first page, which is the Home page, will host the main Audio Play feature, such as Play/Pause, Next, Previous and so on. So I built a simple demo audio player which will be playing MP3 audio sources stored online, and as an extra functionality, it will allow us to play locally stored MP3 files as well. Well that’s all the tidbits I got to share regarding the little demo I built! Demo time! Once we store the file safely in App Cache directory, we load it into our app, using the Extractor to create the IMediaItem object and pass it on to the MediaManager’s queue. It is better to load the file into memory from the cache directory hence some platforms could flag directly accessing files outside the app directories as a suspicious activity and eventually break the flow of the app. I’m writing that file object to the app cache directory with the help of helpers. Once the user picks the file, we get the FileData object. Extractor.CreateMediaItem(cachedFilePathName) Ĭ(generatedMediaItem) Var cachedFilePathName = Path.Combine(FileSystem.CacheDirectory, pickedFile.FileName) įile.WriteAllBytes(cachedFilePathName, pickedFile.DataArray) Let me share a little sneak peek into the cute little demo I built… So I thought of sharing my experience on setting up the MediaManager Plugin for Xamarin.Forms, step by step from scratch! □ Sneak Peek! It turns out all the articles and documented setup guidelines are mostly outdated, and the Plugin has gone through so much new changes and improvements over the years. So I had to scrape through old forums and sample projects off of Github, for a series of trial and error, figuring out the proper set up. ![]() So I tried it out following the Github page and the Xamarin blog article.īut unfortunately I came across a lot of issues, trying to set up in a fresh Xamarin.Forms project itself, even though I followed the steps to the detail. The first thing came to my mind was the MediaManager plugin. The core feature of that app was to play audio sources that are stored online, with continuous app background playback enabled, similar to a music player or podcast player. I was lucky enough to stumble upon the opportunity to explore the implementation of Audio playback in one of the Xamarin.Forms project I’m working on recently. ![]() Please feel free to take a look at their official github page, and the implementation code if you’re interested in digging down deep. Long time back I remember reading up the article in Xamarin Blog, Play Audio and Video with the MediaManager Plugin for Xamarin, īack then, I remember there were no direct support for Xamarin.Forms itself, but now we do, with simple plug and play capabilities in this MediaManager Plugin! So playing audio in a music player style sounds like a complete nightmare for a cross-platform framework like Xamarin.Forms, but thanks to this incredible MediaManager plugin, just a breeze of work to deploy across Android, iOS and Windows UWP environments. So you wanna play Audio in your Xamarin.Forms app? Stream an audio file over the internet or stored locally in your device Gallery? Listening to songs or podcasts even when the app is in background mode or device is locked away? Then you’re in the right place! □ Let me show you how to play Audio in Xamarin.Forms across Android, iOS and Windows UWP using the super easy plug and play MediaManager Plugin. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |