Remove desktop video start time analytics
This commit is contained in:
parent
c242c37869
commit
93c28b24bb
3 changed files with 3 additions and 52 deletions
|
@ -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<Props> {
|
|||
}
|
||||
|
||||
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 (
|
||||
<VideoViewer
|
||||
uri={uri}
|
||||
source={source}
|
||||
contentType={contentType}
|
||||
desktopPlayStartTime={desktopPlayStartTime}
|
||||
/>
|
||||
);
|
||||
return <VideoViewer uri={uri} source={source} contentType={contentType} />;
|
||||
case RENDER_MODES.IMAGE:
|
||||
return (
|
||||
<React.Suspense fallback={null}>
|
||||
|
|
|
@ -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 ? (
|
||||
<FileRender
|
||||
className="draggable"
|
||||
uri={uri}
|
||||
// @if TARGET='app'
|
||||
desktopPlayStartTime={desktopPlayStartTime}
|
||||
// @endif
|
||||
/>
|
||||
<FileRender className="draggable" uri={uri} />
|
||||
) : (
|
||||
<>
|
||||
{collectionId && !canViewFile ? (
|
||||
|
|
|
@ -44,7 +44,6 @@ type Props = {
|
|||
uri: string,
|
||||
autoplayNext: boolean,
|
||||
autoplayIfEmbedded: boolean,
|
||||
desktopPlayStartTime?: number,
|
||||
doAnalyticsView: (string, number) => Promise<any>,
|
||||
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);
|
||||
|
|
Loading…
Reference in a new issue