lbry-desktop/ui/component/fileRenderInline/index.js
infinite-persistence f0d0992d20 Fix broken video embed
## Issue
Closes 5811: Video-embed in markdown-post is broken

- Revert "Fix 'makeSelectIsPlaying' to look at 'playing' instead of 'primary'." dabdc980a1.
- Revert "Fix 'isPlaying' to reflect 'playing' instead of 'primary' URI" 351890decf.

Reverting means "Deleting MD from downloads list causes spinning icon to run forever 4959" gets re-opened, but this is a way less severe issue to leave in.
2021-04-02 14:44:22 -04:00

22 lines
967 B
JavaScript

import { connect } from 'react-redux';
import { makeSelectFileInfoForUri, makeSelectStreamingUrlForUri } from 'lbry-redux';
import { doClaimEligiblePurchaseRewards } from 'redux/actions/rewards';
import { makeSelectFileRenderModeForUri, selectPrimaryUri } from 'redux/selectors/content';
import { withRouter } from 'react-router';
import { doAnalyticsView } from 'redux/actions/app';
import FileRenderInline from './view';
const select = (state, props) => ({
fileInfo: makeSelectFileInfoForUri(props.uri)(state),
isPlaying: selectPrimaryUri(state) === props.uri,
streamingUrl: makeSelectStreamingUrlForUri(props.uri)(state),
renderMode: makeSelectFileRenderModeForUri(props.uri)(state),
});
const perform = (dispatch) => ({
triggerAnalyticsView: (uri, timeToStart) => dispatch(doAnalyticsView(uri, timeToStart)),
claimRewards: () => dispatch(doClaimEligiblePurchaseRewards()),
});
export default withRouter(connect(select, perform)(FileRenderInline));