Flutter Music player/Video Player
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 a 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.
In this we have used video_player library for playing video from this library we can play video from assets and from the network too.
the above code is for main. dart file
remember to change the assets in pubspec.YAML file as shown above.
The 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 codes will be available in the below git hub repo.
Github Link:
https://github.com/guptaadi123/Flutter_musicplayer_vidioplayer.git
Guys, here we come to the end of this blog I hope you all like it and found it informative. If have any query feel free to reach me :)
Guys follow me for such amazing blogs and if have any review then please let me know I will keep those points in my mind next time while writing blogs. If want to read more such blog to know more about me here is my website link https://sites.google.com/view/adityvgupta/home.Guys Please do not hesitate to keep 👏👏👏👏👏 for it (An Open Secret: You can clap up to 50 times for a post, and the best part is, it wouldn’t cost you anything), also feel free to share it across. This really means a lot to me.