2018-06-11 08:41:25 +02:00
|
|
|
import { connect } from 'react-redux';
|
2019-08-02 08:28:14 +02:00
|
|
|
import {
|
|
|
|
makeSelectClaimForUri,
|
|
|
|
makeSelectThumbnailForUri,
|
|
|
|
makeSelectContentTypeForUri,
|
|
|
|
makeSelectDownloadPathForUri,
|
2020-05-21 17:38:28 +02:00
|
|
|
makeSelectStreamingUrlForUri,
|
2020-07-10 23:04:36 +02:00
|
|
|
SETTINGS,
|
2019-08-02 08:28:14 +02:00
|
|
|
} from 'lbry-redux';
|
2018-06-11 08:41:25 +02:00
|
|
|
import { makeSelectClientSetting } from 'redux/selectors/settings';
|
2020-05-21 17:38:28 +02:00
|
|
|
import { makeSelectFileRenderModeForUri, makeSelectFileExtensionForUri } from 'redux/selectors/content';
|
2018-06-11 08:41:25 +02:00
|
|
|
import FileRender from './view';
|
|
|
|
|
2020-01-31 16:46:50 +01:00
|
|
|
const select = (state, props) => {
|
2021-09-02 22:05:32 +02:00
|
|
|
const autoplay = props.embedded ? false : makeSelectClientSetting(SETTINGS.AUTOPLAY_MEDIA)(state);
|
2020-01-31 16:46:50 +01:00
|
|
|
return {
|
|
|
|
currentTheme: makeSelectClientSetting(SETTINGS.THEME)(state),
|
|
|
|
claim: makeSelectClaimForUri(props.uri)(state),
|
|
|
|
thumbnail: makeSelectThumbnailForUri(props.uri)(state),
|
|
|
|
contentType: makeSelectContentTypeForUri(props.uri)(state),
|
|
|
|
downloadPath: makeSelectDownloadPathForUri(props.uri)(state),
|
2020-04-01 20:43:50 +02:00
|
|
|
fileExtension: makeSelectFileExtensionForUri(props.uri)(state),
|
2020-05-21 17:38:28 +02:00
|
|
|
streamingUrl: makeSelectStreamingUrlForUri(props.uri)(state),
|
2020-04-01 20:43:50 +02:00
|
|
|
renderMode: makeSelectFileRenderModeForUri(props.uri)(state),
|
2020-01-31 16:46:50 +01:00
|
|
|
autoplay: autoplay,
|
|
|
|
};
|
|
|
|
};
|
2018-06-11 08:41:25 +02:00
|
|
|
|
2021-02-17 15:44:37 +01:00
|
|
|
export default connect(select)(FileRender);
|