set playing uri when navigating from the floating player

This commit is contained in:
Sean Yesmunt 2020-04-30 11:05:22 -04:00
parent 49275c298a
commit 554f50802e
2 changed files with 5 additions and 2 deletions

View file

@ -9,7 +9,7 @@ import {
makeSelectStreamingUrlForUriWebProxy,
} from 'redux/selectors/content';
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 FileRenderFloating from './view';
@ -30,6 +30,7 @@ const select = (state, props) => {
const perform = dispatch => ({
closeFloatingPlayer: () => dispatch(doCloseFloatingPlayer(null)),
setPlayingUri: uri => dispatch(doSetPlayingUri(uri)),
});
export default withRouter(connect(select, perform)(FileRenderFloating));

View file

@ -23,6 +23,7 @@ type Props = {
floatingPlayerEnabled: boolean,
closeFloatingPlayer: () => void,
renderMode: string,
setPlayingUri: string => void,
};
export default function FileRenderFloating(props: Props) {
@ -35,6 +36,7 @@ export default function FileRenderFloating(props: Props) {
closeFloatingPlayer,
floatingPlayerEnabled,
renderMode,
setPlayingUri,
} = props;
const isMobile = useIsMobile();
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>
<div className="content__actions">
<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 label={__('Close')}>
<Button onClick={closeFloatingPlayer} icon={ICONS.REMOVE} button="primary" />