简体   繁体   中英

Next.Js : Change page without stop the audio

I'm new at ReactJS and now i'm using Next.js. Well, my project has a audio player at header. When site is load this audio player start automatically. And when I change the page the header statements are not change but music start over again. I try higher order component and shallow but these are not work.

So, how can add a player to header and the player wont start over when the page is change.

This feature will be available from the v5.

Take a look at this pull request 3552 and this thread 88 .

After researching lots days, I solved similar problem with this:

https://nextjs.org/docs/basic-features/layouts

Just make a HOC wrapped the whole _app and set what you want to do in the HOC.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM