player icon indicating copy to clipboard operation
player copied to clipboard

Cannot use 'in' operator to search for 'playing' in null

Open MwSpaceLLC opened this issue 4 months ago • 0 comments

Hi there!

Some times, we handle this error, on official configuration: https://vidstack.io/docs/player/api/hooks/use-media-store/

When onload page and player have some errors. (fir es. not download playlist)

import { useRef } from 'react';

import {
  MediaPlayer,
  MediaProvider,
  useMediaStore,
  type MediaPlayerInstance,
} from '@vidstack/react';

function Player() {
  const player = useRef<MediaPlayerInstance>(null);

  const { paused, playing /* ... */ } = useMediaStore(player);

  <MediaPlayer ref={player}>
    <MediaProvider />
    {/* ... */}
  </MediaPlayer>;
}

MwSpaceLLC avatar Sep 13 '25 11:09 MwSpaceLLC