From 96d9e24a4b19e60faa300fe4f7ff070aef24df8e Mon Sep 17 00:00:00 2001 From: Sean Yesmunt Date: Tue, 5 May 2020 14:02:12 -0400 Subject: [PATCH] fix time to start analytics for desktop and fix rewards link --- static/app-strings.json | 3 ++- ui/component/fileRender/view.jsx | 21 +++++++++++++++++++-- ui/component/fileRenderFloating/view.jsx | 18 +++++++++++++++++- ui/component/inviteNew/view.jsx | 2 +- ui/component/rewardAuthIntro/view.jsx | 1 + ui/component/viewers/videoViewer/view.jsx | 9 ++++++++- 6 files changed, 48 insertions(+), 6 deletions(-) diff --git a/static/app-strings.json b/static/app-strings.json index 04a7ab04e..10caef396 100644 --- a/static/app-strings.json +++ b/static/app-strings.json @@ -1199,5 +1199,6 @@ "For video content, use MP4s in H264/AAC format and a friendly bitrate (under 5 mbps) and resolution (720p) for more reliable streaming.": "For video content, use MP4s in H264/AAC format and a friendly bitrate (under 5 mbps) and resolution (720p) for more reliable streaming.", "this channel": "this channel", "Share this channel": "Share this channel", - "File preview": "File preview" + "File preview": "File preview", + "Go Home": "Go Home" } \ No newline at end of file diff --git a/ui/component/fileRender/view.jsx b/ui/component/fileRender/view.jsx index 177e91aeb..b26dec00a 100644 --- a/ui/component/fileRender/view.jsx +++ b/ui/component/fileRender/view.jsx @@ -32,6 +32,7 @@ type Props = { autoplay: boolean, renderMode: string, thumbnail: string, + desktopPlayStartTime?: number, }; class FileRender extends React.PureComponent { @@ -64,13 +65,29 @@ class FileRender extends React.PureComponent { } renderViewer() { - const { currentTheme, contentType, downloadPath, fileExtension, streamingUrl, uri, renderMode } = this.props; + const { + currentTheme, + contentType, + downloadPath, + fileExtension, + streamingUrl, + uri, + renderMode, + desktopPlayStartTime, + } = this.props; const source = streamingUrl; switch (renderMode) { case RENDER_MODES.AUDIO: case RENDER_MODES.VIDEO: - return ; + return ( + + ); case RENDER_MODES.IMAGE: return ; case RENDER_MODES.HTML: diff --git a/ui/component/fileRenderFloating/view.jsx b/ui/component/fileRenderFloating/view.jsx index f0471bf72..d42f2e7c3 100644 --- a/ui/component/fileRenderFloating/view.jsx +++ b/ui/component/fileRenderFloating/view.jsx @@ -40,6 +40,7 @@ export default function FileRenderFloating(props: Props) { } = props; const isMobile = useIsMobile(); const [fileViewerRect, setFileViewerRect] = useState(); + const [desktopPlayStartTime, setDesktopPlayStartTime] = useState(); const [position, setPosition] = usePersistedState('floating-file-viewer:position', { x: -25, y: window.innerHeight - 400, @@ -73,6 +74,12 @@ export default function FileRenderFloating(props: Props) { }; }, [setFileViewerRect, isFloating]); + useEffect(() => { + // @if TARGET='app' + setDesktopPlayStartTime(Date.now()); + // @endif + }, [uri]); + if (!isPlayable || !uri || (isFloating && (isMobile || !floatingPlayerEnabled))) { return null; } @@ -134,7 +141,16 @@ export default function FileRenderFloating(props: Props) { )} - {isReadyToPlay ? : } + {isReadyToPlay ? ( + + ) : ( + + )} {isFloating && (
diff --git a/ui/component/inviteNew/view.jsx b/ui/component/inviteNew/view.jsx index 164f32f9d..3a645afd4 100644 --- a/ui/component/inviteNew/view.jsx +++ b/ui/component/inviteNew/view.jsx @@ -73,7 +73,7 @@ function InviteNew(props: Props) {
diff --git a/ui/component/rewardAuthIntro/view.jsx b/ui/component/rewardAuthIntro/view.jsx index 314030a48..b20f9b7bf 100644 --- a/ui/component/rewardAuthIntro/view.jsx +++ b/ui/component/rewardAuthIntro/view.jsx @@ -31,6 +31,7 @@ function RewardAuthIntro(props: Props) { } actions={