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

View file

@ -124,9 +124,10 @@ class VideoPlayer extends React.PureComponent {
}
}
pauseVideo() {
console.log("pauseVideo called");
this.refs.media.children[0].pause();
componentWillReceiveProps() {
console.log("!!VIDEO PLAYA RECIEVE PROPS:", this.props);
// console.log("pauseVideo called");
// this.refs.media.children[0].pause();
}
componentDidUpdate() {
@ -176,19 +177,28 @@ class VideoPlayer extends React.PureComponent {
return (
<div>
{["audio", "application"].indexOf(mediaType) !== -1 &&
(!this.playableType() || hasMetadata) &&
!unplayable && <Thumbnail src={poster} className="video-embedded" />}
{this.playableType() &&
!hasMetadata &&
!unplayable && <LoadingScreen status={noMetadataMessage} />}
{unplayable && (
<LoadingScreen status={unplayableMessage} spinner={false} />
)}
<div ref="media" className="media" />
<p>videoPause: {videoPause}</p>
<div>
{["audio", "application"].indexOf(mediaType) !== -1 &&
(!this.playableType() || hasMetadata) &&
!unplayable && (
<Thumbnail src={poster} className="video-embedded" />
)}
{this.playableType() &&
!hasMetadata &&
!unplayable && <LoadingScreen status={noMetadataMessage} />}
{unplayable && (
<LoadingScreen status={unplayableMessage} spinner={false} />
)}
<div ref="media" className="media" />
</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,
volume,
uri,
videoPause,
// videoPause,
} = this.props;
console.log("VIDEO VIEW videoPause:", videoPause);
// console.log("VIDEO VIEW videoPause:", videoPause);
const isPlaying = playingUri === uri;
const isReadyToPlay = fileInfo && fileInfo.written_bytes > 0;
@ -114,7 +114,6 @@ class Video extends React.PureComponent {
downloadCompleted={fileInfo.completed}
changeVolume={changeVolume}
volume={volume}
videoPause={videoPause}
/>
))}
{!isPlaying && (