Giter Site home page Giter Site logo

Support SSR about useaudioplayer HOT 6 OPEN

E-Kuerschner avatar E-Kuerschner commented on June 11, 2024
Support SSR

from useaudioplayer.

Comments (6)

joeyiny avatar joeyiny commented on June 11, 2024 1

Making progress!

from useaudioplayer.

E-Kuerschner avatar E-Kuerschner commented on June 11, 2024

fork with some work in this direction from @joeyiny

https://github.com/joeyiny/useAudioPlayer/commits/main

from useaudioplayer.

E-Kuerschner avatar E-Kuerschner commented on June 11, 2024

@joeyiny nice! feel free to open up a PR if you'd like to contribute your enhancements. Also FYI v2 dropped today. You'll def want to rebase your fork off of the latest main. Let me know if you have any questions about the migration, but it shouldn't be too too different. The README has been updated with the latest information

from useaudioplayer.

joeyiny avatar joeyiny commented on June 11, 2024

@E-Kuerschner Oh nice, was actually planning on messaging you about v2! Definitely going to hop in first thing tomorrow hopefully.

from useaudioplayer.

codejunkienick avatar codejunkienick commented on June 11, 2024

Currently working approach is to exclude it from SSR with window presence check (using useAudioPlayer@v2)

  const [hasWindow, setHasWindow] = useState(false);
  useEffect(() => {
    if (typeof window !== 'undefined') {
      setHasWindow(true);
    }
  }, []);
  ................
  
        {hasWindow && (
        <TrackPlayer url={url}  />
      )}
................

const TrackPlayer = ({
  audioUrl,
}: {
  audioUrl: string;
}) => {
  const {
    load,
    setVolume,
    togglePlayPause,
    playing,
    getPosition,
    duration,
    seek,
  } = useAudioPlayer();

from useaudioplayer.

YusufcanY avatar YusufcanY commented on June 11, 2024

any example with useGlobalAudioPlayer? Also window presence check didn't work on me. I have issues with first load i guess. autoplay, initialVolume ex. don't work in my Next.js 14 project.

from useaudioplayer.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.