getting closer...
This commit is contained in:
parent
a015a44c9d
commit
2f409a6cbd
2 changed files with 44 additions and 40 deletions
|
@ -8,15 +8,16 @@ import NsfwOverlay from "component/nsfwOverlay";
|
||||||
class Video extends React.PureComponent {
|
class Video extends React.PureComponent {
|
||||||
constructor(props) {
|
constructor(props) {
|
||||||
super(props);
|
super(props);
|
||||||
console.log("video view props", props);
|
// console.log("video view props", props);
|
||||||
this.state = {
|
this.state = {
|
||||||
showNsfwHelp: false,
|
showNsfwHelp: false,
|
||||||
|
// videoPause: false,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
componentWillReceiveProps() {
|
componentWillReceiveProps(nextProps) {
|
||||||
console.log("!!VIDEO PLAYA RECIEVE PROPS:", this.props);
|
console.log("VIDEO COMPONENT WILL RECIEVE NEXTPROPS:", nextProps);
|
||||||
// console.log("pauseVideo called");
|
// this.setState({videoPause: nextProps.videoPause});
|
||||||
// this.refs.media.children[0].pause();
|
// this.refs.media.children[0].pause();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -63,10 +64,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;
|
||||||
|
@ -102,6 +103,8 @@ class Video extends React.PureComponent {
|
||||||
const poster = metadata.thumbnail;
|
const poster = metadata.thumbnail;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
<div>
|
||||||
|
<p>videoPause: {videoPause}</p>
|
||||||
<div
|
<div
|
||||||
className={klasses.join(" ")}
|
className={klasses.join(" ")}
|
||||||
onMouseEnter={this.handleMouseOver.bind(this)}
|
onMouseEnter={this.handleMouseOver.bind(this)}
|
||||||
|
@ -132,6 +135,7 @@ class Video extends React.PureComponent {
|
||||||
)}
|
)}
|
||||||
{this.state.showNsfwHelp && <NsfwOverlay />}
|
{this.state.showNsfwHelp && <NsfwOverlay />}
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
import * as settings from "constants/settings";
|
import * as settings from "constants/settings";
|
||||||
import { createSelector } from "reselect";
|
import { createSelector } from "reselect";
|
||||||
|
|
||||||
const _selectState = state => state.videoPause || false;
|
const _selectState = state => state.video.videoPause || {};
|
||||||
|
|
||||||
export const selectVideoPause = createSelector(
|
export const selectVideoPause = createSelector(_selectState, state => {
|
||||||
_selectState,
|
console.log("VIDEO PAUSE SELECTOR", state);
|
||||||
state => state.videoPause || false
|
return state.videoPause;
|
||||||
);
|
});
|
||||||
|
|
Loading…
Add table
Reference in a new issue