HI!
I got the solution last time, so I wrote the source below
However, the same black screen appears. Is there a solution?
componentDidMount() {
if (this.props && this.props.user.streamManager && !!this.videoRef) {
this.props.user.getStreamManager().addVideoElement(this.videoRef.current);
let playPromise = this.videoRef.current.play();
if (playPromise !== null) {
playPromise.catch(() => { /* discard runtime error */ })
}
}
}
componentDidUpdate(props) {
if (props && !!this.videoRef) {
this.props.user.getStreamManager().addVideoElement(this.videoRef.current);
let playPromise = this.videoRef.current.play();
if (playPromise !== null) {
playPromise.catch(() => { /* discard runtime error */ })
}
}
}
render source
<video
autoPlay={true}
className={${ this.props.user.isScreenShare() ?
screen-fit:
${this.props.user.isMirror == false ? “rotateY0”: “”} }
}
id={‘video-’ + this.props.user.getStreamManager().stream.streamId}
ref={this.videoRef}
muted={this.props.mutedSound}
/>