From 192e1d4923dac706e314b1ccf0c094c67959b7f5 Mon Sep 17 00:00:00 2001 From: Rafael Date: Wed, 23 Mar 2022 15:24:16 -0300 Subject: [PATCH] Prevent floating player on geoblock --- ui/component/fileRenderFloating/index.js | 8 +++++++- ui/component/fileRenderFloating/view.jsx | 3 +++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/ui/component/fileRenderFloating/index.js b/ui/component/fileRenderFloating/index.js index 1bbb7a851..2e119d9d7 100644 --- a/ui/component/fileRenderFloating/index.js +++ b/ui/component/fileRenderFloating/index.js @@ -1,5 +1,10 @@ import { connect } from 'react-redux'; -import { selectClaimForUri, selectTitleForUri, makeSelectClaimWasPurchased } from 'redux/selectors/claims'; +import { + selectClaimForUri, + selectTitleForUri, + makeSelectClaimWasPurchased, + selectGeoRestrictionForUri, +} from 'redux/selectors/claims'; import { makeSelectStreamingUrlForUri } from 'redux/selectors/file_info'; import { makeSelectNextUrlForCollectionAndUrl, @@ -55,6 +60,7 @@ const select = (state, props) => { mobilePlayerDimensions: selectMobilePlayerDimensions(state), socketConnected: selectCommentSocketConnected(state), isLivestreamClaim: isStreamPlaceholderClaim(claim), + geoRestriction: selectGeoRestrictionForUri(state, uri), }; }; diff --git a/ui/component/fileRenderFloating/view.jsx b/ui/component/fileRenderFloating/view.jsx index 729a527ed..059607b55 100644 --- a/ui/component/fileRenderFloating/view.jsx +++ b/ui/component/fileRenderFloating/view.jsx @@ -58,6 +58,7 @@ type Props = { mobilePlayerDimensions?: any, socketConnected: boolean, isLivestreamClaim: boolean, + geoRestriction: ?GeoRestriction, doSetMobilePlayerDimensions: ({ height?: ?number, width?: ?number }) => void, doCommentSocketConnect: (string, string, string) => void, doCommentSocketDisconnect: (string, string) => void, @@ -88,6 +89,7 @@ export default function FileRenderFloating(props: Props) { doSetPlayingUri, isCurrentClaimLive, mobilePlayerDimensions, + geoRestriction, doSetMobilePlayerDimensions, doCommentSocketConnect, doCommentSocketDisconnect, @@ -271,6 +273,7 @@ export default function FileRenderFloating(props: Props) { }, [doSetMobilePlayerDimensions, doSetPlayingUri, isFloating, isMobile]); if ( + geoRestriction || !isPlayable || !uri || (isFloating && noFloatingPlayer) ||