diff --git a/ui/dist/index.html b/ui/dist/index.html index b4239bc9a..8fbf0b5b6 100644 --- a/ui/dist/index.html +++ b/ui/dist/index.html @@ -7,7 +7,7 @@ - + diff --git a/ui/js/actions/content.js b/ui/js/actions/content.js index 91a227665..69886570b 100644 --- a/ui/js/actions/content.js +++ b/ui/js/actions/content.js @@ -268,8 +268,15 @@ export function doWatchVideo() { const alreadyDownloading = !!downloadingByUri[uri] const { cost } = costInfo + // BUG if you delete a file from the file system system you're going to be + // asked to pay for it again. We need to check if the file is in the blobs + // here and then dispatch doLoadVideo() which will reconstruct it again from + // the blobs. Or perhaps there's another way to see if a file was already + // purchased? + // we already fully downloaded the file if (fileInfo && fileInfo.completed) { + dispatch(doLoadVideo()) return Promise.resolve() } diff --git a/ui/js/component/video/view.jsx b/ui/js/component/video/view.jsx index 1b559ae30..a1093cf40 100644 --- a/ui/js/component/video/view.jsx +++ b/ui/js/component/video/view.jsx @@ -7,6 +7,58 @@ import FilePrice from 'component/filePrice' import Link from 'component/link'; import Modal from 'component/modal'; +class WatchLink extends React.Component { + confirmPurchaseClick() { + this.props.closeModal() + this.props.startPlaying() + this.props.loadVideo() + } + + render() { + const { + button, + label, + className, + onWatchClick, + metadata, + metadata: { + title, + }, + uri, + modal, + closeModal, + isLoading, + costInfo, + fileInfo, + } = this.props + + return (
+ + {modal} + + You don't have enough LBRY credits to pay for this stream. + + + Are you sure you'd like to buy {this.props.metadata.title} for credits? + + + Sorry, your download timed out :( + +
); + } +} + const plyr = require('plyr') class Video extends React.Component { diff --git a/ui/package.json b/ui/package.json index ef8482464..a52366c8c 100644 --- a/ui/package.json +++ b/ui/package.json @@ -24,6 +24,7 @@ "babel-preset-react": "^6.11.1", "mediaelement": "^2.23.4", "node-sass": "^3.8.0", + "plyr": "^2.0.12", "rc-progress": "^2.0.6", "react": "^15.4.0", "react-dom": "^15.4.0", @@ -32,8 +33,7 @@ "redux": "^3.6.0", "redux-logger": "^3.0.1", "redux-thunk": "^2.2.0", - "reselect": "^3.0.0", - "videostream": "^2.4.2" + "reselect": "^3.0.0" }, "devDependencies": { "babel": "^6.5.2",