sound-control | A WebExtension to manage browser tabs that play audio | Browser Plugin library
kandi X-RAY | sound-control Summary
kandi X-RAY | sound-control Summary
This is Sound Control, a WebExtension to manage browser tabs that play audio.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of sound-control
sound-control Key Features
sound-control Examples and Code Snippets
Community Discussions
Trending Discussions on sound-control
QUESTION
ANSWER
Answered 2020-Oct-27 at 05:59I got my issue resolved. The culprit was the button's height & width property.
I was giving the image width:50px
( which was child to button) whereas the button ( parent in this case ) was of width:40px
.
Chrome and Firefox seems to handle this width-problem automatically but safari was unable to handle this.
QUESTION
The following component, AudioPlayer
- based on react-media-player
works great in a Gatsby/React dev environment. But it's been hell getting it to build into a React SSR.
AudioPlayer
relies on the window
object to instantiate, which isn't available to Node.js. So, I've had to use Gatsby's custom Webpack config to detect the media player and throw a null loader into the mix. That works well enough:
ANSWER
Answered 2020-Feb-11 at 17:58For future googlers / those interested, the final solution to this issue required a quite a few hoops to jump through on my end. I'll walk through all the things it took on my end, hope this helps others:
AudioPlayer
Component Issues
The reason I think
react-media-player
is especially difficult to get working with an SSR is because it's a collection of components rather than just one you drop in. For my build, I was creating an audio player, so that included the components:Media
,Player
,CurrentTime
,SeekBar
,Duration
,Volume
from thereact-media-player
library and additional componentsPlayPause
andMuteUnmute
.My custom
AudioPlayer
component required three{ typeof window !== 'undefined'}
checks to get my build working and refactoring thepanner
andaudioContext
variables intocomponentDidMount()
. Note, that the firstwindow
check looks formedia
notreact-media-player
, asreact-media-player
never gets called in the render function.
AudioPlayer.js
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install sound-control
Chrome
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page