![]() ![]() Furthermore it handles the different platforms for you. Please Note: I have replaced the manual concatenation of the path and the file with the call to Path.Combine, which handles cases in which the path already comes with the path separator. Var mediaHelper = DependencyService.Get() Var fullFileName = Path.Combine(saveDir, vid.FullName) įile.WriteAllBytes(fullFileName, vid.GetBytes()) Using (var engine = new MediaToolkit.Engine())Ĭonsequently your client code would be void DownloadAudio(string videoUrl, string saveDir) String originalFile = saveDir + vid.FullName ![]() static void DownloadAudio(string videoUrl, string saveDir)įile.WriteAllBytes(saveDir + vid.FullName, vid.GetBytes()) I can download the video using 'VideoLibrary' and convert it to an mp3 using 'MediaToolkit' in a C# Console Application without any errors. I am trying to create an app that allows a user to download the audio of youtube videos in Xamarin.Forms.
0 Comments
Leave a Reply. |