From d097a0b1eec0dd8943505553379ee6bee7561bf0 Mon Sep 17 00:00:00 2001 From: YULIUS KURNIAWAN KRISTIANTO Date: Thu, 5 Mar 2020 03:57:47 +0700 Subject: [PATCH 1/6] Added Ukrainian to supported language Based on Translators LBRY Discord channel and LBRY zone on Transifex --- ui/constants/supported_languages.js | 1 + 1 file changed, 1 insertion(+) diff --git a/ui/constants/supported_languages.js b/ui/constants/supported_languages.js index 98937777e..61a4c1919 100644 --- a/ui/constants/supported_languages.js +++ b/ui/constants/supported_languages.js @@ -29,6 +29,7 @@ const SUPPORTED_LANGUAGES = { tr: LANGUAGES.tr[1], cs: LANGUAGES.cs[1], kn: LANGUAGES.kn[1], + uk: LANGUAGES.uk[1], }; export default SUPPORTED_LANGUAGES; From 88908a9fce07ed8b45cc1e12a5cd85baadf39649 Mon Sep 17 00:00:00 2001 From: jessop Date: Thu, 5 Mar 2020 14:56:56 -0500 Subject: [PATCH 2/6] update publishing messages: increase lbrytv limit until tv transcoding warn about bitrate warn about strange types more reliably convey size limit message --- flow-typed/web-file.js | 3 +- static/app-strings.json | 9 ++- ui/component/publishFile/view.jsx | 118 +++++++++++++++++++++++++----- ui/scss/init/_gui.scss | 5 ++ 4 files changed, 115 insertions(+), 20 deletions(-) diff --git a/flow-typed/web-file.js b/flow-typed/web-file.js index 6bb0a4d10..afc6bf195 100644 --- a/flow-typed/web-file.js +++ b/flow-typed/web-file.js @@ -2,5 +2,6 @@ declare type WebFile = { name: string, title?: string, path?: string, - size?: string, + size: string, + type: string, } diff --git a/static/app-strings.json b/static/app-strings.json index a1aed94e3..9024a68f9 100644 --- a/static/app-strings.json +++ b/static/app-strings.json @@ -1005,5 +1005,12 @@ "Model": "Model", "Binary": "Binary", "Other": "Other", - "For video content, use MP4s in H264/AAC format and a friendly bitrate (720p) for more reliable streaming.": "For video content, use MP4s in H264/AAC format and a friendly bitrate (720p) for more reliable streaming." + "For video content, use MP4s in H264/AAC format and a friendly bitrate (720p) for more reliable streaming.": "For video content, use MP4s in H264/AAC format and a friendly bitrate (720p) for more reliable streaming.", + "Please check your deposit amount.": "Please check your deposit amount.", + "Your video has a bitrate over 5 mbps. We suggest transcoding to provide viewers the best experience.": "Your video has a bitrate over 5 mbps. We suggest transcoding to provide viewers the best experience.", + "For video content, use MP4s in H264/AAC format and a friendly bitrate (1080p) for more reliable streaming.": "For video content, use MP4s in H264/AAC format and a friendly bitrate (1080p) for more reliable streaming.", + "Unable to validate your video.": "Unable to validate your video.", + "Checking your video...": "Checking your video...", + "Your video has a bitrate over 8 mbps. We suggest transcoding to provide viewers the best experience.": "Your video has a bitrate over 8 mbps. We suggest transcoding to provide viewers the best experience.", + "Your video may not be the best format. Use MP4s in H264/AAC format and a friendly bitrate (1080p) for more reliable streaming.": "Your video may not be the best format. Use MP4s in H264/AAC format and a friendly bitrate (1080p) for more reliable streaming." } \ No newline at end of file diff --git a/ui/component/publishFile/view.jsx b/ui/component/publishFile/view.jsx index 43c83c382..ec2f0761f 100644 --- a/ui/component/publishFile/view.jsx +++ b/ui/component/publishFile/view.jsx @@ -1,6 +1,6 @@ // @flow import * as ICONS from 'constants/icons'; -import React from 'react'; +import React, { useState, useEffect } from 'react'; import { regexInvalidURI } from 'lbry-redux'; import FileSelector from 'component/common/file-selector'; import Button from 'component/button'; @@ -33,6 +33,23 @@ function PublishFile(props: Props) { clearPublish, } = props; + const [duration, setDuration] = useState(0); + const [size, setSize] = useState(0); + const [oversized, setOversized] = useState(false); + const [isVid, setIsVid] = useState(false); + const RECOMMENDED_BITRATE = 8000000; + const TV_PUBLISH_SIZE_LIMIT: number = 100000000; + const UPLOAD_SIZE_MESSAGE = 'Lbrytv uploads are limited to 1 GB. Download the app for unrestricted publishing.'; + + // clear warnings + useEffect(() => { + if (!filePath || filePath === '' || filePath.name === '') { + setDuration(0); + setSize(0); + setIsVid(false); + } + }, [filePath]); + let currentFile = ''; if (filePath) { if (typeof filePath === 'string') { @@ -42,19 +59,96 @@ function PublishFile(props: Props) { } } + function getBitrate(size, duration) { + const s = Number(size); + const d = Number(duration); + if (s && d) { + return (s * 8) / d; + } else { + return 0; + } + } + + function getMessage() { + // @if TARGET='web' + if (oversized || Number(size) > TV_PUBLISH_SIZE_LIMIT) { + return ( +

+ {__(UPLOAD_SIZE_MESSAGE)}{' '} +