Skip to content

When render new src not update? #10

@ghost

Description

When component receive the new link it can't update link.

componentWillReceiveProps(next) {
        let that = this
        this.setState({
            link: next.data.link,
        })
}
render() {
        let atrVideo = {
            "id": "video",
            "type": "application/x-mpegURL",
            "className": "video-js vjs-default-skin",
            "data-setup": '{"preload" : "auto","autoplay" : false,"controls" : true}',
            "src" : {this.state.link}
        }
        return (
            <div className="htmlplayer col-md-12 col-xs-12">
                <div className="player">
                    <Video {...atrVideo}>
                    </Video>
                </div>
            </div>
        )
    }
}

Thx

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

    Issue actions