나는 반응하는 응용 프로그램을 만들고 있습니다. 내 렌더링 함수에서 함수를 호출하려고합니다. 내가 호출하는 함수는 getChild 메서드를 사용합니다. "정의되지 않은"getChild "속성을 읽을 수 없습니다"라는 오류가 나타납니다. 렌더링 메서드에서 호출하지 않으면 제대로 작동합니다. 내가정의되지 않은 "getChild"속성을 읽을 수 없습니다.
handlePlay() {
//this.props.playButtonClickedActio
console.log("handle play ")
console.log("hii" + player.getChild('ControlBar').getChild('ProgressControl').currentWidth())
}
render() {
if (this.props.sentance_selected_reducer.flag) {
this.handlePlay();
}
플레이어가 componentDidMount
this.video = player = videojs(this.video_el, options).ready(function() {
self.player = this;
self.player.on('play', that.handlePlay);
});
플레이어의 가치는 무엇입니까? 어디에서 정의 했습니까? –
'player.getChild (...)'는'undefined'를 반환하고 반대로 객체를 반환해야합니다. – Teemu
@ishwarrimal 내 업데이트를 참조하십시오. – ApurvG