set playing uri when navigating from the floating player
This commit is contained in:
parent
49275c298a
commit
554f50802e
2 changed files with 5 additions and 2 deletions
|
@ -9,7 +9,7 @@ import {
|
||||||
makeSelectStreamingUrlForUriWebProxy,
|
makeSelectStreamingUrlForUriWebProxy,
|
||||||
} from 'redux/selectors/content';
|
} from 'redux/selectors/content';
|
||||||
import { makeSelectClientSetting } from 'redux/selectors/settings';
|
import { makeSelectClientSetting } from 'redux/selectors/settings';
|
||||||
import { doCloseFloatingPlayer } from 'redux/actions/content';
|
import { doCloseFloatingPlayer, doSetPlayingUri } from 'redux/actions/content';
|
||||||
import { withRouter } from 'react-router';
|
import { withRouter } from 'react-router';
|
||||||
import FileRenderFloating from './view';
|
import FileRenderFloating from './view';
|
||||||
|
|
||||||
|
@ -30,6 +30,7 @@ const select = (state, props) => {
|
||||||
|
|
||||||
const perform = dispatch => ({
|
const perform = dispatch => ({
|
||||||
closeFloatingPlayer: () => dispatch(doCloseFloatingPlayer(null)),
|
closeFloatingPlayer: () => dispatch(doCloseFloatingPlayer(null)),
|
||||||
|
setPlayingUri: uri => dispatch(doSetPlayingUri(uri)),
|
||||||
});
|
});
|
||||||
|
|
||||||
export default withRouter(connect(select, perform)(FileRenderFloating));
|
export default withRouter(connect(select, perform)(FileRenderFloating));
|
||||||
|
|
|
@ -23,6 +23,7 @@ type Props = {
|
||||||
floatingPlayerEnabled: boolean,
|
floatingPlayerEnabled: boolean,
|
||||||
closeFloatingPlayer: () => void,
|
closeFloatingPlayer: () => void,
|
||||||
renderMode: string,
|
renderMode: string,
|
||||||
|
setPlayingUri: string => void,
|
||||||
};
|
};
|
||||||
|
|
||||||
export default function FileRenderFloating(props: Props) {
|
export default function FileRenderFloating(props: Props) {
|
||||||
|
@ -35,6 +36,7 @@ export default function FileRenderFloating(props: Props) {
|
||||||
closeFloatingPlayer,
|
closeFloatingPlayer,
|
||||||
floatingPlayerEnabled,
|
floatingPlayerEnabled,
|
||||||
renderMode,
|
renderMode,
|
||||||
|
setPlayingUri,
|
||||||
} = props;
|
} = props;
|
||||||
const isMobile = useIsMobile();
|
const isMobile = useIsMobile();
|
||||||
const [fileViewerRect, setFileViewerRect] = usePersistedState('inline-file-viewer:rect');
|
const [fileViewerRect, setFileViewerRect] = usePersistedState('inline-file-viewer:rect');
|
||||||
|
@ -116,7 +118,7 @@ export default function FileRenderFloating(props: Props) {
|
||||||
<span className="media__uri--inline">{uri}</span>
|
<span className="media__uri--inline">{uri}</span>
|
||||||
<div className="content__actions">
|
<div className="content__actions">
|
||||||
<Tooltip label={__('View File')}>
|
<Tooltip label={__('View File')}>
|
||||||
<Button navigate={uri} icon={ICONS.VIEW} button="primary" />
|
<Button navigate={uri} onClick={() => setPlayingUri(uri)} icon={ICONS.VIEW} button="primary" />
|
||||||
</Tooltip>
|
</Tooltip>
|
||||||
<Tooltip label={__('Close')}>
|
<Tooltip label={__('Close')}>
|
||||||
<Button onClick={closeFloatingPlayer} icon={ICONS.REMOVE} button="primary" />
|
<Button onClick={closeFloatingPlayer} icon={ICONS.REMOVE} button="primary" />
|
||||||
|
|
Loading…
Add table
Reference in a new issue