I am making a simple video playback application in Android Studio. The video is approximately 600MB, and has an appropriate title (no spaces etc.). The video will be played back using VideoView.
Where should the video be saved? When it is placed in src/res/raw, (like other files I am using such as .wav for sound effects), it creates resource errors. Do I create a new folder called assets and store the videos there?
Noooo. You will not put that video in your apk. Will your app exceed 600mb size on playstore. See on google documentation.
Google Play currently requires that your APK file be no more than 100MB
Solution:
First try to compress your video, as you don't need high resolution video.
Put video on cloud (like Amazon s3 bucket).
Download this video file at run time in device from Amazon. And then play it anywhere from device storage.
Related
I am creating an MP3 Player app. It's mostly working correctly but there is one edge case.
If a user has a file named "Bieber.mp3" but changes the name of the file to "Bieber" without the file extension in the files app (on Android), they will still be able to play the song properly from the files app depending on the device (older devices like Nexus running on marshmallow will do it while newer devices like the pixel on Android 12 will say it's an invalid file type).
However, when the MP3 file is emailed (or uploaded somewhere in the cloud like drive or Dropbox), the file will have an unknown file type when attempting to from there
I want to know, how can MP3 files that are renamed to exclude the .mp3 extension still play in the android files app? Is there any way I can check to see if a file without the .mp3 extension is still an audio/mp3 file in Java for my mp3 player?
If mp3 files without the mp3 extension can play in the android files app, surely there should be some way to play/access them in the MP3 player I'm making, right?
Well, Android has this library/class called MediaPlayer:
https://developer.android.com/guide/topics/media/mediaplayer
The MediaPlayer is what you use when you play audio,
the MediaPlayer takes the input(the file) as long as it is still encoded as an audio file.
No matter what you do with the file extension, as long as it is still encoded as audio,
it will stay as an audio file.
That's why~
I am creating a chat application where the user can send audio and video files.
For my video files I have successfully created an embedded video player in my app which will play any video.
But for my audio files I don't want to use an embedded video player with options vout=dummy instead I want to be optimized and use an DirectAudioPlayer for my purposes. I took a look at the MediaFactory create but i don't understand how am I suppose to retrieve these parameters for an specific file.
What I want is just one direct audio player in my application which I can reuse for multiple audio files or is this not possible?
You can use a HeadlessMediaPlayer.
This is basically the same as the EmbeddedMediaPlayer that you're already using, but with no API to do with displaying the video.
A word of caution though if you play a video through the HeadlessMediaPlayer, rather than just an audio file, LibVLC will open a native window and play the video - you can suppress this by passing "--no-video" via the MediaPlayerFactory.
The DirectAudioPlayer is used when you want to access the audio buffer in your application - i.e. "direct" access to the native audio buffer. You would then have to use JavaSound or something to actually play the audio. So I don't think this is what you want.
My app is finished and ready to upload! The problem is it's 432Mb. Google play says my app can't be over 100Mb and I should use an expansion file. I have a general idea of what that is, but feel free to break it down. What I need from you is steps on how to get my expansion files and upload it with my APK to Google play. I'm working with 5 mp3 files at 83MB each.
Sorry about the weird title, I couldn't think of anything better.
In my Android App I want to stream an .mp3 file from an http server, which requires basic authentication. The task is to download the data and save it to the sdcard while playing. (Basicly streaming an mp3 from an http server but also saving the file)
I managed to download the mp3 from the server to the sdcard and to play the downloaded file with the Android MediaPlayer class. But playing only works right when the file is downloaded completely. I want my App to play WHILE downloading.
Can someone point out a good solution to this problem? I thought about using some third-party audio library to stream mp3 audio from memory but I couldn't find anything useful for my problem. Are there any good free librarys for Android that suit my needs?
I am using phonegap to create an android application.
Is it possible to stitch a picture and a sound (audio) file together using phonegap framework. The new file after stitching would be a video file.
For example, an app like animoto (for iphone). Where you choose a sound track and a few pics from the phone album and the app creates a very nice slide show with the sound being played in the background.
Can you please provide some links that would explain how to do it as well.
Thanks
Stitching is not possible but you can concurrently run both picture and sound