cancel play on navigate away
This commit is contained in:
parent
e741d5ee27
commit
2dfd071e16
2 changed files with 6 additions and 1 deletions
|
@ -2,7 +2,7 @@ import React from "react";
|
|||
import { connect } from "react-redux";
|
||||
import { doChangeVolume } from "actions/app";
|
||||
import { selectVolume } from "selectors/app";
|
||||
import { doPlayUri } from "actions/content";
|
||||
import { doPlayUri, doSetPlayingUri } from "actions/content";
|
||||
import {
|
||||
makeSelectMetadataForUri,
|
||||
makeSelectContentTypeForUri,
|
||||
|
@ -31,6 +31,7 @@ const select = (state, props) => ({
|
|||
|
||||
const perform = dispatch => ({
|
||||
play: uri => dispatch(doPlayUri(uri)),
|
||||
cancelPlay: () => dispatch(doSetPlayingUri(null)),
|
||||
changeVolume: volume => dispatch(doChangeVolume(volume)),
|
||||
});
|
||||
|
||||
|
|
|
@ -13,6 +13,10 @@ class Video extends React.PureComponent {
|
|||
};
|
||||
}
|
||||
|
||||
componentWillUnmount() {
|
||||
this.props.cancelPlay();
|
||||
}
|
||||
|
||||
isMediaSame(nextProps) {
|
||||
return (
|
||||
this.props.fileInfo &&
|
||||
|
|
Loading…
Reference in a new issue