Creating a media player app using Flutter.
‼️ Task1: Flutter App Development ‼️
1.Create a flutter app.
2. Use assets (eg. audios and videos).
3. App will have to play this audios and videos from Assets.
4. Also add Features to play audio and video from Internet(Network).
5. Create buttons like play, pause and stop for audio and video both.
So this is the what we are going to do in this article, I will take you through the procedure of how we can build something like this.
1) Playing music from Assets :
For this we will be using the audio_player plugin.
We can directly use it to play the songs from the assets, for more details refer to my github repo. (will be at the end of this article).
Using audio_cache from audio_player we cannot pause the audio once you start it there is only one way which is when the audio ends itself.
I have made a cute little xylophone for its demonstration.
Whenever anyone touches the tiles it will play the notes of a xylophone, its really satisfying.
I got sooooo creative while working on this, had more ideas will implement later.
2) Playing videos from assets :
However this may not be the feasible method to put videos in your application as it will definitely increase the size and that to exponentially but there is a way we can do this using the video_player plugin.
It does have a controller so we can play, pause and resume and do a lot of tweaking with it.
So I gave a very basic play and pause functionality will definitely explore further.
Yes I'm a DARK fan :) , those little icons on the right are clickable and will navigate to a new page were we can see the videos.
Something just like this :
Now the most interesting part how to do this via Internet (I have used AWS S3 here and tweaked my code in such a way that it becomes simple).
3) Getting videos from S3.
This is the best way to do this, so what I have done is I have created a S3 bucket where I have my videos and then using the url and little bit of tweaking using dart and video_player it becomes super easy.
And the UI that I created for this is something like this :
These 4 video titles are clickable and will go to this screen :
4) This was the part were I was really interested in working using S3 to stream music, managing this big amount of data, I could not reach to it's depth yet, but I will definitely explore this part.
For this I have used S3, audio_player and some playing around with the dart code to achieve a short milestone.
UI:
Here these card widgets are clickable and will take the user to this screen:
That's all what I did in this project, a quick video for better understanding of apps flow :
For better understanding check out my repo:
Will be working on it further to improve the features.
Thankyou!!