2017-12-21 00:38:11 +01:00
|
|
|
// @flow
|
2018-01-08 04:51:34 +01:00
|
|
|
import * as actions from 'constants/action_types';
|
|
|
|
import type { Action, Dispatch } from 'redux/reducers/media';
|
|
|
|
import lbry from 'lbry';
|
|
|
|
import { makeSelectClaimForUri } from 'redux/selectors/claims';
|
2017-12-21 00:38:11 +01:00
|
|
|
|
|
|
|
export const doPlay = () => (dispatch: Dispatch) =>
|
|
|
|
dispatch({
|
|
|
|
type: actions.MEDIA_PLAY,
|
|
|
|
});
|
|
|
|
|
2017-12-23 00:14:54 +01:00
|
|
|
export const doPause = () => (dispatch: Dispatch) =>
|
|
|
|
dispatch({
|
|
|
|
type: actions.MEDIA_PAUSE,
|
|
|
|
});
|
2017-12-21 00:38:11 +01:00
|
|
|
|
2018-01-05 20:29:25 +01:00
|
|
|
export function savePosition(claimId: String, position: Number) {
|
2018-01-05 20:27:58 +01:00
|
|
|
return function(dispatch: Dispatch, getState: Function) {
|
|
|
|
const state = getState();
|
|
|
|
const claim = state.claims.byId[claimId];
|
|
|
|
const outpoint = `${claim.txid}:${claim.nout}`;
|
|
|
|
dispatch({
|
|
|
|
type: actions.MEDIA_POSITION,
|
|
|
|
data: {
|
|
|
|
outpoint,
|
|
|
|
position,
|
|
|
|
},
|
|
|
|
});
|
|
|
|
};
|
|
|
|
}
|