2020-01-27 19:52:25 +01:00
|
|
|
import { connect } from 'react-redux';
|
2020-07-10 23:04:36 +02:00
|
|
|
import { makeSelectClaimForUri, SETTINGS } from 'lbry-redux';
|
2020-04-16 23:43:09 +02:00
|
|
|
import { withRouter } from 'react-router';
|
2020-04-14 01:48:11 +02:00
|
|
|
import { makeSelectIsPlayerFloating, makeSelectNextUnplayedRecommended } from 'redux/selectors/content';
|
2020-01-27 19:52:25 +01:00
|
|
|
import { makeSelectClientSetting } from 'redux/selectors/settings';
|
2020-05-26 19:11:01 +02:00
|
|
|
import { doSetPlayingUri, doPlayUri } from 'redux/actions/content';
|
2020-04-14 01:48:11 +02:00
|
|
|
import AutoplayCountdown from './view';
|
2020-06-22 10:34:39 +02:00
|
|
|
import { selectModal } from 'redux/selectors/app';
|
2020-01-27 19:52:25 +01:00
|
|
|
|
2020-04-16 23:43:09 +02:00
|
|
|
/*
|
|
|
|
AutoplayCountdown does not fetch it's own next content to play, it relies on <RecommendedContent> being rendered. This is dumb but I'm just the guy who noticed
|
|
|
|
*/
|
2020-01-27 19:52:25 +01:00
|
|
|
const select = (state, props) => {
|
|
|
|
const nextRecommendedUri = makeSelectNextUnplayedRecommended(props.uri)(state);
|
|
|
|
return {
|
|
|
|
nextRecommendedUri,
|
|
|
|
nextRecommendedClaim: makeSelectClaimForUri(nextRecommendedUri)(state),
|
2020-04-14 01:48:11 +02:00
|
|
|
isFloating: makeSelectIsPlayerFloating(props.location)(state),
|
2020-01-27 19:52:25 +01:00
|
|
|
autoplay: makeSelectClientSetting(SETTINGS.AUTOPLAY)(state),
|
2020-06-22 10:34:39 +02:00
|
|
|
modal: selectModal(state),
|
2020-01-27 19:52:25 +01:00
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2020-05-26 19:11:01 +02:00
|
|
|
export default withRouter(
|
|
|
|
connect(select, {
|
|
|
|
doSetPlayingUri,
|
|
|
|
doPlayUri,
|
|
|
|
})(AutoplayCountdown)
|
|
|
|
);
|