Merge pull request #1622 from lbryio/markb_1545_autoplay
removed direct call to doLoadVideo for autoplay handling.
This commit is contained in:
commit
d39cc581eb
2 changed files with 2 additions and 14 deletions
|
@ -2,7 +2,7 @@ import { connect } from 'react-redux';
|
||||||
import * as settings from 'constants/settings';
|
import * as settings from 'constants/settings';
|
||||||
import { doChangeVolume } from 'redux/actions/app';
|
import { doChangeVolume } from 'redux/actions/app';
|
||||||
import { selectVolume } from 'redux/selectors/app';
|
import { selectVolume } from 'redux/selectors/app';
|
||||||
import { doPlayUri, doSetPlayingUri, doLoadVideo } from 'redux/actions/content';
|
import { doPlayUri, doSetPlayingUri } from 'redux/actions/content';
|
||||||
import { doPlay, doPause, savePosition } from 'redux/actions/media';
|
import { doPlay, doPause, savePosition } from 'redux/actions/media';
|
||||||
import {
|
import {
|
||||||
makeSelectMetadataForUri,
|
makeSelectMetadataForUri,
|
||||||
|
@ -38,7 +38,6 @@ const select = (state, props) => ({
|
||||||
|
|
||||||
const perform = dispatch => ({
|
const perform = dispatch => ({
|
||||||
play: uri => dispatch(doPlayUri(uri)),
|
play: uri => dispatch(doPlayUri(uri)),
|
||||||
load: uri => dispatch(doLoadVideo(uri)),
|
|
||||||
cancelPlay: () => dispatch(doSetPlayingUri(null)),
|
cancelPlay: () => dispatch(doSetPlayingUri(null)),
|
||||||
changeVolume: volume => dispatch(doChangeVolume(volume)),
|
changeVolume: volume => dispatch(doChangeVolume(volume)),
|
||||||
doPlay: () => dispatch(doPlay()),
|
doPlay: () => dispatch(doPlay()),
|
||||||
|
|
|
@ -80,22 +80,11 @@ class Video extends React.PureComponent<Props> {
|
||||||
}
|
}
|
||||||
|
|
||||||
handleAutoplay = (props: Props) => {
|
handleAutoplay = (props: Props) => {
|
||||||
const {
|
const { autoplay, playingUri, fileInfo, costInfo, isDownloading, uri, play, metadata } = props;
|
||||||
autoplay,
|
|
||||||
playingUri,
|
|
||||||
fileInfo,
|
|
||||||
costInfo,
|
|
||||||
isDownloading,
|
|
||||||
uri,
|
|
||||||
load,
|
|
||||||
play,
|
|
||||||
metadata,
|
|
||||||
} = props;
|
|
||||||
|
|
||||||
const playable = autoplay && playingUri !== uri && metadata && !metadata.nsfw;
|
const playable = autoplay && playingUri !== uri && metadata && !metadata.nsfw;
|
||||||
|
|
||||||
if (playable && costInfo && costInfo.cost === 0 && !fileInfo && !isDownloading) {
|
if (playable && costInfo && costInfo.cost === 0 && !fileInfo && !isDownloading) {
|
||||||
load(uri);
|
|
||||||
play(uri);
|
play(uri);
|
||||||
} else if (playable && fileInfo && fileInfo.blobs_completed > 0) {
|
} else if (playable && fileInfo && fileInfo.blobs_completed > 0) {
|
||||||
play(uri);
|
play(uri);
|
||||||
|
|
Loading…
Add table
Reference in a new issue