remove muted
This commit is contained in:
parent
c9e2803519
commit
647044a2b8
|
@ -40,7 +40,6 @@
|
|||
])
|
||||
|
||||
const paused = writable(true)
|
||||
const muted = writableLocalStorage('muted', false)
|
||||
const volume = writableLocalStorage('volume', 100)
|
||||
|
||||
const current = writable(null)
|
||||
|
@ -116,7 +115,6 @@
|
|||
}
|
||||
|
||||
setContext('paused', paused)
|
||||
setContext('muted', muted)
|
||||
setContext('volume', volume)
|
||||
setContext('domain', domain)
|
||||
setContext('hashtags', hashtags)
|
||||
|
|
|
@ -5,7 +5,6 @@
|
|||
id={$current ? $current.media.credentials.id : null}
|
||||
class="playerBig__iframe"
|
||||
paused={$paused}
|
||||
muted={$muted}
|
||||
volume={$volume}
|
||||
bind:ready
|
||||
bind:ended
|
||||
|
@ -51,7 +50,6 @@
|
|||
import Progress from '/components/player/Progress'
|
||||
|
||||
const paused = getContext('paused')
|
||||
const muted = getContext('muted')
|
||||
const volume = getContext('volume')
|
||||
const current = getContext('current')
|
||||
const loading = getContext('loading')
|
||||
|
|
|
@ -19,12 +19,10 @@
|
|||
// input props
|
||||
export let id
|
||||
export let paused
|
||||
export let muted
|
||||
export let volume
|
||||
|
||||
$: load(id)
|
||||
$: setPaused(paused)
|
||||
$: setMuted(muted)
|
||||
$: setVolume(volume)
|
||||
|
||||
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 => {
|
||||
player.setVolume(volume)
|
||||
})
|
||||
|
@ -80,6 +66,10 @@
|
|||
element.id = Math.random().toString(16).slice(2, 8)
|
||||
|
||||
const onReady = ({ target: player }) => {
|
||||
if (player.isMuted()) {
|
||||
player.unMute()
|
||||
}
|
||||
|
||||
run(player)
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue