Fix Floating Player stopping on certain files

This commit is contained in:
saltrafael 2021-09-13 06:02:41 -03:00
parent bbcdcfe4c1
commit 903a7c8afd
No known key found for this signature in database
GPG key ID: 9C7F1DC0B0F54515
2 changed files with 5 additions and 10 deletions

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(() => {