diff --git a/src/renderer/components/header.js b/src/renderer/components/header.js
index 0a297306..8aad88c7 100644
--- a/src/renderer/components/header.js
+++ b/src/renderer/components/header.js
@@ -6,7 +6,10 @@ class Header extends React.Component {
render () {
const loc = this.props.state.location
return (
-
+
{this.getTitle()}
2000 &&
- !state.playing.isPaused &&
- state.playing.location === 'local'
+ const hideControls = state.shouldHidePlayerControls()
if (hideControls !== state.playing.hideControls) {
state.playing.hideControls = hideControls
@@ -230,7 +226,7 @@ module.exports = class PlaybackController {
}
// Starts WebTorrent server for media streaming
- startServer (torrentSummary, cb) {
+ startServer (torrentSummary) {
if (torrentSummary.status === 'paused') {
dispatch('startTorrentingSummary', torrentSummary.torrentKey)
ipcRenderer.once('wt-ready-' + torrentSummary.infoHash,
diff --git a/src/renderer/lib/state.js b/src/renderer/lib/state.js
index bac5a7e3..dddc4279 100644
--- a/src/renderer/lib/state.js
+++ b/src/renderer/lib/state.js
@@ -73,7 +73,8 @@ function getDefaultState () {
*/
getPlayingTorrentSummary,
getPlayingFileSummary,
- getExternalPlayerName
+ getExternalPlayerName,
+ shouldHidePlayerControls
}
}
@@ -180,6 +181,16 @@ function getExternalPlayerName () {
return path.basename(playerPath).split('.')[0]
}
+function shouldHidePlayerControls () {
+ return this.location.url() === 'player' &&
+ this.playing.mouseStationarySince !== 0 &&
+ new Date().getTime() - this.playing.mouseStationarySince > 2000 &&
+ !this.playing.mouseInControls &&
+ !this.playing.isPaused &&
+ this.playing.location === 'local' &&
+ this.playing.playbackRate === 1
+}
+
function load (cb) {
appConfig.read(function (err, saved) {
if (err || !saved.version) {
diff --git a/src/renderer/main.js b/src/renderer/main.js
index 4407abb9..814fb08c 100644
--- a/src/renderer/main.js
+++ b/src/renderer/main.js
@@ -222,6 +222,8 @@ const dispatchHandlers = {
'mediaSuccess': () => controllers.media.mediaSuccess(),
'mediaTimeUpdate': () => controllers.media.mediaTimeUpdate(),
'mediaMouseMoved': () => controllers.media.mediaMouseMoved(),
+ 'mediaControlsMouseEnter': () => controllers.media.controlsMouseEnter(),
+ 'mediaControlsMouseLeave': () => controllers.media.controlsMouseLeave(),
'openExternalPlayer': () => controllers.media.openExternalPlayer(),
'externalPlayerNotFound': () => controllers.media.externalPlayerNotFound(),
diff --git a/src/renderer/pages/app.js b/src/renderer/pages/app.js
index 3b26db39..40cec158 100644
--- a/src/renderer/pages/app.js
+++ b/src/renderer/pages/app.js
@@ -43,12 +43,7 @@ class App extends React.Component {
// * The mouse is over the controls or we're scrubbing (see CSS)
// * The video is paused
// * The video is playing remotely on Chromecast or Airplay
- const hideControls = state.location.url() === 'player' &&
- state.playing.mouseStationarySince !== 0 &&
- new Date().getTime() - state.playing.mouseStationarySince > 2000 &&
- !state.playing.isPaused &&
- state.playing.location === 'local' &&
- state.playing.playbackRate === 1
+ const hideControls = state.shouldHidePlayerControls()
const cls = [
'view-' + state.location.url(), /* e.g. view-home, view-player */
diff --git a/src/renderer/pages/player-page.js b/src/renderer/pages/player-page.js
index 5e7032c6..6db4d6bf 100644
--- a/src/renderer/pages/player-page.js
+++ b/src/renderer/pages/player-page.js
@@ -438,7 +438,7 @@ function renderPlayerControls (state) {
]
if (state.playing.type === 'video') {
- // show closed captions icon
+ // Show closed captions icon
elements.push((
))
- // render playback rate
+ // Render playback rate
if (state.playing.playbackRate !== 1) {
elements.push((
@@ -543,7 +541,9 @@ function renderPlayerControls (state) {
}
return (
-
+
{elements}
{renderCastOptions(state)}
{renderSubtitleOptions(state)}