Report recsys info when 'share_data_usage' is enabled.
Previous: ~~Although it was collecting info for all platforms, the data is only sent for Odysee.~~ Correction: it became enabled for all platform after `master` became Odysee. New: Only send out the telemetry for `IS_WEB` or if there's user consent.
This commit is contained in:
parent
34368760de
commit
1d6101ddd2
3 changed files with 13 additions and 6 deletions
|
@ -7,7 +7,7 @@ import { makeSelectContentPositionForUri } from 'redux/selectors/content';
|
||||||
import VideoViewer from './view';
|
import VideoViewer from './view';
|
||||||
import { withRouter } from 'react-router';
|
import { withRouter } from 'react-router';
|
||||||
import { doClaimEligiblePurchaseRewards } from 'redux/actions/rewards';
|
import { doClaimEligiblePurchaseRewards } from 'redux/actions/rewards';
|
||||||
import { makeSelectClientSetting, selectHomepageData } from 'redux/selectors/settings';
|
import { selectDaemonSettings, makeSelectClientSetting, selectHomepageData } from 'redux/selectors/settings';
|
||||||
import { toggleVideoTheaterMode, doSetClientSetting } from 'redux/actions/settings';
|
import { toggleVideoTheaterMode, doSetClientSetting } from 'redux/actions/settings';
|
||||||
import { selectUserVerifiedEmail, selectUser } from 'redux/selectors/user';
|
import { selectUserVerifiedEmail, selectUser } from 'redux/selectors/user';
|
||||||
|
|
||||||
|
@ -31,6 +31,7 @@ const select = (state, props) => {
|
||||||
homepageData: selectHomepageData(state),
|
homepageData: selectHomepageData(state),
|
||||||
authenticated: selectUserVerifiedEmail(state),
|
authenticated: selectUserVerifiedEmail(state),
|
||||||
userId: userId,
|
userId: userId,
|
||||||
|
shareTelemetry: IS_WEB || selectDaemonSettings(state).share_usage_data,
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -56,6 +56,7 @@ type Props = {
|
||||||
claimId: ?string,
|
claimId: ?string,
|
||||||
userId: ?number,
|
userId: ?number,
|
||||||
allowPreRoll: ?boolean,
|
allowPreRoll: ?boolean,
|
||||||
|
shareTelemetry: boolean,
|
||||||
};
|
};
|
||||||
|
|
||||||
// type VideoJSOptions = {
|
// type VideoJSOptions = {
|
||||||
|
@ -193,6 +194,7 @@ export default React.memo<Props>(function VideoJs(props: Props) {
|
||||||
claimId,
|
claimId,
|
||||||
userId,
|
userId,
|
||||||
// allowPreRoll,
|
// allowPreRoll,
|
||||||
|
shareTelemetry,
|
||||||
} = props;
|
} = props;
|
||||||
|
|
||||||
const [reload, setReload] = useState('initial');
|
const [reload, setReload] = useState('initial');
|
||||||
|
@ -564,11 +566,12 @@ export default React.memo<Props>(function VideoJs(props: Props) {
|
||||||
});
|
});
|
||||||
|
|
||||||
// Add recsys plugin
|
// Add recsys plugin
|
||||||
// TODO: Add an if(odysee.com) around this function to only use recsys on odysee
|
if (shareTelemetry) {
|
||||||
player.recsys({
|
player.recsys({
|
||||||
videoId: claimId,
|
videoId: claimId,
|
||||||
userId: userId,
|
userId: userId,
|
||||||
});
|
});
|
||||||
|
}
|
||||||
|
|
||||||
// set playsinline for mobile
|
// set playsinline for mobile
|
||||||
// TODO: make this better
|
// TODO: make this better
|
||||||
|
|
|
@ -51,6 +51,7 @@ type Props = {
|
||||||
authenticated: boolean,
|
authenticated: boolean,
|
||||||
userId: number,
|
userId: number,
|
||||||
homepageData?: { [string]: HomepageCat },
|
homepageData?: { [string]: HomepageCat },
|
||||||
|
shareTelemetry: boolean,
|
||||||
};
|
};
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -84,6 +85,7 @@ function VideoViewer(props: Props) {
|
||||||
homepageData,
|
homepageData,
|
||||||
authenticated,
|
authenticated,
|
||||||
userId,
|
userId,
|
||||||
|
shareTelemetry,
|
||||||
} = props;
|
} = props;
|
||||||
|
|
||||||
const adApprovedChannelIds = homepageData ? getAllIds(homepageData) : [];
|
const adApprovedChannelIds = homepageData ? getAllIds(homepageData) : [];
|
||||||
|
@ -319,6 +321,7 @@ function VideoViewer(props: Props) {
|
||||||
claimId={claimId}
|
claimId={claimId}
|
||||||
userId={userId}
|
userId={userId}
|
||||||
allowPreRoll={!embedded && !authenticated}
|
allowPreRoll={!embedded && !authenticated}
|
||||||
|
shareTelemetry={shareTelemetry}
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
|
|
Loading…
Add table
Reference in a new issue