【发布时间】:2017-01-25 14:37:42
【问题描述】:
我在我的应用程序中使用 react-redux。我有一个播放器,我用 rangesliderplugin 来做 videojs。我有一个动作创建器,当我在视频时间轴中滑动滑块时应该会触发它。在https://github.com/danielcebrian/rangeslider-videojs 上提供了一个插件。我想从此事件函数向我的操作传递一个值。这是我的代码
newMarkerTime 是我的行动
class PlayerLogic extends Component {
constructor() {
super();
this.state = {
player: {}
};
}
componentDidMount() {
var self = this;
var options ={hidden:false};
var player = videojs(this.refs.video, this.props.options).ready(function () {
self.player = this;
self.player.on('play', self.handlePlay);
});
player.rangeslider(options);
player.on("sliderchange",function() {
values = player.getValueSlider();
this.props.newMarkerTime(values);
});
当我滑动滑块时会出现这样的错误。
【问题讨论】:
标签: javascript reactjs react-redux video.js rangeslider