lbry-desktop/ui/js/component/video/index.js

42 lines
1 KiB
JavaScript
Raw Normal View History

2017-04-23 11:56:50 +02:00
import React from 'react'
import {
connect,
} from 'react-redux'
import {
doCloseModal,
} from 'actions/app'
import {
selectCurrentModal,
} from 'selectors/app'
import {
doWatchVideo,
doLoadVideo,
} from 'actions/content'
import {
selectLoadingCurrentUri,
selectCurrentUriFileReadyToPlay,
selectCurrentUriIsPlaying,
2017-04-28 17:14:44 +02:00
selectCurrentUriFileInfo,
selectDownloadingCurrentUri,
} from 'selectors/file_info'
import {
selectCurrentUriCostInfo,
} from 'selectors/cost_info'
2017-04-23 11:56:50 +02:00
import Video from './view'
const select = (state) => ({
costInfo: selectCurrentUriCostInfo(state),
fileInfo: selectCurrentUriFileInfo(state),
modal: selectCurrentModal(state),
isLoading: selectLoadingCurrentUri(state),
readyToPlay: selectCurrentUriFileReadyToPlay(state),
2017-04-27 09:05:41 +02:00
isDownloading: selectDownloadingCurrentUri(state),
2017-04-23 11:56:50 +02:00
})
const perform = (dispatch) => ({
loadVideo: () => dispatch(doLoadVideo()),
2017-04-23 11:56:50 +02:00
watchVideo: (elem) => dispatch(doWatchVideo()),
closeModal: () => dispatch(doCloseModal()),
})
export default connect(select, perform)(Video)