Skip to content

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

@MwSpaceLLC

Description

@MwSpaceLLC

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>;
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions