【发布时间】:2022-01-02 21:03:14
【问题描述】:
react-player如何触发停止方法停止和结束视频?这是我的代码:
<ReactPlayer
className="react-player mw-100 w-100 "
id="myPlayer"
ref={(player) => {
this.player = player;
}}
url={VIMEO_URL}
onStart={() => {
this.player.seekTo(this.getProgress());
}}
onPlay={() => this.play(this)}
onPause={() => this.pause()}
onDuration={this.handleDuration}
onProgress={this._recordProgress}
onReady={() => this.player.seekTo(this.getProgress())}
/>;
【问题讨论】:
-
您想停止以编程方式播放视频吗?
-
是的,虽然我想停止视频的外部功能
标签: javascript reactjs react-player