Baseflow / XamarinMediaManager

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

Playing media directly from a Stream object #834

Closed Haarmees closed 2 years ago

Haarmees commented 2 years ago

🚀 Feature Requests

It would be nice to play media from a Stream object directly, without creating a file on the device.

Contextualize the feature

For security reasons it can sometimes be undesirable to have (privacy-sensitive) media saved/written on a device.

Describe the feature

I made a draft how this feature could look in #833. A function is added to the MediaManager with the following signature: Task<IMediaItem> Play(Stream stream, MimeType mimeType);

Which is then used as follows: await MediaManager.Play(stream, MimeType.AudioWav);

I have tested the current code from #833 on Android, iOS and UWP. I added two samples to the sample apps. I tried to reuse the existing structure of the library. I still have to add documentation. I hope this feature can be added to the library so I can use it in our medical app. Let me know what you think!

Platforms affected (mark all that apply)