Flutter Music player/Video Player
Aditya Gupta
Cloud & DevOps Expert | RedHat & AWS Certified | 2+ Yrs Exp | I help Companies Achieve Scalability & Efficiency with Advanced Cloud Solution
Hey guys hope you all are doing good today we are going to learn very different things which we learn usually today we are going to see how to make music player and video player using flutter I hope you have setup flutter in your system and quite familiar with it basically today I have focused more on functioning rather than Ui we are going to play music via local system, via network and same for video all the code will be available in git repo attached at the end lets get started without wasting much time.
- Playing video with the help of assets
In this we have used video_player library for playing video from this library we can play video from assets and from network too.
the above code is for main.dart file
remember to change the assets in pubspec.YAML file as shown above.
Final output will be as shown below.
2. Playing video with the help of Network
All the code and other things will remain the same only change will be as shown below.
Output will be as shown below
3 Playing audio with the help of Network
to play audio from network we are using flutter_radio: ^0.1.8
do the following changes in pubspec.YAML file
main.dart code will be shown as below
the final output will be like this
3. Playing audio with the help of Assets
first of all do the following changes in pubspec.YAML file we are using audio_player lib for playing audio from assets
main.dart code will be as shown below
All the above code will be available in the below git hub repo.
Thank you for reading I hope you like the article.