How to Build a Custom Audio Player in React

Поделиться
HTML-код
  • Опубликовано: 12 сен 2024

Комментарии • 215

  • @angelap.8160
    @angelap.8160 3 года назад +13

    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  3 года назад +15

      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 3 года назад +2

      @@SelfTeachMe Thank you for the tip! It worked perfectly!! 🔥

    • @MrSantino3
      @MrSantino3 2 года назад +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 года назад +3

      @@MrSantino3 replace your useEffect with" `const onLoadedMetaData = () =>
      setTotalAudioTime(audioPlayer.current?.duration);`

    • @xhwogusxh
      @xhwogusxh 10 месяцев назад

      @@rassolarThank you!!! you are genius!!

  • @bigboy8860
    @bigboy8860 2 года назад +18

    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 года назад +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

    • @잉브1
      @잉브1 2 года назад

      thank you!!

    • @mayyy4765
      @mayyy4765 2 года назад

      Thank you sir!

  • @c4binfever
    @c4binfever 3 года назад +4

    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 года назад +1

      Good catch! In a follow up video on debugging (ruclips.net/video/64n-M6W0qKE/видео.html), 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 года назад +3

      @@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 года назад +1

      @@c4binfever Glad you got it figured out! ... and glad you found that video helpful!

    • @quem_gabriel
      @quem_gabriel 2 года назад +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!

  • @sohailsaha7427
    @sohailsaha7427 2 года назад +1

    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 года назад +1

      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!

  • @jaymeenjogiya8798
    @jaymeenjogiya8798 3 года назад

    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 года назад +1

      Wow, thanks! Glad that you found it helpful.

  • @codingwithdidem
    @codingwithdidem 2 года назад +3

    Its a 1 hour tutorial and I'm not a tiny bit bored. Loved your attitude! Keep up the great work

  • @JohnBartmannMusic
    @JohnBartmannMusic 2 года назад

    hope this blows up with the podcasting scene. thanks for showing up.

  • @Heffsta02
    @Heffsta02 2 года назад

    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.

  • @brettgamble5720
    @brettgamble5720 2 года назад +2

    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.

  • @alissaa.1289
    @alissaa.1289 3 года назад +5

    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!

  • @jusoul4821
    @jusoul4821 2 года назад

    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!

  • @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!😙

  • @enriqueg4400
    @enriqueg4400 2 года назад

    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!!

  • @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!

  • @italoguajardopenaloza7516
    @italoguajardopenaloza7516 3 года назад

    You saved me with the progress-bar, i had no idea how to make it. You stopped me from producing a tumor from frustration.

  • @klheebang791
    @klheebang791 10 месяцев назад

    I love the way you explain everything. So visual and easy to follow! Thank you!!

    • @SelfTeachMe
      @SelfTeachMe  10 месяцев назад

      Thanks @klheebang791 Appreciate it!

  • @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

  • @sonnycastro6546
    @sonnycastro6546 3 года назад +2

    Amazing tutorial! So good that I subscribed. Look forward to more tutorials like this one. Congrats

    • @SelfTeachMe
      @SelfTeachMe  2 года назад

      Thanks, Sonny! Appreciate that!

  • @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 !

  • @oluseunakintayo3060
    @oluseunakintayo3060 Год назад

    I came across this video at the right time. Thank you!

    • @SelfTeachMe
      @SelfTeachMe  10 месяцев назад

      Yeah! Glad you found it helpful.

  • @raiffemouraa
    @raiffemouraa 8 месяцев назад

    woow, I loved the way you explain everything!
    I´m a new dev from brasil, a huge thanks!

    • @SelfTeachMe
      @SelfTeachMe  7 месяцев назад +1

      Yeahh! So glad you found it helpful!

  • @subodhpareek18
    @subodhpareek18 3 года назад +1

    Great video, wonderful presentation style, production quality, etc too!

  • @Bluepaccao
    @Bluepaccao 3 года назад

    Great tutorial and also great pacing of the editing. Made it very interesting to watch!

  • @additionaddict5524
    @additionaddict5524 3 года назад +3

    Right at the end it should be,
    Number(progressBar.current.value) + 30
    not
    Number(progressBar.current.value + 30)

    • @SelfTeachMe
      @SelfTeachMe  3 года назад +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.

  • @JohnBartmannMusic
    @JohnBartmannMusic 2 года назад

    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

  • @rockyessel
    @rockyessel Год назад

    Aww my heart. i think I'm in love with your teaching style

  • @teachercarlosmayo1215
    @teachercarlosmayo1215 2 года назад +1

    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 3 года назад +1

    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  3 года назад

      🙌🏻 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!

  • @_its_omg
    @_its_omg 3 года назад +4

    Just have to tell one thing: Amazing 🔥🔥🔥🔥

  • @JamesQQuick
    @JamesQQuick 3 года назад +1

    So dope!!

  • @joseromarybrandao
    @joseromarybrandao Год назад

    The Best Tutorial ever! Congratulations! +1 subscriber!

  • @naiadbaksh3996
    @naiadbaksh3996 2 года назад +1

    Unreal tutorial!

  • @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!

  • @MrPahne1
    @MrPahne1 2 года назад

    Don't normally comment but this was excellent, super educational and clear!

  • @Djinn667
    @Djinn667 2 года назад +1

    If you are using an mp3 file in your project folder, you must first write the import statement at the top.

  • @civilization_tfgonz
    @civilization_tfgonz 2 года назад +1

    Man, you are so patient! Thank you so much! Wonderful class!

    • @SelfTeachMe
      @SelfTeachMe  2 года назад +1

      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 года назад +1

      @@civilization_tfgonz thank you for saying that!! That’s exactly why I enjoy creating content

    • @civilization_tfgonz
      @civilization_tfgonz 2 года назад

      @@SelfTeachMe Thank you 🙂

  • @danielagreen5682
    @danielagreen5682 2 года назад +1

    Great tutorial!
    Thanks for publishing!

  • @benarlanda373
    @benarlanda373 6 месяцев назад

    Love this video. Is it possible to add multiple players to different audio files on one main page?

  • @maverick_wolfe
    @maverick_wolfe Год назад

    Works perfectly! Thank you so much! God bless you 🙏

  • @ebatheone9173
    @ebatheone9173 2 года назад +1

    Thank you for the video. Very well explained. I learn a ton :)

  • @skyewild3647
    @skyewild3647 3 года назад +1

    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?

  • @alasassi960
    @alasassi960 2 года назад

    what a good and nice teacher thanks

  • @nikolyovin
    @nikolyovin 2 года назад

    Amy, thank you very much! You really helped me! Hello from Russia

  • @ambroiseadanledji6158
    @ambroiseadanledji6158 2 года назад

    Thank you for this tuto. Amazing !!

  • @pikka8524
    @pikka8524 2 года назад

    Thank you so much! It is very helpful and awsome video ever I watched! 👍

  • @mobs9306
    @mobs9306 2 года назад

    Thank you very much for this learnt a lot!

  • @sagarsiwakoti3517
    @sagarsiwakoti3517 3 года назад +1

    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  3 года назад

      That's a great point. I've made a note to include this feature as a video in the series.

  • @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 Год назад +1

      It is better to use onEnded , onTimeUpdate , and onLoadedData of the audio element instead of useEffect to detect changes in those values

  • @beratgenc7695
    @beratgenc7695 2 года назад

    So so educative, notes taken. Thanks

  • @A_Saban
    @A_Saban 2 года назад

    Thank you! I know this video is from over a year ago, nevertheless it help me a ton!

  • @aubreydigital
    @aubreydigital 2 года назад +1

    id love to know what theme you are using in your vs code! thanks so much for the walk though explanation!

  • @atimy
    @atimy 3 года назад

    Thanks! Explanations are concise and perfect

  • @pamelabengloff975
    @pamelabengloff975 2 года назад

    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.

  • @sammeester3514
    @sammeester3514 3 года назад +1

    Thank you so much Amy, this was great!

  • @user-pb1yu4pw4i
    @user-pb1yu4pw4i 4 месяца назад

    Thanks a lot Amy 🤩

  • @HOSS11H
    @HOSS11H 2 года назад

    thx for the effort benefited a lot

  • @tausifmuftasinabid3195
    @tausifmuftasinabid3195 Год назад

    it was really helpful thank you ❤❤❤

  • @akash.serene
    @akash.serene 3 года назад +1

    You are just awesome. I Iike the way you teach. It is quite interesting 🙂

  • @litbro8180
    @litbro8180 2 года назад

    Thanks!! Great tutorial

  • @зипермкск
    @зипермкск Год назад

    what kind of camera are you using :D ? its so good

  • @randerins
    @randerins 3 года назад +1

    Amazing content! Thanks a lot!

    • @SelfTeachMe
      @SelfTeachMe  3 года назад

      Thank you! Glad to hear that!

  • @reginasap9104
    @reginasap9104 Год назад

    Thank you very much for your detailed explanation!!! you are awesome and your smile is gorgeous. thank you very much!

    • @SelfTeachMe
      @SelfTeachMe  10 месяцев назад

      Thank you! 😃 Appreciate the kind words!

  • @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

  • @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

  • @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

  • @baturay6219
    @baturay6219 3 года назад

    This is perrrrrrrrrfect! Thank you so much.

  • @aliamorsi6148
    @aliamorsi6148 3 года назад

    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  3 года назад +1

      Thanks for the feedback. There's also a link to the final code in GitHub if you want to review the code further.

  • @mohammadebrahimibaqa6217
    @mohammadebrahimibaqa6217 Год назад +1

    Very Good

  • @jasonruff1270
    @jasonruff1270 2 года назад

    what would the src be of an audio file that is in our project folder?

  • @PaulyWollyUTube
    @PaulyWollyUTube 2 года назад +1

    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.

  • @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 :)

  • @user-ej4fb3nx2v
    @user-ej4fb3nx2v Год назад

    soo gud thanks you for the best content

  • @gajraj_mohini
    @gajraj_mohini 2 года назад

    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

  • @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

  • @girornsveinsson7970
    @girornsveinsson7970 3 года назад +1

    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 3 года назад +2

      I found a very easy solution to this issue by simply adding " step='0.05' " to the input tag.

    • @SelfTeachMe
      @SelfTeachMe  3 года назад

      Awesome! Smart solution!

  • @PeaceMatters5
    @PeaceMatters5 3 года назад +1

    Wow amazing tutorial!!xo

  • @wittespiegel1212
    @wittespiegel1212 8 месяцев назад

    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  7 месяцев назад

      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?

  • @jayjayjaythebrand
    @jayjayjaythebrand 3 года назад

    Tutorial is amazing. Mind me asking what theme you're using in VS code?

    • @SelfTeachMe
      @SelfTeachMe  3 года назад +1

      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.

  • @geniux8048
    @geniux8048 3 года назад +1

    Wonderful

  • @philip9677
    @philip9677 2 года назад

    nice work

  • @aselalymbaeva3798
    @aselalymbaeva3798 Год назад +1

  • @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

  • @sohelahmed3415
    @sohelahmed3415 2 года назад

    What is you vscode theme?

  • @theundergroundsm
    @theundergroundsm 3 года назад

    Amazing, thanks 🙏🏾

  • @krishnakantmodani353
    @krishnakantmodani353 3 года назад +1

    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  3 года назад

      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 3 года назад

      @@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  3 года назад

      @@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.

  • @98naimad
    @98naimad 2 года назад

    I ❤️ YOU!!! THANK YOU!!!

  • @lewiswardita9902
    @lewiswardita9902 3 года назад

    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  3 года назад

      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 3 года назад

      @@SelfTeachMe okay cool 👍😎. Good stuff! Just discovered your channel and really enjoying it

    • @SelfTeachMe
      @SelfTeachMe  3 года назад

      @@lewiswardita9902 Awesome! Glad to hear that.

  • @yanivhe
    @yanivhe 3 года назад +1

    Thank you! :-)

  • @zeckinho_
    @zeckinho_ 2 года назад

    Thank you 🥰

  • @aleksandrmatyka3118
    @aleksandrmatyka3118 3 года назад +1

    Nice!

  • @ambroiseadanledji6158
    @ambroiseadanledji6158 2 года назад

    How to run an mp3 with react ?

  • @franny8480
    @franny8480 2 года назад

    what font family do you use in this video? please answer, for the editor i mean :D

  • @renanmomessovechini
    @renanmomessovechini 11 месяцев назад

    Thanks so much

  • @rafaellucas7639
    @rafaellucas7639 2 года назад

    KD a alteração de áudio?????

  • @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?

  • @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 года назад +1

    Hey Amy, so do you work at Zeal?

    • @charlie-george
      @charlie-george 3 года назад +1

      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 года назад +1

      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 года назад +1

      @@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 года назад +1

      @@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