Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android MediaPlayer DataSource from my buffer/stream

I need to be able to initialize MediaPlayer with my memory buffer or stream. The solution provided here: how to play video from byte array in media player - to use MediaDataSource with setDataSource works for API level 23 (M) only. Is anybody has suggestion what to do with pre-API23 (L) ? Since there are setDataSource APis to use FileDescriptor/path/URL/URI I am thinking maybe there is a way to "convert" Stream to URI? Any thoughts?

like image 510
user3330596 Avatar asked Sep 20 '26 01:09

user3330596


1 Answers

One possible solution is to use same mechanism as here Don't wast your time for ContentProvider, Memoryfile etc.

like image 153
user3330596 Avatar answered Sep 22 '26 13:09

user3330596