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,
|
|
|
|
selectDownloadingCurrentUri,
|
2017-04-27 06:45:02 +02:00
|
|
|
} from 'selectors/content'
|
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) => ({
|
2017-04-27 09:05:41 +02:00
|
|
|
play: () => dispatch(doLoadVideo()),
|
2017-04-23 11:56:50 +02:00
|
|
|
watchVideo: (elem) => dispatch(doWatchVideo()),
|
|
|
|
closeModal: () => dispatch(doCloseModal()),
|
|
|
|
})
|
|
|
|
|
|
|
|
export default connect(select, perform)(Video)
|