remove muted

This commit is contained in:
wryk 2020-02-21 23:32:04 +01:00
parent c9e2803519
commit 647044a2b8
3 changed files with 4 additions and 18 deletions

View File

@ -40,7 +40,6 @@
]) ])
const paused = writable(true) const paused = writable(true)
const muted = writableLocalStorage('muted', false)
const volume = writableLocalStorage('volume', 100) const volume = writableLocalStorage('volume', 100)
const current = writable(null) const current = writable(null)
@ -116,7 +115,6 @@
} }
setContext('paused', paused) setContext('paused', paused)
setContext('muted', muted)
setContext('volume', volume) setContext('volume', volume)
setContext('domain', domain) setContext('domain', domain)
setContext('hashtags', hashtags) setContext('hashtags', hashtags)

View File

@ -5,7 +5,6 @@
id={$current ? $current.media.credentials.id : null} id={$current ? $current.media.credentials.id : null}
class="playerBig__iframe" class="playerBig__iframe"
paused={$paused} paused={$paused}
muted={$muted}
volume={$volume} volume={$volume}
bind:ready bind:ready
bind:ended bind:ended
@ -51,7 +50,6 @@
import Progress from '/components/player/Progress' import Progress from '/components/player/Progress'
const paused = getContext('paused') const paused = getContext('paused')
const muted = getContext('muted')
const volume = getContext('volume') const volume = getContext('volume')
const current = getContext('current') const current = getContext('current')
const loading = getContext('loading') const loading = getContext('loading')

View File

@ -19,12 +19,10 @@
// input props // input props
export let id export let id
export let paused export let paused
export let muted
export let volume export let volume
$: load(id) $: load(id)
$: setPaused(paused) $: setPaused(paused)
$: setMuted(muted)
$: setVolume(volume) $: setVolume(volume)
const { enqueue, run } = queue() const { enqueue, run } = queue()
@ -55,18 +53,6 @@
} }
}) })
const setMuted = muted => enqueue(player => {
if (muted) {
if (!player.isMuted()) {
player.mute()
}
} else {
if (player.isMuted()) {
player.unMute()
}
}
})
const setVolume = volume => enqueue(player => { const setVolume = volume => enqueue(player => {
player.setVolume(volume) player.setVolume(volume)
}) })
@ -80,6 +66,10 @@
element.id = Math.random().toString(16).slice(2, 8) element.id = Math.random().toString(16).slice(2, 8)
const onReady = ({ target: player }) => { const onReady = ({ target: player }) => {
if (player.isMuted()) {
player.unMute()
}
run(player) run(player)
} }