Fix floating player issues #7073

Merged
saltrafael merged 4 commits from fix-floating into master 2021-09-13 17:24:36 +02:00
2 changed files with 5 additions and 10 deletions
Showing only changes of commit 903a7c8afd - Show all commits

View file

@ -4,7 +4,6 @@ import {
makeSelectFileInfoForUri,
makeSelectThumbnailForUri,
makeSelectClaimForUri,
makeSelectStreamingUrlForUri,
makeSelectClaimWasPurchased,
SETTINGS,
COLLECTIONS_CONSTS,
@ -16,7 +15,6 @@ import { withRouter } from 'react-router';
import {
makeSelectIsPlaying,
makeSelectShouldObscurePreview,
selectPlayingUri,
makeSelectInsufficientCreditsForUri,
makeSelectFileRenderModeForUri,
} from 'redux/selectors/content';
@ -33,9 +31,7 @@ const select = (state, props) => {
fileInfo: makeSelectFileInfoForUri(props.uri)(state),
obscurePreview: makeSelectShouldObscurePreview(props.uri)(state),
isPlaying: makeSelectIsPlaying(props.uri)(state),
playingUri: selectPlayingUri(state),
insufficientCredits: makeSelectInsufficientCreditsForUri(props.uri)(state),
streamingUrl: makeSelectStreamingUrlForUri(props.uri)(state),
autoplay: makeSelectClientSetting(SETTINGS.AUTOPLAY_MEDIA)(state),
costInfo: makeSelectCostInfoForUri(props.uri)(state),
renderMode: makeSelectFileRenderModeForUri(props.uri)(state),
@ -47,9 +43,9 @@ const select = (state, props) => {
};
const perform = (dispatch) => ({
play: (uri, collectionId) => {
play: (uri, collectionId, isPlayable) => {
dispatch(doSetPrimaryUri(uri));
dispatch(doSetPlayingUri({ uri, collectionId }));
if (isPlayable) dispatch(doSetPlayingUri({ uri, collectionId }));
dispatch(doPlayUri(uri, undefined, undefined, (fileInfo) => dispatch(doAnaltyicsPurchaseEvent(fileInfo))));
},
});

View file

@ -16,8 +16,7 @@ import Nag from 'component/common/nag';
import FileRenderPlaceholder from 'static/img/fileRenderPlaceholder.png';
type Props = {
play: (string, string) => void,
isLoading: boolean,
play: (string, string, boolean) => void,
isPlaying: boolean,
fileInfo: FileListItem,
uri: string,
@ -104,9 +103,9 @@ export default function FileRenderInitiator(props: Props) {
e.stopPropagation();
}
play(uri, collectionId);
play(uri, collectionId, isPlayable);
},
[play, uri, collectionId]
[play, uri, isPlayable, collectionId]
);
useEffect(() => {