I need a media player

64 views
Skip to first unread message

BillyC

unread,
Jun 28, 2015, 11:24:56 AM6/28/15
to mitappinv...@googlegroups.com
I want to make a media player app which will open mp3 and wav files from your phones memory. There is the play button that is available on ai but it seems its only designed to upload Bieber or Gaga song. Does anybody know how to make your own media player?

SteveJG

unread,
Jun 28, 2015, 11:59:34 AM6/28/15
to mitappinv...@googlegroups.com
Do you know the folder your mp3 and wav files are located in and their file names?    If  you do,  the Player component can open these mp3 files stored locally
Set the Player source to the file on your phone using the full file path.     What the player can do is documented here:     http://ai2.appinventor.mit.edu/reference/components/media.html#Player  .

The Hello Purr tutorial shows how.


Regards,
Steve  

BillyC

unread,
Jun 28, 2015, 1:36:07 PM6/28/15
to mitappinv...@googlegroups.com
I found a musicplayer app, from the Gallery (sorry I forgot the name of the person who created it) and changed it a little bit and posted it back to the Gallery with the app name Music_xoxo

Can you please help me optimise it? what I want to do is open a new page when Search button pressed and go to Music on my Samsung phone. There are many selections displayed there. If its possible I want them to appear on the app. then I can chose a song (mp3 or wav) which will bring me back to the main page of the app. Then I can play that song. Is this possible? If it is, can you change the app and post it back to the Gallery?

P.S. The Music folder on Samsung phone might be another app. If it cannot be opened the way I described above, is it possible to go to the folder named My files and chose a song from there?

SteveJG

unread,
Jun 28, 2015, 1:49:55 PM6/28/15
to mitappinv...@googlegroups.com
App Inventor does not have a control that lists the files in a folder and that would let you select a mp3 file.  

To select a music file without that control, you could make a list of all the files you want to have in your app that are in your music folder.  Put the names of those music file in a List.  Also note the Path to the music folder.   Use a ListPicker control to select the music you want .   Use code something like       Path + musicfile.mp3   to start a particular music file.

An alternative way is to use the ActivityStarter to turn on the File Manager app that is probably already on your app and use that to select files (a bit awkward, but the technique works)..

You are going to have to experiment Billy.  Do you know how to use Lists and a ListPicker?

Regards,
Steve


BillyC

unread,
Jun 29, 2015, 6:35:31 AM6/29/15
to mitappinv...@googlegroups.com
ActivityStarter sounds like an interesting technique. I think it can probably be very usefull if it can search more than one app or folders installed on my phone, by interactively inputting the name of the app or the folder after the app loaded on my phone.

But I am guessing it is probably not that advanced. I have to tell you that I am really suprised that good people at MIT never thought of adding a file search tool for people to use in their apps.

Taifun

unread,
Jun 29, 2015, 10:02:06 AM6/29/15
to mitappinv...@googlegroups.com
these examples might help
Taifun

Trying to push the limits of App Inventor! Snippets and Tutorials from Pura Vida Apps by Taifun.                

Reply all
Reply to author
Forward
0 new messages