Skip to content

Cannot read property 'setVolume' of undefined #1074

Closed
@ehsantekgenisys

Description

@ehsantekgenisys

Be sure to search for your issue before opening a new one.

Current Behavior

I am trying to Progrematicaly pass volume to React-player. As soon as the value of volume changes React-player throws the following error
Cannot read property 'setVolume' of undefined

Expected Behavior

It should set the volume to the react-player whenever the value of volume changes.

Other Information

I am passing currentVolume from parent.

const volume = typeof currentVolume !== 'undefined' ? currentVolume : 1;
return


<ReactPlayer
ref={player}
className="video-wrapper"
onReady={() => setIsReady(true)}
playing={shouldPlay && nodeInRange}
playsinline
onPause={onPause}
stopOnUnmount={false}
onPlay={onPlay}
volume={volume}
/>

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @ehsantekgenisys

        Issue actions

          Cannot read property 'setVolume' of undefined · Issue #1074 · cookpete/react-player