Baseflow / XamarinMediaManager

Cross platform Xamarin plugin to play and control Audio and Video
https://baseflow.com
MIT License
768 stars 305 forks source link

How can I start playing an audio file from a certain position? #851

Closed Hobbit7 closed 2 years ago

Hobbit7 commented 2 years ago

I don't want to play the first 10 seconds of my audio file. The audio file should immediately start playing after the first 10 seconds. I use the following code to play my audio file but I have not found a way to enter a TimeSpan so that the file starts playing after the first 10 seconds: if (Device.RuntimePlatform == Device.iOS) { CrossMediaManager.Current.PlayFromResource("Mysong.m4a"); } else { if (Device.RuntimePlatform == Device.Android) { CrossMediaManager.Current.Play("file:///android_asset/Mysong.m4a"); } }

How can I start playing an audio file from a certain position?