Fixes for PR #486

This commit is contained in:
Feross Aboukhadijeh
2016-05-13 13:21:31 -07:00
parent 792e3430f1
commit ac0574a473

View File

@@ -10,11 +10,6 @@ var Bitfield = require('bitfield')
var TorrentSummary = require('../lib/torrent-summary')
var {dispatch, dispatcher} = require('../lib/dispatcher')
// Handles volume change by wheel
function handleVolumeWheel (e) {
dispatch('changeVolume', (-e.deltaY | e.deltaX) / 500)
}
// Shows a streaming video player. Standard features + Chromecast + Airplay
function Player (state) {
// Show the video as large as will fit in the window, play immediately
@@ -31,6 +26,11 @@ function Player (state) {
`
}
// Handles volume change by wheel
function handleVolumeWheel (e) {
dispatch('changeVolume', (-e.deltaY | e.deltaX) / 500)
}
function renderMedia (state) {
if (!state.server) return
@@ -414,8 +414,7 @@ function renderPlayerControls (state) {
}
elements.push(hx`
<div.volume
onwheel=${handleVolumeWheel}>
<div.volume>
<i.icon.volume-icon onmousedown=${handleVolumeMute}>
${volumeIcon}
</i>
@@ -424,7 +423,6 @@ function renderPlayerControls (state) {
onmousedown=${handleVolumeScrub}
onmouseup=${handleVolumeScrub}
onmousemove=${handleVolumeScrub}
onwheel=${handleVolumeWheel}
style=${volumeStyle}
/>
</div>