In this video we will take a look at a simple MediaPlayer example. We will play a local sound file from our raw folder and we will be able to pause, resume and stop the music. When we stop our MediaPlayer, we will immediately release it to free up system resources.
Check out the SoundPool video:
Source code:
____________________
❗ Subscribe to the channel:
⏯ Watch more tutorials:
㊙ Help translating the videos:
💚 Support the content:
💬 Join the Discord chat:
🎧 Audiobooks and podcasts for programmers:
👶 How to get started with Android development:
📣 Follow Coding in Flow on social media:
Facebook:
Instagram:
Twitter:
Blog:
Nguồn: https://trulyluminary.com/
Xem thêm bài viết khác: https://trulyluminary.com/game/
hello everybody. Where can i find similar songs? I want to make a quiz app and I need a song for background. 🙂
Outstanding!
Which screen recorder are you using?
Hello, I'm new to this and need help to understand that release part you talked about.
Could you help me out?
Great tutorial man 👌🏼
Hello; I have a few buttons that play different sounds of more than 10 seconds. How can I stop playing a sound and reset it when I press on another sound button? I used your "PLAY" method to play sound files according to the buttons ID's. Thanks so much bro
mine is working but the only problem is i have a long delay when executing stop button 4 to five seconds delay how can i solve the delay?
Could you tell me where you assign the buttons for the mediaplayer?
Great work bro but i think you forgot to create onClick method for each button
Thanks its working
I have audio on firebase database. How to implement that?
Many Thanks Friend!
thanks for helping me get through my degree, much love from australia
bro,how to add restart button in media player?
always helpful videos and easy thank you mate
Thank you you are the best
can you upload a tutorial on how to increase and decrease the tempo of the song, without interrupting the playback..
Can I play a song that is on dropbox?
thank you so much!!! helps me every time!!!
Hi, i need the video's link "keep music playing when we leave our app" PLZ
Thanks
How do you put 2 or more songs there . When song 1 play , then I play song2 and song1 stop at that time. How to implement that ?
How to do it using services??
It freezes when I click "Play"
Such a beautiful voice
Hey bro you Are awesom
Please make video on how you approaches your Android development skill from the starting and about tips to become a smart developer like you
Thank you, i stayed 2 days trying to figure out how to use the same instance of Media Player without creating a different instance of Media Player every time i click play or pause…even when i tried to save "Media Player " instance into firebase, i failed because of data Type..you solved it