From 75b28f998c1d443683e07924264c9997a8f66d5e Mon Sep 17 00:00:00 2001 From: Alex Liebowitz Date: Wed, 15 Feb 2017 16:46:16 -0500 Subject: [PATCH 1/7] Change Watch page to recognize "stopped" status as playable --- js/page/watch.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/js/page/watch.js b/js/page/watch.js index 642272023..37efe8bf4 100644 --- a/js/page/watch.js +++ b/js/page/watch.js @@ -24,7 +24,7 @@ var WatchPage = React.createClass({ }, updateLoadStatus: function() { lbry.getFileStatus(this.props.name, (status) => { - if (!status || status.code != 'running' || status.written_bytes == 0) { + if (!status || ['running', 'stopped'].includes(status.code) || status.written_bytes == 0) { // Download hasn't started yet, so update status message (if available) then try again // TODO: Would be nice to check if we have the MOOV before starting playing if (status) { From 3252d29d9e7a72f37761c5630e9e8a7673e4aa4a Mon Sep 17 00:00:00 2001 From: Alex Liebowitz Date: Thu, 16 Feb 2017 00:19:10 -0500 Subject: [PATCH 2/7] Watch: correct status check logic --- js/page/watch.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/js/page/watch.js b/js/page/watch.js index 37efe8bf4..18bbb97c2 100644 --- a/js/page/watch.js +++ b/js/page/watch.js @@ -24,7 +24,7 @@ var WatchPage = React.createClass({ }, updateLoadStatus: function() { lbry.getFileStatus(this.props.name, (status) => { - if (!status || ['running', 'stopped'].includes(status.code) || status.written_bytes == 0) { + if (!status || !['running', 'stopped'].includes(status.code) || status.written_bytes == 0) { // Download hasn't started yet, so update status message (if available) then try again // TODO: Would be nice to check if we have the MOOV before starting playing if (status) { From 7c7e3a97e8455d989e378961bbda1f29b8b6e813 Mon Sep 17 00:00:00 2001 From: jobevers Date: Wed, 15 Feb 2017 11:28:15 -0600 Subject: [PATCH 3/7] add changelog --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4a8750713..5a07f26da 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,3 +6,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/). (Note for Alex: fill in what kind of versioning we want to use) ## [Unreleased] +### Changed + * Use local file for publishing + * Use local file and html5 for video playback + * Misc changes needed to make UI compatible with electron From 056470b47c90f3aa73f19365767c9451bf13cded Mon Sep 17 00:00:00 2001 From: Alex Liebowitz Date: Fri, 3 Feb 2017 03:51:13 -0500 Subject: [PATCH 4/7] Convert to HTML5 video player (temp) --- js/page/watch.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/js/page/watch.js b/js/page/watch.js index 18bbb97c2..c58d10281 100644 --- a/js/page/watch.js +++ b/js/page/watch.js @@ -29,7 +29,7 @@ var WatchPage = React.createClass({ // TODO: Would be nice to check if we have the MOOV before starting playing if (status) { this.setState({ - loadStatusMessage: status.message + loadStatusMessage: status.message, }); } setTimeout(() => { this.updateLoadStatus() }, 250); @@ -57,8 +57,7 @@ var WatchPage = React.createClass({ !this.state.readyToPlay ? :
- +
); } From b6982854d81c37ff852c7bce91e943fa6909cc00 Mon Sep 17 00:00:00 2001 From: Alex Liebowitz Date: Fri, 3 Feb 2017 05:25:05 -0500 Subject: [PATCH 5/7] Add Back button to Watch page --- js/page/watch.js | 18 +++++++++++++++- scss/all.scss | 3 ++- scss/page/_watch.scss | 50 +++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 69 insertions(+), 2 deletions(-) create mode 100644 scss/page/_watch.scss diff --git a/js/page/watch.js b/js/page/watch.js index c58d10281..4825049f2 100644 --- a/js/page/watch.js +++ b/js/page/watch.js @@ -1,4 +1,6 @@ import React from 'react'; +import {Icon} from '../component/common.js'; +import {Link} from '../component/link.js'; import lbry from '../lbry.js'; import LoadScreen from '../component/load_screen.js' @@ -22,6 +24,9 @@ var WatchPage = React.createClass({ lbry.getStream(this.props.name); this.updateLoadStatus(); }, + handleBackClicked: function() { + history.back(); + }, updateLoadStatus: function() { lbry.getFileStatus(this.props.name, (status) => { if (!status || !['running', 'stopped'].includes(status.code) || status.written_bytes == 0) { @@ -56,8 +61,19 @@ var WatchPage = React.createClass({ return ( !this.state.readyToPlay ? - :
+ :
); } diff --git a/scss/all.scss b/scss/all.scss index 452cbbcac..8729eb666 100644 --- a/scss/all.scss +++ b/scss/all.scss @@ -10,4 +10,5 @@ @import "component/_menu.scss"; @import "component/_tooltip.scss"; @import "component/_load-screen.scss"; -@import "page/_developer.scss"; \ No newline at end of file +@import "page/_developer.scss"; +@import "page/_watch.scss"; \ No newline at end of file diff --git a/scss/page/_watch.scss b/scss/page/_watch.scss new file mode 100644 index 000000000..ab3c9a577 --- /dev/null +++ b/scss/page/_watch.scss @@ -0,0 +1,50 @@ +.video { + background: #000; +} + +.video__overlay { + position: absolute; + top: 0px; + bottom: 0px; + left: 0px; + right: 0px; + color: #fff; + z-index: 1; +} + +.video__back { + margin-top: 30px; + margin-left: 50px; + display: flex; + flex-direction: row; + align-items: center; +} + +.video__back-link { + font-size: 50px; +} + +.video__back-label { + opacity: 0; + transition: opacity 100ms ease-in; +} + +.video__back-link:hover + .video__back-label { + opacity: 1; +} + +.video__back-label-arrow { + color: darken($color-primary, 5%); + font-size: 20px; +} + +.video__back-label-content { + display: inline-block; + margin-left: -2px; + font-size: 20px; + padding: 10px; + border-radius: 3px; + background-color: darken($color-primary, 5%); + color: #fff; + pointer-events: none; +} From 471bf2fb103066329e8f618dc37da5e7108fcc3a Mon Sep 17 00:00:00 2001 From: Jeremy Kauffman Date: Wed, 8 Feb 2017 13:27:34 -0500 Subject: [PATCH 6/7] change bg color --- scss/page/_watch.scss | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/scss/page/_watch.scss b/scss/page/_watch.scss index ab3c9a577..01b3b7b93 100644 --- a/scss/page/_watch.scss +++ b/scss/page/_watch.scss @@ -33,18 +33,21 @@ opacity: 1; } +$video-back-background: #333; +$video-back-size: 20px; + .video__back-label-arrow { - color: darken($color-primary, 5%); - font-size: 20px; + color: $video-back-background; + font-size: $video-back-size; } .video__back-label-content { display: inline-block; margin-left: -2px; - font-size: 20px; - padding: 10px; + font-size: $video-back-size; + padding: $spacing-vertical / 2; border-radius: 3px; - background-color: darken($color-primary, 5%); + background-color: $video-back-background; color: #fff; pointer-events: none; } From 6059c3bebb3f0ce1cc7787ff14801ea80cd43a4a Mon Sep 17 00:00:00 2001 From: Alex Liebowitz Date: Thu, 16 Feb 2017 02:18:26 -0500 Subject: [PATCH 7/7] Watch: Update Back to LBRY button for Electron --- js/page/watch.js | 61 +++++++++++++++++++++++++++++++++++-------- scss/page/_watch.scss | 2 -- 2 files changed, 50 insertions(+), 13 deletions(-) diff --git a/js/page/watch.js b/js/page/watch.js index 4825049f2..640d43ac2 100644 --- a/js/page/watch.js +++ b/js/page/watch.js @@ -9,6 +9,10 @@ const VideoStream = require('videostream'); var WatchPage = 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 + _controlsHideTimeout: null, + propTypes: { name: React.PropTypes.string, }, @@ -18,6 +22,7 @@ var WatchPage = React.createClass({ readyToPlay: false, loadStatusMessage: "Requesting stream", mimeType: null, + controlsShown: false, }; }, componentDidMount: function() { @@ -27,6 +32,37 @@ var WatchPage = React.createClass({ handleBackClicked: function() { history.back(); }, + handleMouseMove: function() { + if (this._controlsTimeout) { + clearTimeout(this._controlsTimeout); + } + + if (!this.state.controlsShown) { + this.setState({ + controlsShown: true, + }); + } + this._controlsTimeout = setTimeout(() => { + if (!this.isMounted) { + return; + } + + this.setState({ + controlsShown: false, + }); + }, this._controlsHideDelay); + }, + handleMouseOut: function() { + if (this._controlsTimeout) { + clearTimeout(this._controlsTimeout); + } + + if (this.state.controlsShown) { + this.setState({ + controlsShown: false, + }); + } + }, updateLoadStatus: function() { lbry.getFileStatus(this.props.name, (status) => { if (!status || !['running', 'stopped'].includes(status.code) || status.written_bytes == 0) { @@ -61,19 +97,22 @@ var WatchPage = React.createClass({ return ( !this.state.readyToPlay ? - :
-
); } diff --git a/scss/page/_watch.scss b/scss/page/_watch.scss index 01b3b7b93..23fbcc171 100644 --- a/scss/page/_watch.scss +++ b/scss/page/_watch.scss @@ -5,9 +5,7 @@ .video__overlay { position: absolute; top: 0px; - bottom: 0px; left: 0px; - right: 0px; color: #fff; z-index: 1; }