Quantcast
Channel: Recent Threads — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 204402

How Can I Open A Media File On The Default Media Player?

$
0
0

Hello:

I'm trying to open a media file (MP3, MP4) from my app, but i want it to open on the default media player, i found some ways using intents on java, and works on eclipse, but i can't find how to do it on Xamarin.

I Have the next code that works on Java:

Intent intent = new Intent(MediaStore.INTENT_ACTION_MUSIC_PLAYER);
File file = new File(songPath.toString());
intent.setDataAndType(Uri.fromFile(file), "audio/*");
startActivity(intent);

I Get this code from here: http://stackoverflow.com/questions/10867957/android-playing-a-song-file-using-default-music-player

I can't find the MediaStore in Xamarin, neither the INTENT_ACTION_MUSIC_PLAYER nor FILE.

I know it's easy to do it but i'm really stuck on this, please help me.

Thanks for all;


Viewing all articles
Browse latest Browse all 204402

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>