How to Build a Custom Audio Player in React

  Рет қаралды 55,109

Self Teach Me

Self Teach Me

Күн бұрын

In this video, Amy builds a custom audio player in React from scratch. This is the same audio player that you'll see on the Compressed.fm website (compressed.fm) -- a podcast all about web design and development.
0:00 Introduction
1:43 Looking at the Design
2:23 Starting with Next.js
4:29 Brief Explanation of Next.js folder structure
5:40 Stubbing out our page
6:24 Styling within Next.js
7:03 Explanation of box-sizing: border-box
8:42 Setting up our Audio Component
10:53 Explaining the audio element and what elements HTML gives and what we have access to via JavaScript
12:06 Explaining the DOM
14:08 Stubbing out all the elements that our Audio Component needs
15:36 Setting up our styles for our audio player
16:31 Using Icons for forward, backward, play, and pause
19:01 Setting up the play / pause toggle
21:43 Styling the buttons within our Audio Player
27:20 Styling the progress bar
38:14 Interactive functionality with JavaScript
38:48 My thoughts on using comments
39:19 useReference for grabbing our audio
39:57 Making the audio player actually play and pause
41:58 Connect duration read out
49:29 Connecting the current position read out
50:58 Updating the Progress Bar as the song plays
55:23 Updating the Playhead / Knobby
1:00:00 The Next and Previous 30 Buttons
💥 ZEAL IS HIRING 💥
www.codingzeal.com/hiring
🤖 FINAL CODE
* GitHub - github.com/selfteachme/0046-c...
🔗 LINKS
* Next.js Documentation - Getting Started - nextjs.org/docs
* Hyper, Terminal alternative - hyper.is
* Additional information on box-sizing: border-box: css-tricks.com/box-sizing/
* ES7 React / Redux / GraphQL / React-Native Snippets VS Code Extensions - marketplace.visualstudio.com/...
* HTML audio Element - www.w3schools.com/html/html5_...
* Simplecast - simplecast.com/
* React Icons Library - react-icons.github.io/react-i...
* CSS-Tricks styling the progress button - css-tricks.com/styling-cross-...
👉🏻 Get Updates and Exclusive content at selfteach.me
💥 SelfTeach.me is a Zeal show: codingzeal.com

