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
44 lines
1.8 KiB
JavaScript
44 lines
1.8 KiB
JavaScript
import { connect } from 'react-redux';
|
|
import { makeSelectClaimWasPurchased, selectClaimForUri } from 'redux/selectors/claims';
|
|
import { makeSelectStreamingUrlForUri } from 'redux/selectors/file_info';
|
|
import {
|
|
makeSelectNextUrlForCollectionAndUrl,
|
|
makeSelectPreviousUrlForCollectionAndUrl,
|
|
} from 'redux/selectors/collections';
|
|
import { selectPlayingUri, makeSelectFileRenderModeForUri } from 'redux/selectors/content';
|
|
import { selectCostInfoForUri } from 'lbryinc';
|
|
import { doPlayUri } from 'redux/actions/content';
|
|
import { withRouter } from 'react-router';
|
|
import { getChannelIdFromClaim } from 'util/claim';
|
|
import { selectActiveLivestreamForChannel } from 'redux/selectors/livestream';
|
|
import FileRenderMobile from './view';
|
|
|
|
const select = (state, props) => {
|
|
const playingUri = selectPlayingUri(state);
|
|
const uri = playingUri && playingUri.uri;
|
|
const collectionId = playingUri && playingUri.collectionId;
|
|
|
|
const claim = selectClaimForUri(state, uri);
|
|
const claimId = claim && claim.claim_id;
|
|
const channelClaimId = claim && getChannelIdFromClaim(claim);
|
|
|
|
return {
|
|
uri,
|
|
streamingUrl: makeSelectStreamingUrlForUri(uri)(state),
|
|
renderMode: makeSelectFileRenderModeForUri(uri)(state),
|
|
costInfo: selectCostInfoForUri(state, uri),
|
|
claimWasPurchased: makeSelectClaimWasPurchased(uri)(state),
|
|
nextListUri: collectionId && makeSelectNextUrlForCollectionAndUrl(collectionId, uri)(state),
|
|
previousListUri: collectionId && makeSelectPreviousUrlForCollectionAndUrl(collectionId, uri)(state),
|
|
collectionId,
|
|
activeLivestreamForChannel: channelClaimId && selectActiveLivestreamForChannel(state, channelClaimId),
|
|
claimId,
|
|
channelClaimId,
|
|
};
|
|
};
|
|
|
|
const perform = {
|
|
doPlayUri,
|
|
};
|
|
|
|
export default withRouter(connect(select, perform)(FileRenderMobile));
|