diff --git a/ui/js/component/auth.js b/ui/js/component/auth.js index 5b3d4d46e..ace7c84df 100644 --- a/ui/js/component/auth.js +++ b/ui/js/component/auth.js @@ -137,7 +137,7 @@ const WelcomeStage = React.createClass({

About Your Reward

-

You earned a reward of 5 LBRY credits, or LBC.

+

You earned a reward of %award% LBRY credits, or LBC.

This reward will show in your Wallet momentarily, likely while you are reading this message.

LBC is used to compensate creators, to publish, and to have say in how the network works.

No need to understand it all just yet! Try watching or downloading something next.

diff --git a/ui/js/component/file-actions.js b/ui/js/component/file-actions.js index 1c4c1650a..d12e4525f 100644 --- a/ui/js/component/file-actions.js +++ b/ui/js/component/file-actions.js @@ -27,7 +27,6 @@ let FileActionsRow = React.createClass({ deleteChecked: false, attemptingDownload: false, attemptingRemove: false, - affirmedPurchase: false } }, onFileInfoUpdate: function(fileInfo) { diff --git a/ui/js/page/show.js b/ui/js/page/show.js index c22dfdeee..a488bb4a2 100644 --- a/ui/js/page/show.js +++ b/ui/js/page/show.js @@ -80,21 +80,17 @@ let ShowPage = React.createClass({ }); }, render: function() { - if (this.state.metadata == null) { - return null; - } - - //
const metadata = this.state.uriLookupComplete ? this.state.metadata : null, title = this.state.uriLookupComplete ? metadata.title : this._uri; + console.log(metadata); return (
{ this.state.contentType && this.state.contentType.startsWith('video/') ?
@@ -117,11 +113,12 @@ let ShowPage = React.createClass({ {metadata.description}
- : } - -
- + :
}
+ { metadata ? +
+ +
: '' }
diff --git a/ui/js/page/watch.js b/ui/js/page/watch.js index bd80c30b2..3e3d163dc 100644 --- a/ui/js/page/watch.js +++ b/ui/js/page/watch.js @@ -2,11 +2,87 @@ import React from 'react'; import {Icon, Thumbnail} from '../component/common.js'; import {Link} from '../component/link.js'; import lbry from '../lbry.js'; +import Modal from '../component/modal.js'; import LoadScreen from '../component/load_screen.js' const fs = require('fs'); const VideoStream = require('videostream'); +export let WatchLink = React.createClass({ + propTypes: { + uri: React.PropTypes.string, + downloadStarted: React.PropTypes.bool, + onGet: React.PropTypes.func + }, + getInitialState: function() { + affirmedPurchase: false + }, + onAffirmPurchase: function() { + lbry.get({uri: this.props.uri}).then((streamInfo) => { + if (streamInfo === null || typeof streamInfo !== 'object') { + this.setState({ + modal: 'timedOut', + attemptingDownload: false, + }); + } + }); + if (this.props.onGet) { + this.props.onGet() + } + }, + onWatchClick: function() { + this.setState({ + loading: true + }); + lbry.getCostInfo(this.props.uri).then(({cost}) => { + lbry.getBalance((balance) => { + if (cost > balance) { + this.setState({ + modal: 'notEnoughCredits', + attemptingDownload: false, + }); + } else if (cost <= 0.01) { + this.onAffirmPurchase() + } else { + this.setState({ + modal: 'affirmPurchase' + }); + } + }); + }); + }, + getInitialState: function() { + return { + modal: null, + loading: false, + }; + }, + closeModal: function() { + this.setState({ + loading: false, + modal: null, + }); + }, + render: function() { + return (
+ + + You don't have enough LBRY credits to pay for this stream. + + + Confirm you want to purchase this bro. + +
); + } +}); + + export let Video = React.createClass({ _isMounted: false, _controlsHideDelay: 3000, // Note: this needs to be shorter than the built-in delay in Electron, or Electron will hide the controls before us @@ -27,22 +103,7 @@ export let Video = React.createClass({ controlsShown: false, }; }, - start: function() { - // lbry.getCostInfo(this.props.uri).then(({cost}) => { - // lbry.getBalance((balance) => { - // if (cost > balance) { - // this.setState({ - // modal: 'notEnoughCredits', - // loading: false, - // }); - // } else { - // this.startVideo(); - // } - // }); - // // }); - // - // You don't have enough LBRY credits to pay for this stream. - // + onGet: function() { lbry.get({uri: this.props.uri}).then((fileInfo) => { this._outpoint = fileInfo.outpoint; this.updateLoadStatus(); @@ -127,9 +188,8 @@ export let Video = React.createClass({ !this.state.readyToPlay ? this is the world's world loading screen and we shipped our software with it anyway...

{this.state.loadStatusMessage}
: : -
- - +
+
}
); diff --git a/ui/scss/component/_video.scss b/ui/scss/component/_video.scss index 6ee8efe7e..09775ca39 100644 --- a/ui/scss/component/_video.scss +++ b/ui/scss/component/_video.scss @@ -30,11 +30,9 @@ video { text-align: center; height: 100%; width: 100%; - img { - max-width: 100%; - max-height: 100%; - vertical-align: middle; - } + background-size: auto 100%; + background-position: center center; + background-repeat: no-repeat; position: relative; &:hover { .video__play-button { @include absolute-center(); }