From 93c28b24bb5c7448dbc59f5967ef33c28366a008 Mon Sep 17 00:00:00 2001 From: infinite-persistence Date: Mon, 15 Nov 2021 09:25:58 +0800 Subject: [PATCH] Remove desktop video start time analytics --- ui/component/fileRender/view.jsx | 21 ++------------------- ui/component/fileRenderFloating/view.jsx | 21 +-------------------- ui/component/viewers/videoViewer/view.jsx | 13 ------------- 3 files changed, 3 insertions(+), 52 deletions(-) diff --git a/ui/component/fileRender/view.jsx b/ui/component/fileRender/view.jsx index 64ad93cbf..a3f55a55f 100644 --- a/ui/component/fileRender/view.jsx +++ b/ui/component/fileRender/view.jsx @@ -36,7 +36,6 @@ type Props = { autoplay: boolean, renderMode: string, thumbnail: string, - desktopPlayStartTime?: number, className?: string, }; @@ -70,29 +69,13 @@ class FileRender extends React.PureComponent { } renderViewer() { - const { - currentTheme, - contentType, - downloadPath, - fileExtension, - streamingUrl, - uri, - renderMode, - desktopPlayStartTime, - } = this.props; + const { currentTheme, contentType, downloadPath, fileExtension, streamingUrl, uri, renderMode } = this.props; const source = streamingUrl; switch (renderMode) { case RENDER_MODES.AUDIO: case RENDER_MODES.VIDEO: - return ( - - ); + return ; case RENDER_MODES.IMAGE: return ( diff --git a/ui/component/fileRenderFloating/view.jsx b/ui/component/fileRenderFloating/view.jsx index 619546d36..2b67d0efa 100644 --- a/ui/component/fileRenderFloating/view.jsx +++ b/ui/component/fileRenderFloating/view.jsx @@ -76,7 +76,6 @@ export default function FileRenderFloating(props: Props) { const mainFilePlaying = !isFloating && primaryUri && isURIEqual(uri, primaryUri); const [fileViewerRect, setFileViewerRect] = useState(); - const [desktopPlayStartTime, setDesktopPlayStartTime] = useState(); const [wasDragging, setWasDragging] = useState(false); const [doNavigate, setDoNavigate] = useState(false); const [playNextUrl, setPlayNextUrl] = useState(true); @@ -234,18 +233,6 @@ export default function FileRenderFloating(props: Props) { }; }, [handleResize]); - useEffect(() => { - // @if TARGET='app' - setDesktopPlayStartTime(Date.now()); - // @endif - - return () => { - // @if TARGET='app' - setDesktopPlayStartTime(undefined); - // @endif - }; - }, [uri]); - useEffect(() => { if (isFloating) { doFetchRecommendedContent(uri, mature); @@ -366,13 +353,7 @@ export default function FileRenderFloating(props: Props) { )} {isReadyToPlay ? ( - + ) : ( <> {collectionId && !canViewFile ? ( diff --git a/ui/component/viewers/videoViewer/view.jsx b/ui/component/viewers/videoViewer/view.jsx index 7f940ffa6..3e43616e6 100644 --- a/ui/component/viewers/videoViewer/view.jsx +++ b/ui/component/viewers/videoViewer/view.jsx @@ -44,7 +44,6 @@ type Props = { uri: string, autoplayNext: boolean, autoplayIfEmbedded: boolean, - desktopPlayStartTime?: number, doAnalyticsView: (string, number) => Promise, doAnalyticsBuffer: (string, any) => void, claimRewards: () => void, @@ -92,7 +91,6 @@ function VideoViewer(props: Props) { claimRewards, savePosition, clearPosition, - desktopPlayStartTime, toggleVideoTheaterMode, toggleAutoplayNext, setVideoPlaybackRate, @@ -171,14 +169,6 @@ function VideoViewer(props: Props) { // how long until the video starts 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); // convert bytes to bits, and then divide by seconds @@ -323,9 +313,6 @@ function VideoViewer(props: Props) { } const playerReadyDependencyList = [uri, adUrl, embedded, autoplayIfEmbedded]; - if (!IS_WEB) { - playerReadyDependencyList.push(desktopPlayStartTime); - } const doPlayNext = () => { setPlayNextUrl(true);