2017-12-21 18:08:54 -03:00
|
|
|
import { connect } from 'react-redux';
|
2019-08-02 02:28:14 -04:00
|
|
|
import { doPlayUri } from 'redux/actions/content';
|
2017-05-14 23:50:59 -04:00
|
|
|
import {
|
|
|
|
makeSelectFileInfoForUri,
|
2019-04-24 10:02:08 -04:00
|
|
|
makeSelectThumbnailForUri,
|
2019-08-02 02:28:14 -04:00
|
|
|
makeSelectStreamingUrlForUri,
|
|
|
|
makeSelectMediaTypeForUri,
|
|
|
|
makeSelectUriIsStreamable,
|
2018-04-18 00:03:01 -04:00
|
|
|
} from 'lbry-redux';
|
2019-08-02 02:28:14 -04:00
|
|
|
import { makeSelectIsPlaying, makeSelectShouldObscurePreview } from 'redux/selectors/content';
|
2018-07-09 21:32:59 -06:00
|
|
|
import FileViewer from './view';
|
2017-05-14 23:50:59 -04:00
|
|
|
|
2017-09-07 23:15:05 -04:00
|
|
|
const select = (state, props) => ({
|
2019-04-24 10:02:08 -04:00
|
|
|
thumbnail: makeSelectThumbnailForUri(props.uri)(state),
|
2019-08-02 02:28:14 -04:00
|
|
|
mediaType: makeSelectMediaTypeForUri(props.uri)(state),
|
|
|
|
fileInfo: makeSelectFileInfoForUri(props.uri)(state),
|
|
|
|
obscurePreview: makeSelectShouldObscurePreview(props.uri)(state),
|
|
|
|
isPlaying: makeSelectIsPlaying(props.uri)(state),
|
|
|
|
streamingUrl: makeSelectStreamingUrlForUri(props.uri)(state),
|
|
|
|
isStreamable: makeSelectUriIsStreamable(props.uri)(state),
|
2017-09-07 23:15:05 -04:00
|
|
|
});
|
2017-04-23 16:56:50 +07:00
|
|
|
|
2017-06-05 21:21:55 -07:00
|
|
|
const perform = dispatch => ({
|
2019-08-02 17:03:26 -04:00
|
|
|
play: uri => dispatch(doPlayUri(uri)),
|
2017-06-05 21:21:55 -07:00
|
|
|
});
|
2017-04-23 16:56:50 +07:00
|
|
|
|
2018-07-09 21:32:59 -06:00
|
|
|
export default connect(
|
|
|
|
select,
|
|
|
|
perform
|
|
|
|
)(FileViewer);
|