In my code i am using VideoView and MediaController for playing my audio/video files. The problem is that I need to place my audio/video files in assets folder but i am not able to play the audio/video files when placed in assets folder and give path as "file:///android_asset/audio.mp3". I get this error "Command PLAYER_SET_DATA_SOURCE completed with an error or info PVMFErrNotSupported". But the same code runs when i place my audio/video files in sdcard and give its path(/sdcard/audio.mp3). Does this mean that i cannot play audio/video files when placed in assets folder? Thanks in advance.
Your path is wrong.
For playing audiofiles from the assets directory, you have to follow the advice in the similar question here.
Related
I tried to add a mp3 song to android, exactly like this explanation, but it's not recognizing my mp3 file as sound, and shows me this error message:
Try putting the mp3 file in assets folder.
Please clear the empty characters in the filename.
I have used GallerySaver library but this works just with mp4, not with mp3.
I've used FlutterDownloader and MediaSaver library but I don't no why isn't working to save in Gallery folder or in Music folder.
I can save in cache folder in app but I don't want this because I'm going to have problems later.
Can someone give me an example of this, please?
Iam a learner of creating android custom app. I create simple app using HTML files via Quick-App-v1.1. I have include the audio file in html file. it's properly play when open the HTML file in browsers, but when create the app the audio file not playing. Please advice me.
Create a folder in Android Studio under 'res' and name it 'raw'.
Copy your audio file to the raw folder.
To play the audio file you can use something such as:
MediaPlayer song;
//then play it inside your onCreate
song = MediaPlayer.create(this, R.raw.YOUR_SONG_NAME);
song.start();
Check this out:
http://developer.android.com/reference/android/media/MediaPlayer.html
I need a video library for "Processing Android" to play some videos in my game. I tried ApWidget VideoView but it works only when a video file is placed on sd card and its path is provided to video view object. But how can i play videos that are placed in data folder of my sketch?
My experience is assets such as videos or images have to be in the Assets folder in your app tree (I'm assuming you use Eclipse). Otherwise your assets won't export when you compile the app.
If there's an issue with the code, we need to see it to answer further. Best of luck!
I have a video file that file extension is.mp4. I placed it in assets folder. Now I want to play this video in my app. Anyone give me some code suggestions for this.