Пікірлер: 215
@angelap.8160
@angelap.8160 2 жыл бұрын
Dear Amy, thank you very much for your wonderful tutorial! I truly excited to see how the series continues! :D I followed the tutorial and everythings works for me but the duration read out. After following your 49:29 step I still get sometimes "NaN" when I reload the page, and once I start playing the audio it updates itself. I noticed that around 55:07 of this video you also encountered this error, but then it dissappears. Do you maybe have an idea of why it happens? Thank you again for your channel and the podcast! :D
@SelfTeachMe
@SelfTeachMe 2 жыл бұрын
Angela // Good catch! -- and sorry for the confusion. I'll pin your comment and address this in an upcoming video in this series, but there's actually a built-in event listener that you can hook into instead of using a useEffect. It's called onLoadedMetadata. So, within the audio component, you might say: -- meaning it calls the onLoadedMetadata function once the metadata is loaded. I'm actually using this method on the Compressed.fm site. You can check out the source code here (direct link to the actual audio player component): github.com/ahaywood/compressedfm/blob/master/nextjs/src/modules/shared/components/AudioPlayer/WaveformPlayer.js#L48 Let me know if you continue to run into issues.
@angelap.8160
@angelap.8160 2 жыл бұрын
@@SelfTeachMe Thank you for the tip! It worked perfectly!! 🔥
@MrSantino3
@MrSantino3 2 жыл бұрын
@@angelap.8160 Hey Angela , I've been facing same error, can you help me solve it? It says onLoadedMetadata function is not available. I am not sure , do I have to replace useEffect with the onLoadedMetaData function , or to create a new function. I tried both , but neither worked. Do u remember the solution?
@rassolar
@rassolar 2 жыл бұрын
@@MrSantino3 replace your useEffect with" `const onLoadedMetaData = () => setTotalAudioTime(audioPlayer.current?.duration);`
@xhwogusxh
@xhwogusxh 6 ай бұрын
@@rassolarThank you!!! you are genius!!
@brettgamble5720
@brettgamble5720 Жыл бұрын
Thanks Amy! I really enjoy your teaching style and loved this episode. You deserve a lot of credit for the work you put in and I appreciate the effort and the value you give.
@Heffsta02
@Heffsta02 Жыл бұрын
I've been using React for a few years and coding for a long time.....this was such a delightful and well explained video, and really helped me out on a project. Thank you.
@jusoul4821
@jusoul4821 Жыл бұрын
Amazing! This was exactly what I was looking for without knowing this is what I was looking for.. I've explored many articles, repos, videos, and no longer need to continue my search. Well worth the hour. Thank you!
@enriqueg4400
@enriqueg4400 Жыл бұрын
Hi Amy, thank you for this awesome tutorial. I used your video to implement a custom audio player and had no clue how to do it till I saw your tutorial. Thanks again!!
@apoorvchandurkar1210
@apoorvchandurkar1210 2 жыл бұрын
This tutorial really helped me as I was stuck on this issue for a while! Very well explained and great video overall!
@LetV4ever
@LetV4ever 2 жыл бұрын
This video is so useful ! You make it so simple to understand and follow through, thank you so much !
@lukecartwright613
@lukecartwright613 Жыл бұрын
This is perfect! I've been trying to do this in react and I've been pulling my hair out!! Thank you for sharing this series!
@ciaranjmcg0v
@ciaranjmcg0v 2 жыл бұрын
This is a great tutorial! I've not worked much with audio in the browser before but I've used a lot of video components. I'll for sure be referring to this in the future for *media* related projects & even the approach to various aspects of code design! PS: I converted this to styled-components on the fly and it works perfectly! You now have a new subscriber :D
@sohailsaha7427
@sohailsaha7427 2 жыл бұрын
The thing that I loved the most is that this is not just a tutorial to reach from A to B, but also includes the reason behind why things work the way they do. Thanks for this.
@SelfTeachMe
@SelfTeachMe 2 жыл бұрын
Thanks Sohail! That's my intent so I'm *so glad* that you picked that up.
@sohailsaha7427
@sohailsaha7427 2 жыл бұрын
@@SelfTeachMe Hope more people find your channel. Keep doing awesome stuff!
@sebastiangimenezl
@sebastiangimenezl Жыл бұрын
Hi Amy! I'm happy to have found you! I was just looking for how to create a streaming player and I found a gold mine!! I am in love with the easy, practical, fun and calm way that you have to explain, it is a little more difficult for me because I am from Argentina and I do not speak English; (By the way, the 4 inches from the bottom are covered by the subtitle, if you can coding from above it would be a great relief!!). Thanks for your videos!! I hope one day to be as good as you!😙
@bigboy8860
@bigboy8860 2 жыл бұрын
this is the best tutorial I've ever seen! just a small issue I found, at 1:01:47 on line 62 you should put the -30 outside the parenthesis, because it can cause bugs (converting to number only after adding them together as string).
@tomasburian6550
@tomasburian6550 2 жыл бұрын
Thanks, brah. I had a bug that made the `skip forward` function to jump all the way to the end. Your solution fix'd it!
@ferris9880
@ferris9880 2 жыл бұрын
Yep I had the same problem and this fixed it. Thanks!!
@writeatunethatreallysucks8696
@writeatunethatreallysucks8696 2 жыл бұрын
true
@user-gn9jq9ve3p
@user-gn9jq9ve3p Жыл бұрын
thank you!!
@mayyy4765
@mayyy4765 Жыл бұрын
Thank you sir!
@alissaa.1289
@alissaa.1289 2 жыл бұрын
This is legit the best tutorial that I ever have seen! Thank you very much, helped me a lot :)
@SelfTeachMe
@SelfTeachMe 2 жыл бұрын
That's so great to hear! Thanks!
@JohnBartmannMusic
@JohnBartmannMusic Жыл бұрын
hope this blows up with the podcasting scene. thanks for showing up.
@c4binfever
@c4binfever 2 жыл бұрын
On the last line i changed my forwardThirty function to // progressBar.current.value = Number(progressBar.current.value + 30); progressBar.current.value = Number(progressBar.current.value) + 30; I found for me it was appending the number instead of numerically adding them. Great tutorial though Amy thanks so much! I enjoyed following along and I used it in one of my projects :D
@SelfTeachMe
@SelfTeachMe 2 жыл бұрын
Good catch! In a follow up video on debugging (kzbin.info/www/bejne/bGXRXoBsjJWkgac), I realized the code should have been: Number(progressBar.current.value) + 30; -- You want to cast the progressBar.current.value to a number before adding 30.
@c4binfever
@c4binfever 2 жыл бұрын
@@SelfTeachMe I just realised that earlier today :O I watched your debugging video and was kicking myself. Now I know how to isolate bugs like a pro! Thanks again!
@SelfTeachMe
@SelfTeachMe 2 жыл бұрын
@@c4binfever Glad you got it figured out! ... and glad you found that video helpful!
@quem_gabriel
@quem_gabriel 2 жыл бұрын
hahahahah. i'm laughing because i catch the same problem and i'm reading every comment to find someone who catch the same. Thank you man to ask and Thank you Self Teach Me, i'm learn to create this audioplay to use in a project i have with my wife to get our shortcut spotify audio and show in your webpage whitout spotify . In the future i would like to writing to for peoples chose if they want read ou listen. Thank you!
@klheebang791
@klheebang791 7 ай бұрын
I love the way you explain everything. So visual and easy to follow! Thank you!!
@SelfTeachMe
@SelfTeachMe 6 ай бұрын
Thanks @klheebang791 Appreciate it!
@codingwithdidem
@codingwithdidem 2 жыл бұрын
Its a 1 hour tutorial and I'm not a tiny bit bored. Loved your attitude! Keep up the great work
@SelfTeachMe
@SelfTeachMe 2 жыл бұрын
Thanks for the kind words!
@jaymeenjogiya8798
@jaymeenjogiya8798 2 жыл бұрын
I searched audio tags like a years ago, i found nothing on the youtube, here after year, i have such a great instructor. Thank you so so so so much 💗💓
@SelfTeachMe
@SelfTeachMe 2 жыл бұрын
Wow, thanks! Glad that you found it helpful.
@rohitdalal954
@rohitdalal954 2 жыл бұрын
Thank you so much for this tutorial. Literally got everything which I wanted in a single video. Helped me a lot, thank you!
@SelfTeachMe
@SelfTeachMe 2 жыл бұрын
Woo hoo! That's awesome!
@sonnycastro6546
@sonnycastro6546 2 жыл бұрын
Amazing tutorial! So good that I subscribed. Look forward to more tutorials like this one. Congrats
@SelfTeachMe
@SelfTeachMe 2 жыл бұрын
Thanks, Sonny! Appreciate that!
@Bluepaccao
@Bluepaccao 2 жыл бұрын
Great tutorial and also great pacing of the editing. Made it very interesting to watch!
@SelfTeachMe
@SelfTeachMe 2 жыл бұрын
Yeah! Love hearing that!
@subodhpareek18
@subodhpareek18 2 жыл бұрын
Great video, wonderful presentation style, production quality, etc too!
@SelfTeachMe
@SelfTeachMe 2 жыл бұрын
Thanks!!
@raiffemouraa
@raiffemouraa 4 ай бұрын
woow, I loved the way you explain everything! I´m a new dev from brasil, a huge thanks!
@SelfTeachMe
@SelfTeachMe 3 ай бұрын
Yeahh! So glad you found it helpful!
@oluseunakintayo3060
@oluseunakintayo3060 9 ай бұрын
I came across this video at the right time. Thank you!
@SelfTeachMe
@SelfTeachMe 6 ай бұрын
Yeah! Glad you found it helpful.
@italoguajardopenaloza7516
@italoguajardopenaloza7516 2 жыл бұрын
You saved me with the progress-bar, i had no idea how to make it. You stopped me from producing a tumor from frustration.
@SelfTeachMe
@SelfTeachMe 2 жыл бұрын
Glad I could help!
@teachercarlosmayo1215
@teachercarlosmayo1215 2 жыл бұрын
Dear Amy, thanks for such a great tutorial. You are doing it great, thanks for it.
@SelfTeachMe
@SelfTeachMe 2 жыл бұрын
Yeah! Glad you found it helpful!
@girornsveinsson7970
@girornsveinsson7970 2 жыл бұрын
Thanks again for this great code. I am now using it in my project after customizing the appearance a bit. Actually, I was also able to use almost exactly the same code and css to build a simple video player too with the same look and feel. It looks like the principles for the video are almost identical.
@SelfTeachMe
@SelfTeachMe 2 жыл бұрын
🙌🏻 Awesome! Glad you were able to get everything to work.
@paxdriver
@paxdriver 2 жыл бұрын
I find it's easier to learn to code if I re-write examples like this video from scratch on my own after watching it, rather than writing from memory or copying blocks trying to produce it from nothing. I find that by only using known-good code when I get stumped as a reference, and taking the time to muddle through on my own, that's the best education one can get in this field. Because that way you know how to do many variations, not just one example. It's much slower, but you'll remember it forever
@rodrimelenas
@rodrimelenas 2 жыл бұрын
Aaaaaawesome!! Looking forward to creating a playlist and handling multiple players on the same page!!! :)
@SelfTeachMe
@SelfTeachMe 2 жыл бұрын
They’re still in the cue! But it’s happening!
@atimy
@atimy 2 жыл бұрын
Thanks! Explanations are concise and perfect
@SelfTeachMe
@SelfTeachMe 2 жыл бұрын
Glad it was helpful!
@beratgenc7695
@beratgenc7695 2 жыл бұрын
So so educative, notes taken. Thanks
@rockyessel
@rockyessel 11 ай бұрын
Aww my heart. i think I'm in love with your teaching style
@SelfTeachMe
@SelfTeachMe 6 ай бұрын
You're too kind.
@ebatheone9173
@ebatheone9173 2 жыл бұрын
Thank you for the video. Very well explained. I learn a ton :)
@SelfTeachMe
@SelfTeachMe 2 жыл бұрын
Glad it was helpful!
@danielagreen5682
@danielagreen5682 2 жыл бұрын
Great tutorial! Thanks for publishing!
@SelfTeachMe
@SelfTeachMe 2 жыл бұрын
My pleasure!
@pikka8524
@pikka8524 2 жыл бұрын
Thank you so much! It is very helpful and awsome video ever I watched! 👍
@mobs9306
@mobs9306 Жыл бұрын
Thank you very much for this learnt a lot!
@joseromarybrandao
@joseromarybrandao Жыл бұрын
The Best Tutorial ever! Congratulations! +1 subscriber!
@maverick_wolfe
@maverick_wolfe Жыл бұрын
Works perfectly! Thank you so much! God bless you 🙏
@civilization_tfgonz
@civilization_tfgonz 2 жыл бұрын
Man, you are so patient! Thank you so much! Wonderful class!
@SelfTeachMe
@SelfTeachMe 2 жыл бұрын
Yeah!! Glad you found it helpful!
@civilization_tfgonz
@civilization_tfgonz 2 жыл бұрын
@@SelfTeachMe I just saw it again ... Yup still helpful! I just found my first job as a Web Developer thanks to you and all of this amazing community! Kudos!
@SelfTeachMe
@SelfTeachMe 2 жыл бұрын
@@civilization_tfgonz thank you for saying that!! That’s exactly why I enjoy creating content
@civilization_tfgonz
@civilization_tfgonz 2 жыл бұрын
@@SelfTeachMe Thank you 🙂
@ambroiseadanledji6158
@ambroiseadanledji6158 Жыл бұрын
Thank you for this tuto. Amazing !!
@sammeester3514
@sammeester3514 3 жыл бұрын
Thank you so much Amy, this was great!
@SelfTeachMe
@SelfTeachMe 3 жыл бұрын
Awesome! Glad you liked it
@aagamjain4142
@aagamjain4142 2 жыл бұрын
Hey Amy! Really thankful to you for this video. But I am stuck with duration coming as Nan in the beginning and setting the duration automatically after clicking on the play. I tried the below-pinned comment of OnLoadedMetaData and removed the useEffect as suggested But then it shows 0 as duration and it doesn't even change after you have clicked the play. Do you by any chance know the reason behind it? Thanks, Amy once again :)
@MrPahne1
@MrPahne1 2 жыл бұрын
Don't normally comment but this was excellent, super educational and clear!
@SelfTeachMe
@SelfTeachMe 2 жыл бұрын
Ahh! Thanks Axel!
@benarlanda373
@benarlanda373 2 ай бұрын
Love this video. Is it possible to add multiple players to different audio files on one main page?
@litbro8180
@litbro8180 Жыл бұрын
Thanks!! Great tutorial
@tausifmuftasinabid3195
@tausifmuftasinabid3195 Жыл бұрын
it was really helpful thank you ❤❤❤
@JohnBartmannMusic
@JohnBartmannMusic Жыл бұрын
Building a sticky React audio player which continues to play when switching between pages on a site if anyone wants to help out. Thanks for this power tut Amy! subbed
@girornsveinsson7970
@girornsveinsson7970 2 жыл бұрын
Thanks for a great video - very helpful. One question though. The progress in the progress bar currently jumps every second instead of expanding smoothly. This become visually more obvious with a larger width of the progress bar and an audio with a short duration. Is there a way to modify it to have a visually smoother progress?
@girornsveinsson7970
@girornsveinsson7970 2 жыл бұрын
I found a very easy solution to this issue by simply adding " step='0.05' " to the input tag.
@SelfTeachMe
@SelfTeachMe 2 жыл бұрын
Awesome! Smart solution!
@AmodeusR
@AmodeusR Жыл бұрын
Thanks for this video, it helped me a bit in doing a music player challenge. Animating the progress bar didn't work very well because the method you showed was very memory have and even had a memory leak somehow, though 🤔Not sure why, but I changed the method to update the currentTime with a setInterval. It worked like a charm haha!
@germanulrich6741
@germanulrich6741 Жыл бұрын
It is better to use onEnded , onTimeUpdate , and onLoadedData of the audio element instead of useEffect to detect changes in those values
@pamelabengloff975
@pamelabengloff975 Жыл бұрын
what is the font style, or the general style of your visual studio code? i want mine to look like that but idk how to get it like yours btw I love your videos!!
@tolabanjo2675
@tolabanjo2675 2 жыл бұрын
Thank you very much for this.
@paxdriver
@paxdriver 2 жыл бұрын
Thanks a mil! I was wondering if you could link or explain how the prevValue works on a variable pulled from state but not from the state itself? I don't really see anything like that in the component lifecycle documentation (or maybe i did but i'm missing the point lol). I've done similar before in react but I thought i was just hacking around and causing the issue myself, but evidently "it's a feature" lol
@HOSS11H
@HOSS11H 2 жыл бұрын
thx for the effort benefited a lot
@alasassi960
@alasassi960 Жыл бұрын
what a good and nice teacher thanks
@Robin-ww7xp
@Robin-ww7xp Жыл бұрын
Thanks for the video. I have built something similar for a website I'm making and it works fine on firefox but the part behind the knobby/thumb does not get styled in chrome based browsers. Do you know a solution to this
@randerins
@randerins 2 жыл бұрын
Amazing content! Thanks a lot!
@SelfTeachMe
@SelfTeachMe 2 жыл бұрын
Thank you! Glad to hear that!
@_its_omg
@_its_omg 3 жыл бұрын
Just have to tell one thing: Amazing 🔥🔥🔥🔥
@SelfTeachMe
@SelfTeachMe 3 жыл бұрын
Thanks, Om!
@vaibuscalfoni4360
@vaibuscalfoni4360 7 ай бұрын
Amazing content! Thanks a lot
@SelfTeachMe
@SelfTeachMe 6 ай бұрын
Glad you liked it!
@baturay6219
@baturay6219 2 жыл бұрын
This is perrrrrrrrrfect! Thank you so much.
@SelfTeachMe
@SelfTeachMe 2 жыл бұрын
You're so welcome!
@user-pb1yu4pw4i
@user-pb1yu4pw4i 25 күн бұрын
Thanks a lot Amy 🤩
@akash.serene
@akash.serene 3 жыл бұрын
You are just awesome. I Iike the way you teach. It is quite interesting 🙂
@SelfTeachMe
@SelfTeachMe 3 жыл бұрын
Thanks Akash
@gajraj_mohini
@gajraj_mohini Жыл бұрын
Loved this tutorial. I want to develop a music player app. It should be able to take a short piece and loop it in sync with the current BPM. There will be a small pattern of music which will repeat infinitely. How do I do that
@skyewild3647
@skyewild3647 3 жыл бұрын
So awesome... thank you very much. I had a good amount of knowledge but am self taught on Reactjs (even though I've been a developer for many years) and you really filled in some major gaps for me!! Did you say you were going to do one with visualization? Also, I would love to apply but it doesn't look like you guys hire older people, especially a female older developer :( Its been very hard to find work as I still have a good decade before retiring but if you're not young... one gets overlooked a TON. You say your people encourage side projects but do they encourage well rounded experienced older developers?
@SelfTeachMe
@SelfTeachMe 3 жыл бұрын
Awesome! Glad to hear that!
@nikolyovin
@nikolyovin Жыл бұрын
Amy, thank you very much! You really helped me! Hello from Russia
@lewiswardita9902
@lewiswardita9902 2 жыл бұрын
Hey Amy, just a quick one. at 42:00 you say to create a const prevValue that can be used so the toggle button works correctly when playing etc. Is there any reason you don't use useEffect(( => { if (isPlaying){ audioPlayer.current.play() } else { audioPlayer.current.pause() } }) , [isPlaying]) ?? or it's just not best practice using useEffect maybe?
@SelfTeachMe
@SelfTeachMe 2 жыл бұрын
Lewis // This is a great question. The code you wrote should work. This is an example of there's more than one way to do things. I didn't use a useEffect because it's setting up a listener (for isPlaying) when I already know exactly when it's going to change. However, if you ever needed to extend isPlaying and need to control it elsewhere, your use case would be perfect. Recently, I discovered a Learn with Jason episode, where they made an Audio Player within React: www.learnwithjason.dev/build-a-custom-accessible-audio-player with source code: github.com/learnwithjason/accessible-react-audio-player It's kind of interesting because he uses React's synthetic event handler, `onPlay` to set the state (specific line of code): github.com/learnwithjason/accessible-react-audio-player/blob/4ed52b799002291b50ac1a5bc06fef73b6b69733/src/components/audio-player.js#L104
@lewiswardita9902
@lewiswardita9902 2 жыл бұрын
@@SelfTeachMe okay cool 👍😎. Good stuff! Just discovered your channel and really enjoying it
@SelfTeachMe
@SelfTeachMe 2 жыл бұрын
@@lewiswardita9902 Awesome! Glad to hear that.
@hermannmohou6620
@hermannmohou6620 2 жыл бұрын
i was able to solve the problem of the message that I had brought to you but it turns out that I would like to know, if with this functionality it is possible to play several different audio? case I am confronted with this problem I cannot play several audios case when I launch an audio the two mp3s which I have on my web page play the same song without although I have to click on the second
@naiadbaksh3996
@naiadbaksh3996 2 жыл бұрын
Unreal tutorial!
@SelfTeachMe
@SelfTeachMe 2 жыл бұрын
Thanks!
@reginasap9104
@reginasap9104 10 ай бұрын
Thank you very much for your detailed explanation!!! you are awesome and your smile is gorgeous. thank you very much!
@SelfTeachMe
@SelfTeachMe 6 ай бұрын
Thank you! 😃 Appreciate the kind words!
@zip_sk
@zip_sk Жыл бұрын
what kind of camera are you using :D ? its so good
@PaulyWollyUTube
@PaulyWollyUTube 2 жыл бұрын
Hi Amy. Thanks for this great video. You are a good teacher and the way you work is very calming and effective. I also like the way you reason why you are doing what you are doing. TWO THUMBS UP!! I was able to resolve many of the issues I was having but one. I notice that when I hit the 'forwardThirty' button once it moves ahead 30 seconds... but If I hit it again.. it goes to the end of the file regardless of the file size. The 'backThirty' button works great. Also, I a curious if you can proved info on how I can play audio files not hosted on a CDN or remote. Can I play files stored locally in a folder with the React files? I tried and was not able to get it to work. Keep up the good work. I am looking forward to your next video. :)
@Djinn667
@Djinn667 2 жыл бұрын
I had a similar problem with the local files. Did you import them in your js code?
@PaulyWollyUTube
@PaulyWollyUTube 2 жыл бұрын
@@Djinn667 Amy fixed it in a later video
@jayjayjaythebrand
@jayjayjaythebrand 2 жыл бұрын
Tutorial is amazing. Mind me asking what theme you're using in VS code?
@SelfTeachMe
@SelfTeachMe 2 жыл бұрын
Glad you liked the tutorial! -- I'm using the Cobalt 2 Theme, Dank Mono Font, and I'm using a combination of the extension Peacock (marketplace.visualstudio.com/items?itemName=johnpapa.vscode-peacock) and custom settings within .vscode/settings.json file to change the window frame (top and side bars). -- When I have multiple VS Code windows open, the window color is a quick and easy way to distinguish between each window. Peacock will assign a random color, but for some of my personal projects, I like to choose colors explicitly. That's when I'll change the .vscode/settings.json file by hand.
@user-ej4fb3nx2v
@user-ej4fb3nx2v Жыл бұрын
soo gud thanks you for the best content
@aubreydigital
@aubreydigital 2 жыл бұрын
id love to know what theme you are using in your vs code! thanks so much for the walk though explanation!
@SelfTeachMe
@SelfTeachMe 2 жыл бұрын
I'm using Cobalt 2.
@JamesQQuick
@JamesQQuick 3 жыл бұрын
So dope!!
@SelfTeachMe
@SelfTeachMe 3 жыл бұрын
Thanks!!
@emmanuelmars2491
@emmanuelmars2491 2 жыл бұрын
play /pause built in function not working for me. the method is not found or something. when i type them in they become underlined and im asked to create this method. using react app
@aliamorsi6148
@aliamorsi6148 2 жыл бұрын
Great Tutorial! Thank you :)) My only feedback for future videos is to keep the code for longer in sight while you are talking about the next step. I had to pause the video too much to follow along.
@SelfTeachMe
@SelfTeachMe 2 жыл бұрын
Thanks for the feedback. There's also a link to the final code in GitHub if you want to review the code further.
@theundergroundsm
@theundergroundsm 2 жыл бұрын
Amazing, thanks 🙏🏾
@SelfTeachMe
@SelfTeachMe 2 жыл бұрын
You’re welcome 😊
@jasonruff1270
@jasonruff1270 2 жыл бұрын
what would the src be of an audio file that is in our project folder?
@sagarsiwakoti3517
@sagarsiwakoti3517 2 жыл бұрын
great video ...helped me ....i like to point out that at the end of the audio it does not show the play button and keeps playing
@SelfTeachMe
@SelfTeachMe 2 жыл бұрын
That's a great point. I've made a note to include this feature as a video in the series.
@A_Saban
@A_Saban Жыл бұрын
Thank you! I know this video is from over a year ago, nevertheless it help me a ton!
@PeaceMatters5
@PeaceMatters5 2 жыл бұрын
Wow amazing tutorial!!xo
@SelfTeachMe
@SelfTeachMe 2 жыл бұрын
Thanks, Natasha!
@additionaddict5524
@additionaddict5524 2 жыл бұрын
Right at the end it should be, Number(progressBar.current.value) + 30 not Number(progressBar.current.value + 30)
@SelfTeachMe
@SelfTeachMe 2 жыл бұрын
Thanks for the catch. The next video in the series, Debugging in VS Code, I show how to use VS Code’s tools to debug and fix this.
@nickplaysviola
@nickplaysviola 2 жыл бұрын
wow thank you! super cool stuff, amazing work! i livestream viola performance on twitch and am looking for a situationally aware and conditionally-activated audio player so that when it's not hearing sound from my audio interface (mic), web browser, or audio files, it plays a playlist of audio, and ducks down to -99db when it does hear something. not enough time between sounds to manually turn on music, but enough so that the silence can get too long for my taste. can i hire you to work it out? haha! no but seriously?
@philip9677
@philip9677 2 жыл бұрын
nice work
@SelfTeachMe
@SelfTeachMe 2 жыл бұрын
Thanks
@PaulyWollyUTube
@PaulyWollyUTube 2 жыл бұрын
Hi Amy. great video. i have been trying to find a good React video on the audio player and i am glad i found yours. i am following along and the design is coming along great. I am having issues though... trying to get the audio stream to play - (1) i am getting CORB errors and (2) when I try to use the '.play()' function I am getting an error: TypeError: Cannot read property of undefined (reading 'play'). I am setting up the play options just as you coded it: I am using the 'useRef' hook for - audioPlayer, and I am setting up the pause-play as such: { isPlaying ? : } if (isPlaying) { audioPlayer.current.play() } else ... The error comes at the play() function, after 'current'. It is not recognised. I know that play() is a part of HTML, but not sure why I am getting the error.
@earxe7712
@earxe7712 2 жыл бұрын
I had the same error you didnt define the audioPlayer using "ref". Also to track the metadata you will need to preload it to work when pause.
@wittespiegel1212
@wittespiegel1212 5 ай бұрын
excuse me, you made a very fascinating and helpful tutorial, but could you help me with this minor bug? Everything works greatly but the progress bar is glitched. When I first play the audio, it doesn't appear. It just appears only when I double click on the play button. Is that the problem of the animation?
@SelfTeachMe
@SelfTeachMe 3 ай бұрын
I'd need a little more context to be able to troubleshoot. Do you have your code posted somewhere so I can look at it in context?
@Djinn667
@Djinn667 2 жыл бұрын
If you are using an mp3 file in your project folder, you must first write the import statement at the top.
@franny8480
@franny8480 2 жыл бұрын
what font family do you use in this video? please answer, for the editor i mean :D
@SelfTeachMe
@SelfTeachMe 2 жыл бұрын
Dank Mono
@franny8480
@franny8480 2 жыл бұрын
@@SelfTeachMe Thank you
@mohammadebrahimibaqa6217
@mohammadebrahimibaqa6217 Жыл бұрын
Very Good
@SelfTeachMe
@SelfTeachMe 6 ай бұрын
Glad you enjoyed it.
@aleksandrmatyka3118
@aleksandrmatyka3118 3 жыл бұрын
Nice!
@SelfTeachMe
@SelfTeachMe 3 жыл бұрын
Glad you liked it!
@98naimad
@98naimad 2 жыл бұрын
I ❤️ YOU!!! THANK YOU!!!
@yanivhe
@yanivhe 3 жыл бұрын
Thank you! :-)
@SelfTeachMe
@SelfTeachMe 3 жыл бұрын
Sure thing!
@zeckinho_
@zeckinho_ 2 жыл бұрын
Thank you 🥰
@SelfTeachMe
@SelfTeachMe 2 жыл бұрын
You’re welcome 😊
@geniux8048
@geniux8048 3 жыл бұрын
Wonderful
@SelfTeachMe
@SelfTeachMe 3 жыл бұрын
Thank you
@krishnakantmodani353
@krishnakantmodani353 2 жыл бұрын
Hi.. I'm wondering how can we control the audio play, pause, previous and next from the notification bar..like many music player app...would be helpful, if you make a tutorial on it too.., or if you've already covered it, please let me know... Thanks btw!🙌
@SelfTeachMe
@SelfTeachMe 2 жыл бұрын
Great idea! I have a video in the cue for creating a player across the top of the page. Is this what you're talking about?
@krishnakantmodani353
@krishnakantmodani353 2 жыл бұрын
@@SelfTeachMe Don't know, whether you're thinking exactly what I'm trying to say. Could you just search for "music control on notification bar android" on Google and check the image section... You'll see what I'm talking about.
@SelfTeachMe
@SelfTeachMe 2 жыл бұрын
@@krishnakantmodani353 Ahh, I did misunderstand. I **believe** that functionalty would be through your device's native controls. -- For example, this player would be running through your device's browser. The notification bar would technically be controlling the browser, not your webpage.
@renanmomessovechini
@renanmomessovechini 7 ай бұрын
Thanks so much
@SelfTeachMe
@SelfTeachMe 6 ай бұрын
Of course!
@sohelahmed3415
@sohelahmed3415 Жыл бұрын
What is you vscode theme?
@hermannmohou6620
@hermannmohou6620 2 жыл бұрын
Dear Amy excuse me but i across a issue during i play my audio on the website audio don't play but when i quit on my website audio is play i need to your help thank you
@SelfTeachMe
@SelfTeachMe 2 жыл бұрын
Hmm... I'm not sure what's causing the problem. I'd need more information to troubleshoot.
@hermannmohou6620
@hermannmohou6620 2 жыл бұрын
@@SelfTeachMe i want play many audio in my website but it play same audio
@hermannmohou6620
@hermannmohou6620 2 жыл бұрын
I was able to solve the problem of the message that I had brought to you but it turns out that I would like to know, if with this functionality it is possible to play several different audio? case I am confronted with this problem I cannot play several audios case when I launch an audio the two mp3s which I have on my web page play the same song without although I have to click on the second
@hermannmohou6620
@hermannmohou6620 2 жыл бұрын
sorry for the inconvenience that I am afflicting you
@charlie-george
@charlie-george 3 жыл бұрын
Hey Amy, so do you work at Zeal?
@charlie-george
@charlie-george 3 жыл бұрын
Aha, right, I see it says your channel is a Zeal show so you must be! Such a coincidence as I have bookmarked the Zeal website because I am trying to figure out how to get video to autoplay in Safari. I am in my second year as an apprentice web developer and love experimenting but still haven't cracked how you've got the video to play on your banner and it's driving me crazy haha.
@SelfTeachMe
@SelfTeachMe 3 жыл бұрын
Yes! I do work at ZEAL! So our website was made in Webflow, which is a no code solution. So they have their own background video widget you can drop on a page. I’ve built several sites though that have background video so maybe I can help. Does your video have audio? Some browsers won’t allow auto play with audio. Do you have a URL or GitHub repo? I’m happy to take a look at the code.
@charlie-george
@charlie-george 3 жыл бұрын
@@SelfTeachMe Oh wow, thank you Amy, that would be super! I know about the audio thing, it's just the autoplay feature I am trying to get to work and it seems like Safari is the only one which doesn't like it. I don't have a Git repo at the moment but will make one ASAP and let you know once it's up. Thank you so much!
@SelfTeachMe
@SelfTeachMe 3 жыл бұрын
@@charlie-george awesome! I’ll keep an eye out for it.
@charlie-george
@charlie-george 3 жыл бұрын
I haven't looked at this for a few weeks so have forgotten where I'm at with it. Just loading it again on my portfolio, it isn't actually working on Chrome either! charlie-george.com
@rafaellucas7639
@rafaellucas7639 2 жыл бұрын
KD a alteração de áudio?????
@ambroiseadanledji6158
@ambroiseadanledji6158 Жыл бұрын
How to run an mp3 with react ?
Debugging Inside VS Code
17:34
Self Teach Me
Рет қаралды 3,9 М.
Do you have a friend like this? 🤣#shorts
00:12
dednahype
Рет қаралды 25 МЛН
Зу-зу Күлпәш. Стоп. (1-бөлім)
52:33
ASTANATV Movie
Рет қаралды 1,2 МЛН
CAN YOU HELP ME? (ROAD TO 100 MLN!) #shorts
00:26
PANDA BOI
Рет қаралды 23 МЛН
Делаем аудиоплеер HTML / SCSS / JS. #javascript
43:32
Давай Попробуем: JavaScript
Рет қаралды 27 М.
Creating Time Jumps for our Custom Audio Player in React
12:41
Self Teach Me
Рет қаралды 1,8 М.
10 React Hooks Explained // Plus Build your own from Scratch
13:15
Fireship
Рет қаралды 1,3 МЛН
Intro - Master the Full-Stack: RedwoodJS Step-by-Step Guide
2:42
Self Teach Me
Рет қаралды 1,6 М.
Maximize Efficiency: Building Faster with Redwood's Generators
10:06
Вопросы на собеседовании Реакт 1/10
12:06
Custom Hooks in React
24:20
Self Teach Me
Рет қаралды 2,3 М.
React Dnd Kit - Drag and Drop en React
26:01
Fazt Code
Рет қаралды 20 М.
Playing Sounds in Your React App | Tutorial
2:43
Niklas Ziermann
Рет қаралды 24 М.
Power up all cell phones.
0:17
JL FUNNY SHORTS
Рет қаралды 45 МЛН
What’s your charging level??
0:14
Татьяна Дука
Рет қаралды 6 МЛН
Приехала Большая Коробка от Anker! А Внутри...
20:09
РасПаковка ДваПаковка
Рет қаралды 82 М.
Introducing GPT-4o
26:13
OpenAI
Рет қаралды 4,3 МЛН
IPad Pro fix screen
1:01
Tamar DB (mt)
Рет қаралды 4,4 МЛН