Remove desktop video start time analytics

This commit is contained in:
infinite-persistence 2021-11-15 09:25:58 +08:00
parent c242c37869
commit 93c28b24bb
3 changed files with 3 additions and 52 deletions

View file

@ -36,7 +36,6 @@ type Props = {
autoplay: boolean, autoplay: boolean,
renderMode: string, renderMode: string,
thumbnail: string, thumbnail: string,
desktopPlayStartTime?: number,
className?: string, className?: string,
}; };
@ -70,29 +69,13 @@ class FileRender extends React.PureComponent<Props> {
} }
renderViewer() { renderViewer() {
const { const { currentTheme, contentType, downloadPath, fileExtension, streamingUrl, uri, renderMode } = this.props;
currentTheme,
contentType,
downloadPath,
fileExtension,
streamingUrl,
uri,
renderMode,
desktopPlayStartTime,
} = this.props;
const source = streamingUrl; const source = streamingUrl;
switch (renderMode) { switch (renderMode) {
case RENDER_MODES.AUDIO: case RENDER_MODES.AUDIO:
case RENDER_MODES.VIDEO: case RENDER_MODES.VIDEO:
return ( return <VideoViewer uri={uri} source={source} contentType={contentType} />;
<VideoViewer
uri={uri}
source={source}
contentType={contentType}
desktopPlayStartTime={desktopPlayStartTime}
/>
);
case RENDER_MODES.IMAGE: case RENDER_MODES.IMAGE:
return ( return (
<React.Suspense fallback={null}> <React.Suspense fallback={null}>

View file

@ -76,7 +76,6 @@ export default function FileRenderFloating(props: Props) {
const mainFilePlaying = !isFloating && primaryUri && isURIEqual(uri, primaryUri); const mainFilePlaying = !isFloating && primaryUri && isURIEqual(uri, primaryUri);
const [fileViewerRect, setFileViewerRect] = useState(); const [fileViewerRect, setFileViewerRect] = useState();
const [desktopPlayStartTime, setDesktopPlayStartTime] = useState();
const [wasDragging, setWasDragging] = useState(false); const [wasDragging, setWasDragging] = useState(false);
const [doNavigate, setDoNavigate] = useState(false); const [doNavigate, setDoNavigate] = useState(false);
const [playNextUrl, setPlayNextUrl] = useState(true); const [playNextUrl, setPlayNextUrl] = useState(true);
@ -234,18 +233,6 @@ export default function FileRenderFloating(props: Props) {
}; };
}, [handleResize]); }, [handleResize]);
useEffect(() => {
// @if TARGET='app'
setDesktopPlayStartTime(Date.now());
// @endif
return () => {
// @if TARGET='app'
setDesktopPlayStartTime(undefined);
// @endif
};
}, [uri]);
useEffect(() => { useEffect(() => {
if (isFloating) { if (isFloating) {
doFetchRecommendedContent(uri, mature); doFetchRecommendedContent(uri, mature);
@ -366,13 +353,7 @@ export default function FileRenderFloating(props: Props) {
)} )}
{isReadyToPlay ? ( {isReadyToPlay ? (
<FileRender <FileRender className="draggable" uri={uri} />
className="draggable"
uri={uri}
// @if TARGET='app'
desktopPlayStartTime={desktopPlayStartTime}
// @endif
/>
) : ( ) : (
<> <>
{collectionId && !canViewFile ? ( {collectionId && !canViewFile ? (

View file

@ -44,7 +44,6 @@ type Props = {
uri: string, uri: string,
autoplayNext: boolean, autoplayNext: boolean,
autoplayIfEmbedded: boolean, autoplayIfEmbedded: boolean,
desktopPlayStartTime?: number,
doAnalyticsView: (string, number) => Promise<any>, doAnalyticsView: (string, number) => Promise<any>,
doAnalyticsBuffer: (string, any) => void, doAnalyticsBuffer: (string, any) => void,
claimRewards: () => void, claimRewards: () => void,
@ -92,7 +91,6 @@ function VideoViewer(props: Props) {
claimRewards, claimRewards,
savePosition, savePosition,
clearPosition, clearPosition,
desktopPlayStartTime,
toggleVideoTheaterMode, toggleVideoTheaterMode,
toggleAutoplayNext, toggleAutoplayNext,
setVideoPlaybackRate, setVideoPlaybackRate,
@ -171,14 +169,6 @@ function VideoViewer(props: Props) {
// how long until the video starts // how long until the video starts
let timeToStartVideo = data.secondsToLoad; let timeToStartVideo = data.secondsToLoad;
// TODO: what's happening here briefly?
if (!IS_WEB) {
if (desktopPlayStartTime !== undefined) {
const differenceToAdd = Date.now() - desktopPlayStartTime;
timeToStartVideo += differenceToAdd;
}
}
analytics.playerVideoStartedEvent(embedded); analytics.playerVideoStartedEvent(embedded);
// convert bytes to bits, and then divide by seconds // convert bytes to bits, and then divide by seconds
@ -323,9 +313,6 @@ function VideoViewer(props: Props) {
} }
const playerReadyDependencyList = [uri, adUrl, embedded, autoplayIfEmbedded]; const playerReadyDependencyList = [uri, adUrl, embedded, autoplayIfEmbedded];
if (!IS_WEB) {
playerReadyDependencyList.push(desktopPlayStartTime);
}
const doPlayNext = () => { const doPlayNext = () => {
setPlayNextUrl(true); setPlayNextUrl(true);