Skip to content

Issue when using multiple players #18

@jmvallejo

Description

@jmvallejo

Hi, I'm using react-jPlayer for playing various items inside the same page. Basically I want each player to have its own state and I'm giving it an id based on the element that it will be playing, the first time I load the players it works well, but once I go to a different page where additional players are loaded I get an error from mapStateToProps where it's trying to get media from undefined, as if it was trying to access a player id that doesn't exist from the reducer.

Here's the error:
TypeError: Cannot read property 'media' of undefined at Function.mapStateToProps [as mapToProps] (jPlayerContainer.js:36)

image

I'm wrapping the player inside a component that has additional logic for loading the files, but basically I'm initializing with the corresponding id on componentWillMount.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions