diff --git a/lbrytv/src/routes.js b/lbrytv/src/routes.js index 12b1eda0e..6bf96dbb8 100644 --- a/lbrytv/src/routes.js +++ b/lbrytv/src/routes.js @@ -1,16 +1,10 @@ const { getHtml } = require('./html'); -const { generateStreamUrl, generateDownloadUrl } = require('../../ui/util/lbrytv'); +const { generateDownloadUrl } = require('../../ui/util/lbrytv'); +const { LBRY_TV_API } = require('../../config'); const Router = require('@koa/router'); -const send = require('koa-send'); const router = new Router(); -router.get(`/$/embed/:claimName/:claimId`, async ctx => { - const { claimName, claimId } = ctx.params; - const streamUrl = generateStreamUrl(claimName, claimId); - ctx.redirect(streamUrl); -}); - router.get(`/$/download/:claimName/:claimId`, async ctx => { const { claimName, claimId } = ctx.params; const downloadUrl = generateDownloadUrl(claimName, claimId); diff --git a/static/app-strings.json b/static/app-strings.json index 1e7bfb663..1717c29a8 100644 --- a/static/app-strings.json +++ b/static/app-strings.json @@ -157,6 +157,7 @@ "Details": "Details", "Transaction": "Transaction", "Date": "Date", + "Abandon Support": "Abandon Support", "Abandon Claim": "Abandon Claim", "Find New Tags To Follow": "Find New Tags To Follow", "Aw shucks!": "Aw shucks!", diff --git a/ui/component/autoplayCountdown/index.js b/ui/component/autoplayCountdown/index.js new file mode 100644 index 000000000..e965abcc3 --- /dev/null +++ b/ui/component/autoplayCountdown/index.js @@ -0,0 +1,25 @@ +import * as SETTINGS from 'constants/settings'; +import { connect } from 'react-redux'; +import { makeSelectClaimForUri } from 'lbry-redux'; +import { makeSelectNextUnplayedRecommended } from 'redux/selectors/content'; +import { makeSelectClientSetting } from 'redux/selectors/settings'; +import { doSetPlayingUri } from 'redux/actions/content'; +import RecommendedVideos from './view'; + +const select = (state, props) => { + const nextRecommendedUri = makeSelectNextUnplayedRecommended(props.uri)(state); + return { + nextRecommendedUri, + nextRecommendedClaim: makeSelectClaimForUri(nextRecommendedUri)(state), + autoplay: makeSelectClientSetting(SETTINGS.AUTOPLAY)(state), + }; +}; + +const perform = dispatch => ({ + setPlayingUri: uri => dispatch(doSetPlayingUri(uri)), +}); + +export default connect( + select, + perform +)(RecommendedVideos); diff --git a/ui/component/autoplayCountdown/view.jsx b/ui/component/autoplayCountdown/view.jsx new file mode 100644 index 000000000..83121d136 --- /dev/null +++ b/ui/component/autoplayCountdown/view.jsx @@ -0,0 +1,76 @@ +// @flow +import React from 'react'; +import Button from 'component/button'; +import UriIndicator from 'component/uriIndicator'; +import I18nMessage from 'component/i18nMessage'; +import { formatLbryUrlForWeb } from 'util/url'; +import { withRouter } from 'react-router'; + +type Props = { + history: { push: string => void }, + nextRecommendedClaim: ?StreamClaim, + nextRecommendedUri: string, + setPlayingUri: (string | null) => void, +}; + +function AutoplayCountdown(props: Props) { + const { + nextRecommendedUri, + nextRecommendedClaim, + setPlayingUri, + history: { push }, + } = props; + const nextTitle = nextRecommendedClaim && nextRecommendedClaim.value && nextRecommendedClaim.value.title; + const [timer, setTimer] = React.useState(5); + const [timerCanceled, setTimerCanceled] = React.useState(false); + + let navigateUrl; + if (nextTitle) { + navigateUrl = formatLbryUrlForWeb(nextRecommendedUri); + } + + React.useEffect(() => { + let interval; + if (!timerCanceled) { + interval = setInterval(() => { + const newTime = timer - 1; + if (newTime === 0) { + // Set the playingUri to null so the app doesn't try to make a floating window with the video that just finished + setPlayingUri(null); + push(navigateUrl); + } else { + setTimer(timer - 1); + } + }, 1000); + } + return () => { + clearInterval(interval); + }; + }, [timer, navigateUrl, push, timerCanceled, setPlayingUri, nextRecommendedUri]); + + if (timerCanceled) { + return null; + } + + return ( +
+
+ }}> + Up Next by %channel% + +
+
{nextTitle}
+ +
+
+ {__('Playing in %seconds_left% seconds', { seconds_left: timer })} +
+
+
+
+
+ ); +} + +export default withRouter(AutoplayCountdown); diff --git a/ui/component/channelCreate/view.jsx b/ui/component/channelCreate/view.jsx index 9f1caebe1..d2a53ba15 100644 --- a/ui/component/channelCreate/view.jsx +++ b/ui/component/channelCreate/view.jsx @@ -147,6 +147,7 @@ class ChannelCreate extends React.PureComponent { error={newChannelBidError} value={newChannelBid} onChange={event => this.handleNewChannelBidChange(parseFloat(event.target.value))} + onWheel={e => e.stopPropagation()} />
+ + + )} + {!currentlyFloating && showAutoplayCountdown && } }>{this.renderViewer()} ); diff --git a/ui/component/floatingViewer/view.jsx b/ui/component/floatingViewer/view.jsx index cf0e644dc..51965ff4e 100644 --- a/ui/component/floatingViewer/view.jsx +++ b/ui/component/floatingViewer/view.jsx @@ -175,7 +175,11 @@ export default function FileViewer(props: Props) { )} - {isReadyToPlay ? : } + {isReadyToPlay ? ( + + ) : ( + + )} {!inline && (
diff --git a/ui/component/header/view.jsx b/ui/component/header/view.jsx index f5afafb13..18fee57f8 100644 --- a/ui/component/header/view.jsx +++ b/ui/component/header/view.jsx @@ -165,14 +165,6 @@ const Header = (props: Props) => { {__('Channels')} - - {/* @if TARGET='app' */} - history.push(`/$/${PAGES.LIBRARY}`)}> - - {__('Library')} - - {/* @endif */} - history.push(`/$/${PAGES.REWARDS}`)}> {__('Rewards')} diff --git a/ui/component/publishName/view.jsx b/ui/component/publishName/view.jsx index 66b6d1e40..4aa7836ee 100644 --- a/ui/component/publishName/view.jsx +++ b/ui/component/publishName/view.jsx @@ -113,6 +113,7 @@ function PublishName(props: Props) { error={bidError} disabled={!name} onChange={event => updatePublishForm({ bid: parseFloat(event.target.value) })} + onWheel={e => e.stopPropagation()} helper={ + + + {/* Below need to go at the end to make sure we don't match any of our pages first */} diff --git a/ui/component/sideNavigation/view.jsx b/ui/component/sideNavigation/view.jsx index eb2709238..a337a5fe5 100644 --- a/ui/component/sideNavigation/view.jsx +++ b/ui/component/sideNavigation/view.jsx @@ -112,6 +112,11 @@ function SideNavigation(props: Props) { { ...buildLink(PAGES.DISCOVER, __('All Content'), ICONS.DISCOVER), }, + // @if TARGET='app' + { + ...buildLink(PAGES.LIBRARY, __('Library'), ICONS.LIBRARY), + }, + // @endif ].map(linkProps => (
  • - {webShareable && !isChannel && } + {webShareable && !isChannel && } ); } diff --git a/ui/component/transactionListTable/internal/transaction-list-item.jsx b/ui/component/transactionListTable/internal/transaction-list-item.jsx index 8fc89c689..ad2718c97 100644 --- a/ui/component/transactionListTable/internal/transaction-list-item.jsx +++ b/ui/component/transactionListTable/internal/transaction-list-item.jsx @@ -28,7 +28,8 @@ class TransactionListItem extends React.PureComponent { if (type === TXN_TYPES.TIP) { return