getting closer

This commit is contained in:
Travis Eden 2017-12-18 17:44:04 -05:00
parent bd3aa1b349
commit 11ee87829d
3 changed files with 28 additions and 19 deletions

View file

@ -14,7 +14,7 @@ import {
} from "redux/selectors/file_info"; } from "redux/selectors/file_info";
import { makeSelectCostInfoForUri } from "redux/selectors/cost_info"; import { makeSelectCostInfoForUri } from "redux/selectors/cost_info";
import { selectShowNsfw } from "redux/selectors/settings"; import { selectShowNsfw } from "redux/selectors/settings";
import { selectVideoPause } from "redux/selectors/video"; // import { selectVideoPause } from "redux/selectors/video";
import Video from "./view"; import Video from "./view";
import { selectPlayingUri } from "redux/selectors/content"; import { selectPlayingUri } from "redux/selectors/content";
@ -28,7 +28,7 @@ const select = (state, props) => ({
playingUri: selectPlayingUri(state), playingUri: selectPlayingUri(state),
contentType: makeSelectContentTypeForUri(props.uri)(state), contentType: makeSelectContentTypeForUri(props.uri)(state),
volume: selectVolume(state), volume: selectVolume(state),
videoPause: selectVideoPause(state), // videoPause: selectVideoPause(state),
}); });
const perform = dispatch => ({ const perform = dispatch => ({

View file

@ -124,9 +124,10 @@ class VideoPlayer extends React.PureComponent {
} }
} }
pauseVideo() { componentWillReceiveProps() {
console.log("pauseVideo called"); console.log("!!VIDEO PLAYA RECIEVE PROPS:", this.props);
this.refs.media.children[0].pause(); // console.log("pauseVideo called");
// this.refs.media.children[0].pause();
} }
componentDidUpdate() { componentDidUpdate() {
@ -176,19 +177,28 @@ class VideoPlayer extends React.PureComponent {
return ( return (
<div> <div>
{["audio", "application"].indexOf(mediaType) !== -1 && <p>videoPause: {videoPause}</p>
(!this.playableType() || hasMetadata) && <div>
!unplayable && <Thumbnail src={poster} className="video-embedded" />} {["audio", "application"].indexOf(mediaType) !== -1 &&
{this.playableType() && (!this.playableType() || hasMetadata) &&
!hasMetadata && !unplayable && (
!unplayable && <LoadingScreen status={noMetadataMessage} />} <Thumbnail src={poster} className="video-embedded" />
{unplayable && ( )}
<LoadingScreen status={unplayableMessage} spinner={false} /> {this.playableType() &&
)} !hasMetadata &&
<div ref="media" className="media" /> !unplayable && <LoadingScreen status={noMetadataMessage} />}
{unplayable && (
<LoadingScreen status={unplayableMessage} spinner={false} />
)}
<div ref="media" className="media" />
</div>
</div> </div>
); );
} }
} }
export default VideoPlayer; const select = (state, props) => ({
videoPause: selectVideoPause(state),
});
export default connect(select, {})(VideoPlayer);

View file

@ -57,10 +57,10 @@ class Video extends React.PureComponent {
changeVolume, changeVolume,
volume, volume,
uri, uri,
videoPause, // videoPause,
} = this.props; } = this.props;
console.log("VIDEO VIEW videoPause:", videoPause); // console.log("VIDEO VIEW videoPause:", videoPause);
const isPlaying = playingUri === uri; const isPlaying = playingUri === uri;
const isReadyToPlay = fileInfo && fileInfo.written_bytes > 0; const isReadyToPlay = fileInfo && fileInfo.written_bytes > 0;
@ -114,7 +114,6 @@ class Video extends React.PureComponent {
downloadCompleted={fileInfo.completed} downloadCompleted={fileInfo.completed}
changeVolume={changeVolume} changeVolume={changeVolume}
volume={volume} volume={volume}
videoPause={videoPause}
/> />
))} ))}
{!isPlaying && ( {!isPlaying && (