From 3a0f12ff9d34262d4d5cf19460dc64e5b8efcfc1 Mon Sep 17 00:00:00 2001
From: Sean Yesmunt
Date: Tue, 12 Mar 2019 15:15:11 -0400
Subject: [PATCH] Merge 'release' into 'master' (#2327)
* fix: wallet balance style with 0lbc
* v0.29.3-rc.1
* v0.29.3
* fix: videoplayer
Switched from timeout to slight delay, works consistently on lbry://test-stream-1. This also fixes the white screen issue (copied most code from current master).
* fix: add back timeout
* fix: phone collection styling
* v0.29.4-rc.2
* update changelog
* v0.29.4
* fix rebase
---
CHANGELOG.md | 15 +++++-
package.json | 2 +-
.../component/fileViewer/internal/player.jsx | 51 ++++++++-----------
src/ui/component/userPhoneNew/view.jsx | 16 ++++--
src/ui/component/walletBalance/view.jsx | 4 +-
src/ui/modal/modalRemoveFile/view.jsx | 16 ++----
6 files changed, 54 insertions(+), 50 deletions(-)
diff --git a/CHANGELOG.md b/CHANGELOG.md
index d32878837..c801f03d3 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -14,7 +14,20 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
### Fixed
-## [0.29.1] - 2019-3-1
+## [0.29.4] - 2019-3-12
+
+### Fixed
+
+- Style issue on phone number collection modal
+- White screen when watching videos for some files
+
+## [0.29.3] - 2019-3-7
+
+### Fixed
+
+- Minor style issue with 0 LBC balance on the wallet page
+
+## [0.29.2] - 2019-3-1
### Fixed
diff --git a/package.json b/package.json
index 404f7c95d..6d526508f 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "LBRY",
- "version": "0.29.2",
+ "version": "0.29.4",
"description": "A browser for the LBRY network, a digital marketplace controlled by its users.",
"keywords": [
"lbry"
diff --git a/src/ui/component/fileViewer/internal/player.jsx b/src/ui/component/fileViewer/internal/player.jsx
index 343e5122f..a36b164ac 100644
--- a/src/ui/component/fileViewer/internal/player.jsx
+++ b/src/ui/component/fileViewer/internal/player.jsx
@@ -1,4 +1,4 @@
-/* eslint-disable */
+// @flow
import type { Claim } from 'types/claim';
import * as React from 'react';
// @if TARGET='app'
@@ -14,7 +14,6 @@ type Props = {
contentType: string,
mediaType: string,
downloadCompleted: boolean,
- playingUri: ?string,
volume: number,
position: ?number,
downloadPath: string,
@@ -74,9 +73,9 @@ class MediaPlayer extends React.PureComponent {
componentDidMount() {
this.playMedia();
-
// Temp hack to force the video to play if the metadataloaded event was never fired
// Will be removed with the new video player
+ // Unoptimized MP4s will fail to render.
// @if TARGET='app'
setTimeout(() => {
const { hasMetadata } = this.state;
@@ -88,23 +87,8 @@ class MediaPlayer extends React.PureComponent {
// @endif
}
- // @if TARGET='app'
- componentDidUpdate(prevProps: Props) {
- const { downloadCompleted } = this.props;
- const { fileSource } = this.state;
-
- const el = this.mediaContainer.current;
-
- if (this.props.playingUri && !prevProps.playingUri && !el.paused) {
- el.pause();
- } else if (this.isSupportedFile() && !fileSource && downloadCompleted) {
- this.renderFile();
- }
- }
- // @endif
-
componentWillUnmount() {
- document.removeEventListener('keydown', this.togglePlay);
+ document.removeEventListener('keydown', this.togglePlayListener);
const mediaElement = this.mediaContainer.current.children[0];
if (mediaElement) {
mediaElement.removeEventListener('click', this.togglePlay);
@@ -125,7 +109,6 @@ class MediaPlayer extends React.PureComponent {
}
playMedia() {
- // @if TARGET='app'
const container = this.mediaContainer.current;
const {
downloadCompleted,
@@ -138,6 +121,8 @@ class MediaPlayer extends React.PureComponent {
fileName,
} = this.props;
+ // @if TARGET='app'
+
const renderMediaCallback = error => {
if (error) this.setState({ unplayable: true });
};
@@ -157,15 +142,18 @@ class MediaPlayer extends React.PureComponent {
}
// Render default viewer: render-media (video, audio, img, iframe)
else {
- player.append(
- {
- name: fileName,
- createReadStream: opts => fs.createReadStream(downloadPath, opts),
- },
- container,
- { autoplay: true, controls: true },
- renderMediaCallback.bind(this)
- );
+ // Temp hack to help in some metadata loading cases
+ setTimeout(() => {
+ player.append(
+ {
+ name: fileName,
+ createReadStream: opts => fs.createReadStream(downloadPath, opts),
+ },
+ container,
+ { autoplay: true, controls: true },
+ renderMediaCallback.bind(this)
+ );
+ }, 300);
}
document.addEventListener('keydown', this.togglePlay);
@@ -175,7 +163,9 @@ class MediaPlayer extends React.PureComponent {
mediaElement.currentTime = position;
}
- mediaElement.addEventListener('loadedmetadata', () => this.refreshMetadata());
+ mediaElement.addEventListener('loadedmetadata', () => this.refreshMetadata(), {
+ once: true,
+ });
mediaElement.addEventListener('timeupdate', () => savePosition(mediaElement.currentTime));
mediaElement.addEventListener('click', this.togglePlay);
mediaElement.addEventListener('ended', () => {
@@ -210,7 +200,6 @@ class MediaPlayer extends React.PureComponent {
if (onStartCb) {
onStartCb();
}
-
const playerElement = this.mediaContainer.current;
if (playerElement) {
playerElement.children[0].play();
diff --git a/src/ui/component/userPhoneNew/view.jsx b/src/ui/component/userPhoneNew/view.jsx
index 92f0673da..241a0c18f 100644
--- a/src/ui/component/userPhoneNew/view.jsx
+++ b/src/ui/component/userPhoneNew/view.jsx
@@ -94,12 +94,17 @@ class UserPhoneNew extends React.PureComponent {
-