random fixes for livestreaming
This commit is contained in:
parent
6d07d1b672
commit
5aaa038d3f
7 changed files with 36 additions and 34 deletions
|
@ -6,15 +6,16 @@ import FileActions from 'component/fileActions';
|
||||||
|
|
||||||
type Props = {
|
type Props = {
|
||||||
uri: string,
|
uri: string,
|
||||||
|
livestream?: boolean,
|
||||||
};
|
};
|
||||||
|
|
||||||
function FileSubtitle(props: Props) {
|
function FileSubtitle(props: Props) {
|
||||||
const { uri } = props;
|
const { uri, livestream = false } = props;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="media__subtitle--between">
|
<div className="media__subtitle--between">
|
||||||
<div className="file__viewdate">
|
<div className="file__viewdate">
|
||||||
<DateTime uri={uri} show={DateTime.SHOW_DATE} />
|
{livestream ? <span>{__('Right now')}</span> : <DateTime uri={uri} show={DateTime.SHOW_DATE} />}
|
||||||
<FileViewCount uri={uri} />
|
<FileViewCount uri={uri} />
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
|
@ -18,10 +18,11 @@ type Props = {
|
||||||
title: string,
|
title: string,
|
||||||
nsfw: boolean,
|
nsfw: boolean,
|
||||||
isNsfwBlocked: boolean,
|
isNsfwBlocked: boolean,
|
||||||
|
livestream?: boolean,
|
||||||
};
|
};
|
||||||
|
|
||||||
function FileTitleSection(props: Props) {
|
function FileTitleSection(props: Props) {
|
||||||
const { title, uri, nsfw, isNsfwBlocked } = props;
|
const { title, uri, nsfw, isNsfwBlocked, livestream = false } = props;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Card
|
<Card
|
||||||
|
@ -41,7 +42,7 @@ function FileTitleSection(props: Props) {
|
||||||
body={
|
body={
|
||||||
<React.Fragment>
|
<React.Fragment>
|
||||||
<ClaimInsufficientCredits uri={uri} />
|
<ClaimInsufficientCredits uri={uri} />
|
||||||
<FileSubtitle uri={uri} />
|
<FileSubtitle uri={uri} livestream={livestream} />
|
||||||
</React.Fragment>
|
</React.Fragment>
|
||||||
}
|
}
|
||||||
actions={
|
actions={
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
// @flow
|
// @flow
|
||||||
|
import { LOGO_TITLE, ENABLE_NO_SOURCE_CLAIMS } from 'config';
|
||||||
import * as ICONS from 'constants/icons';
|
import * as ICONS from 'constants/icons';
|
||||||
import { SETTINGS } from 'lbry-redux';
|
import { SETTINGS } from 'lbry-redux';
|
||||||
import * as PAGES from 'constants/pages';
|
import * as PAGES from 'constants/pages';
|
||||||
|
@ -10,7 +11,6 @@ import WunderBar from 'component/wunderbar';
|
||||||
import Icon from 'component/common/icon';
|
import Icon from 'component/common/icon';
|
||||||
import { Menu, MenuList, MenuButton, MenuItem } from '@reach/menu-button';
|
import { Menu, MenuList, MenuButton, MenuItem } from '@reach/menu-button';
|
||||||
import NavigationButton from 'component/navigationButton';
|
import NavigationButton from 'component/navigationButton';
|
||||||
import { LOGO_TITLE } from 'config';
|
|
||||||
import { useIsMobile } from 'effects/use-screensize';
|
import { useIsMobile } from 'effects/use-screensize';
|
||||||
import NotificationBubble from 'component/notificationBubble';
|
import NotificationBubble from 'component/notificationBubble';
|
||||||
import NotificationHeaderButton from 'component/notificationHeaderButton';
|
import NotificationHeaderButton from 'component/notificationHeaderButton';
|
||||||
|
@ -99,7 +99,7 @@ const Header = (props: Props) => {
|
||||||
const hasBackout = Boolean(backout);
|
const hasBackout = Boolean(backout);
|
||||||
const { backLabel, backNavDefault, title: backTitle, simpleTitle: simpleBackTitle } = backout || {};
|
const { backLabel, backNavDefault, title: backTitle, simpleTitle: simpleBackTitle } = backout || {};
|
||||||
const notificationsEnabled = (user && user.experimental_ui) || false;
|
const notificationsEnabled = (user && user.experimental_ui) || false;
|
||||||
const livestreamEnabled = (user && user.experimental_ui) || false;
|
const livestreamEnabled = (ENABLE_NO_SOURCE_CLAIMS && user && user.experimental_ui) || false;
|
||||||
const activeChannelUrl = activeChannelClaim && activeChannelClaim.permanent_url;
|
const activeChannelUrl = activeChannelClaim && activeChannelClaim.permanent_url;
|
||||||
|
|
||||||
// Sign out if they click the "x" when they are on the password prompt
|
// Sign out if they click the "x" when they are on the password prompt
|
||||||
|
@ -276,10 +276,6 @@ const Header = (props: Props) => {
|
||||||
history={history}
|
history={history}
|
||||||
handleThemeToggle={handleThemeToggle}
|
handleThemeToggle={handleThemeToggle}
|
||||||
currentTheme={currentTheme}
|
currentTheme={currentTheme}
|
||||||
activeChannelUrl={activeChannelUrl}
|
|
||||||
openSignOutModal={openSignOutModal}
|
|
||||||
email={email}
|
|
||||||
signOut={signOut}
|
|
||||||
livestreamEnabled={livestreamEnabled}
|
livestreamEnabled={livestreamEnabled}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
@ -397,26 +393,11 @@ type HeaderMenuButtonProps = {
|
||||||
history: { push: (string) => void },
|
history: { push: (string) => void },
|
||||||
handleThemeToggle: (string) => void,
|
handleThemeToggle: (string) => void,
|
||||||
currentTheme: string,
|
currentTheme: string,
|
||||||
activeChannelUrl: ?string,
|
|
||||||
openSignOutModal: () => void,
|
|
||||||
email: ?string,
|
|
||||||
signOut: () => void,
|
|
||||||
livestreamEnabled: boolean,
|
livestreamEnabled: boolean,
|
||||||
};
|
};
|
||||||
|
|
||||||
function HeaderMenuButtons(props: HeaderMenuButtonProps) {
|
function HeaderMenuButtons(props: HeaderMenuButtonProps) {
|
||||||
const {
|
const { authenticated, notificationsEnabled, history, handleThemeToggle, currentTheme, livestreamEnabled } = props;
|
||||||
authenticated,
|
|
||||||
notificationsEnabled,
|
|
||||||
history,
|
|
||||||
handleThemeToggle,
|
|
||||||
currentTheme,
|
|
||||||
activeChannelUrl,
|
|
||||||
openSignOutModal,
|
|
||||||
email,
|
|
||||||
signOut,
|
|
||||||
livestreamEnabled,
|
|
||||||
} = props;
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="header__buttons">
|
<div className="header__buttons">
|
||||||
|
@ -445,14 +426,12 @@ function HeaderMenuButtons(props: HeaderMenuButtonProps) {
|
||||||
{__('New Channel')}
|
{__('New Channel')}
|
||||||
</MenuItem>
|
</MenuItem>
|
||||||
|
|
||||||
{/* Go Live Button for LiveStreaming */}
|
{livestreamEnabled && (
|
||||||
{(livestreamEnabled) &&(
|
|
||||||
<MenuItem className="menu__link" onSelect={() => history.push(`/$/${PAGES.LIVESTREAM}`)}>
|
<MenuItem className="menu__link" onSelect={() => history.push(`/$/${PAGES.LIVESTREAM}`)}>
|
||||||
<Icon aria-hidden icon={ICONS.VIDEO} />
|
<Icon aria-hidden icon={ICONS.VIDEO} />
|
||||||
{__('Go Live')}
|
{__('Go Live')}
|
||||||
</MenuItem>
|
</MenuItem>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
</MenuList>
|
</MenuList>
|
||||||
</Menu>
|
</Menu>
|
||||||
)}
|
)}
|
||||||
|
|
|
@ -1,9 +1,10 @@
|
||||||
import { connect } from 'react-redux';
|
import { connect } from 'react-redux';
|
||||||
import { makeSelectClaimForUri } from 'lbry-redux';
|
import { makeSelectClaimForUri, makeSelectThumbnailForUri } from 'lbry-redux';
|
||||||
import LivestreamLayout from './view';
|
import LivestreamLayout from './view';
|
||||||
|
|
||||||
const select = (state, props) => ({
|
const select = (state, props) => ({
|
||||||
claim: makeSelectClaimForUri(props.uri)(state),
|
claim: makeSelectClaimForUri(props.uri)(state),
|
||||||
|
thumbnail: makeSelectThumbnailForUri(props.uri)(state),
|
||||||
});
|
});
|
||||||
|
|
||||||
export default connect(select)(LivestreamLayout);
|
export default connect(select)(LivestreamLayout);
|
||||||
|
|
|
@ -1,31 +1,50 @@
|
||||||
// @flow
|
// @flow
|
||||||
// import { BITWAVE_EMBED_URL } from 'constants/livestream';
|
import { BITWAVE_EMBED_URL } from 'constants/livestream';
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import FileTitleSection from 'component/fileTitleSection';
|
import FileTitleSection from 'component/fileTitleSection';
|
||||||
import LivestreamComments from 'component/livestreamComments';
|
import LivestreamComments from 'component/livestreamComments';
|
||||||
|
import FileThumbnail from 'component/fileThumbnail';
|
||||||
|
|
||||||
type Props = {
|
type Props = {
|
||||||
uri: string,
|
uri: string,
|
||||||
claim: ?StreamClaim,
|
claim: ?StreamClaim,
|
||||||
|
isLive: boolean,
|
||||||
activeViewers: number,
|
activeViewers: number,
|
||||||
};
|
};
|
||||||
|
|
||||||
export default function LivestreamLayout(props: Props) {
|
export default function LivestreamLayout(props: Props) {
|
||||||
const { claim, uri, activeViewers } = props;
|
const { claim, uri, isLive, activeViewers } = props;
|
||||||
|
|
||||||
if (!claim) {
|
if (!claim) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const channelName = claim.signing_channel && claim.signing_channel.name;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<div className="section card-stack">
|
<div className="section card-stack">
|
||||||
<div className="file-render file-render--video livestream">
|
<div className="file-render file-render--video livestream">
|
||||||
<div className="file-viewer">
|
<div className="file-viewer">
|
||||||
{/* <iframe src={`${BITWAVE_EMBED_URL}/${'doomtube'}?skin=odysee&autoplay=1`} scrolling="no" allowFullScreen /> */}
|
{isLive ? (
|
||||||
|
<iframe
|
||||||
|
src={`${BITWAVE_EMBED_URL}/${'doomtube'}?skin=odysee&autoplay=1`}
|
||||||
|
scrolling="no"
|
||||||
|
allowFullScreen
|
||||||
|
/>
|
||||||
|
) : (
|
||||||
|
<FileThumbnail uri={uri} />
|
||||||
|
)}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
{!isLive && (
|
||||||
|
<div className="help--notice">
|
||||||
|
{__("%channel% isn't live right now, but the chat is! Check back later to watch the stream.", {
|
||||||
|
channel: channelName || __('This channel'),
|
||||||
|
})}
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
<FileTitleSection uri={uri} livestream activeViewers={activeViewers} />
|
<FileTitleSection uri={uri} livestream activeViewers={activeViewers} />
|
||||||
</div>
|
</div>
|
||||||
<LivestreamComments uri={uri} />
|
<LivestreamComments uri={uri} />
|
||||||
|
|
|
@ -5,6 +5,7 @@
|
||||||
position: relative;
|
position: relative;
|
||||||
border-radius: var(--border-radius);
|
border-radius: var(--border-radius);
|
||||||
|
|
||||||
|
.media__thumb,
|
||||||
iframe {
|
iframe {
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
border-radius: var(--border-radius);
|
border-radius: var(--border-radius);
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
.media__thumb {
|
.media__thumb {
|
||||||
@include thumbnail;
|
@include thumbnail;
|
||||||
position: relative;
|
position: relative;
|
||||||
border-radius: var(--card-radius);
|
border-radius: var(--border-radius);
|
||||||
object-fit: cover;
|
object-fit: cover;
|
||||||
background-color: var(--color-placeholder-background);
|
background-color: var(--color-placeholder-background);
|
||||||
background-position: center;
|
background-position: center;
|
||||||
|
|
Loading…
Add table
Reference in a new issue