8c3e376873
- Biggest change: Moved mobile player logic outside of fileRenderFloating into its own component fileRenderMobile, since there is no need for all that extra resizing and dragging code (for now, as mobile doesn't have a floating player) - Moved player to the header height - Removed rounded borders and margins
48 lines
1.9 KiB
JavaScript
48 lines
1.9 KiB
JavaScript
import { connect } from 'react-redux';
|
|
import { doUriInitiatePlay, doSetPlayingUri } from 'redux/actions/content';
|
|
import { selectThumbnailForUri, selectClaimForUri, makeSelectClaimWasPurchased } from 'redux/selectors/claims';
|
|
import { makeSelectFileInfoForUri } from 'redux/selectors/file_info';
|
|
import * as SETTINGS from 'constants/settings';
|
|
import { selectCostInfoForUri } from 'lbryinc';
|
|
import { selectUserVerifiedEmail } from 'redux/selectors/user';
|
|
import { selectClientSetting } from 'redux/selectors/settings';
|
|
import { withRouter } from 'react-router';
|
|
import {
|
|
makeSelectIsPlaying,
|
|
selectShouldObscurePreviewForUri,
|
|
selectInsufficientCreditsForUri,
|
|
makeSelectFileRenderModeForUri,
|
|
} from 'redux/selectors/content';
|
|
import FileRenderInitiator from './view';
|
|
import { getChannelIdFromClaim } from 'util/claim';
|
|
import { selectActiveLivestreamForChannel } from 'redux/selectors/livestream';
|
|
|
|
const select = (state, props) => {
|
|
const { uri } = props;
|
|
|
|
const claim = selectClaimForUri(state, uri);
|
|
const claimId = claim && claim.claim_id;
|
|
const channelClaimId = claim && getChannelIdFromClaim(claim);
|
|
|
|
return {
|
|
claimThumbnail: selectThumbnailForUri(state, uri),
|
|
fileInfo: makeSelectFileInfoForUri(uri)(state),
|
|
obscurePreview: selectShouldObscurePreviewForUri(state, uri),
|
|
isPlaying: makeSelectIsPlaying(uri)(state),
|
|
insufficientCredits: selectInsufficientCreditsForUri(state, uri),
|
|
autoplay: selectClientSetting(state, SETTINGS.AUTOPLAY_MEDIA),
|
|
costInfo: selectCostInfoForUri(state, uri),
|
|
renderMode: makeSelectFileRenderModeForUri(uri)(state),
|
|
claimWasPurchased: makeSelectClaimWasPurchased(uri)(state),
|
|
authenticated: selectUserVerifiedEmail(state),
|
|
activeLivestreamForChannel: channelClaimId && selectActiveLivestreamForChannel(state, channelClaimId),
|
|
claimId,
|
|
};
|
|
};
|
|
|
|
const perform = {
|
|
doUriInitiatePlay,
|
|
doSetPlayingUri,
|
|
};
|
|
|
|
export default withRouter(connect(select, perform)(FileRenderInitiator));
|