Fixes for PR #486
This commit is contained in:
@@ -10,11 +10,6 @@ var Bitfield = require('bitfield')
|
|||||||
var TorrentSummary = require('../lib/torrent-summary')
|
var TorrentSummary = require('../lib/torrent-summary')
|
||||||
var {dispatch, dispatcher} = require('../lib/dispatcher')
|
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
|
// Shows a streaming video player. Standard features + Chromecast + Airplay
|
||||||
function Player (state) {
|
function Player (state) {
|
||||||
// Show the video as large as will fit in the window, play immediately
|
// 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) {
|
function renderMedia (state) {
|
||||||
if (!state.server) return
|
if (!state.server) return
|
||||||
|
|
||||||
@@ -414,8 +414,7 @@ function renderPlayerControls (state) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
elements.push(hx`
|
elements.push(hx`
|
||||||
<div.volume
|
<div.volume>
|
||||||
onwheel=${handleVolumeWheel}>
|
|
||||||
<i.icon.volume-icon onmousedown=${handleVolumeMute}>
|
<i.icon.volume-icon onmousedown=${handleVolumeMute}>
|
||||||
${volumeIcon}
|
${volumeIcon}
|
||||||
</i>
|
</i>
|
||||||
@@ -424,7 +423,6 @@ function renderPlayerControls (state) {
|
|||||||
onmousedown=${handleVolumeScrub}
|
onmousedown=${handleVolumeScrub}
|
||||||
onmouseup=${handleVolumeScrub}
|
onmouseup=${handleVolumeScrub}
|
||||||
onmousemove=${handleVolumeScrub}
|
onmousemove=${handleVolumeScrub}
|
||||||
onwheel=${handleVolumeWheel}
|
|
||||||
style=${volumeStyle}
|
style=${volumeStyle}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user