Skip to content

Commit

Permalink
fix: export controller component
Browse files Browse the repository at this point in the history
  • Loading branch information
xiaoyuhen committed Mar 23, 2020
1 parent 29355aa commit 4918a95
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 11 deletions.
30 changes: 19 additions & 11 deletions packages/griffith/src/components/Controller/Controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ class Controller extends Component {
onVolumeChange: PropTypes.func,
onToggleFullScreen: PropTypes.func,
show: PropTypes.bool,
hiddenQualityMenu: PropTypes.bool,
hiddenVolumeItem: PropTypes.bool,
}

static defaultProps = {
Expand All @@ -42,6 +44,8 @@ class Controller extends Component {
volume: 0.5,
buffered: 0,
isFullScreen: false,
hiddenVolumeItem: false,
hiddenQualityMenu: false,
}

state = {
Expand Down Expand Up @@ -256,6 +260,8 @@ class Controller extends Component {
onDragStart,
onDragEnd,
onToggleFullScreen,
hiddenVolumeItem,
hiddenQualityMenu,
} = this.props
const {
isVolumeHovered,
Expand Down Expand Up @@ -285,17 +291,19 @@ class Controller extends Component {
currentTime={displayedCurrentTime}
duration={duration}
/>
<QualityMenuItem />
<VolumeItem
volume={volume}
menuShown={isVolumeHovered || isVolumeDragging || isVolumeKeyboard}
onMouseEnter={this.handleVolumePointerEnter}
onMouseLeave={this.handleVolumePointerLeave}
onToggleMuted={this.handleToggleMuted}
onDragStart={this.handleVolumeDragStart}
onDragEnd={this.handleVolumeDragEnd}
onChange={this.handleVolumeChange}
/>
{!hiddenQualityMenu && <QualityMenuItem />}
{!hiddenVolumeItem && (
<VolumeItem
volume={volume}
menuShown={isVolumeHovered || isVolumeDragging || isVolumeKeyboard}
onMouseEnter={this.handleVolumePointerEnter}
onMouseLeave={this.handleVolumePointerLeave}
onToggleMuted={this.handleToggleMuted}
onDragStart={this.handleVolumeDragStart}
onDragEnd={this.handleVolumeDragEnd}
onChange={this.handleVolumeChange}
/>
)}
<FullScreenButtonItem
isFullScreen={isFullScreen}
onClick={onToggleFullScreen}
Expand Down
1 change: 1 addition & 0 deletions packages/griffith/src/index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
export {default} from './components/PlayerContainer'
export {ExternalContext as MessageContext} from './contexts/Message'
export {VideoSourceContext} from './contexts/VideoSource'
export {default as Controller} from './components/Controller'
export {default as Layer} from './components/Layer'

0 comments on commit 4918a95

Please sign in to comment.