2019-08-02 08:28:14 +02:00
|
|
|
import { connect } from 'react-redux';
|
2020-01-22 18:19:49 +01:00
|
|
|
import { makeSelectClaimForUri, makeSelectFileInfoForUri, makeSelectThumbnailForUri } from 'lbry-redux';
|
2019-08-02 08:28:14 +02:00
|
|
|
import { doChangeVolume, doChangeMute } from 'redux/actions/app';
|
|
|
|
import { selectVolume, selectMute } from 'redux/selectors/app';
|
2019-09-06 02:26:03 +02:00
|
|
|
import { savePosition, doSetPlayingUri } from 'redux/actions/content';
|
2019-08-02 08:28:14 +02:00
|
|
|
import { makeSelectContentPositionForUri } from 'redux/selectors/content';
|
|
|
|
import VideoViewer from './view';
|
|
|
|
|
|
|
|
const select = (state, props) => ({
|
|
|
|
volume: selectVolume(state),
|
|
|
|
position: makeSelectContentPositionForUri(props.uri)(state),
|
|
|
|
muted: selectMute(state),
|
2019-08-13 07:35:13 +02:00
|
|
|
hasFileInfo: Boolean(makeSelectFileInfoForUri(props.uri)(state)),
|
2019-11-28 09:14:07 +01:00
|
|
|
thumbnail: makeSelectThumbnailForUri(props.uri)(state),
|
2020-01-22 18:19:49 +01:00
|
|
|
claim: makeSelectClaimForUri(props.uri)(state),
|
2019-08-02 08:28:14 +02:00
|
|
|
});
|
|
|
|
|
|
|
|
const perform = dispatch => ({
|
|
|
|
changeVolume: volume => dispatch(doChangeVolume(volume)),
|
2019-08-13 07:35:13 +02:00
|
|
|
savePosition: (uri, position) => dispatch(savePosition(uri, position)),
|
2019-08-02 08:28:14 +02:00
|
|
|
changeMute: muted => dispatch(doChangeMute(muted)),
|
2019-09-06 02:26:03 +02:00
|
|
|
setPlayingUri: uri => dispatch(doSetPlayingUri(uri)),
|
2019-08-02 08:28:14 +02:00
|
|
|
});
|
|
|
|
|
|
|
|
export default connect(
|
|
|
|
select,
|
|
|
|
perform
|
|
|
|
)(VideoViewer);
|