_reactNativeSound2.default.setCategory is not a function
See original GitHub issueHi -
I just installed React Native Sounds and it seems to work fine. Though, when I try to get the Background Mode working, I get the following error:
_reactNativeSound2.default.setCategory is not a function
My implementation is relatively standard:
import Sound from 'react-native-sound';
export default class playTrack extends Component {
constructor(props) {
super(props);
Sound.setCategory('Ambient', true);
this.play = new Sound(props.trackPath, Sound.MAIN_BUNDLE, (error) => {
if (error) {
console.log('failed to load the sound', error);
} else { // loaded successfully
console.log('duration in seconds: ' + this.play.getDuration() +
'number of channels: ' + this.play.getNumberOfChannels());
}
});
}
Can someone troubleshoot?
Issue Analytics
- State:
- Created 7 years ago
- Reactions:1
- Comments:8 (1 by maintainers)
Top Results From Across the Web
(0, _hoc.default) is not a function. Require cycles are allowed ...
Here is my error went create a HOC use function component instead of class ... ERROR TypeError: (0, _hoc.default) is not a function....
Read more >TypeError Handling in React.js for Map Function | Pluralsight
Learn why this error occurs and how to fix it: Uncaught TypeError: this.props.data.map is not a function.
Read more >Ravenous Part 4 TypeError: default.search is not a function
Deploying my final ravenous project yields this issue: TypeError: util_Yelp__WEBPACK_IMPORTED_MODULE_5_.default.search is not a function.
Read more >'X' is not a function TypeError in React [Solved] | bobbyhadz
The React.js Uncaught TypeError: X is not a function occurs when we try to call a value ... export default function App() {...
Read more >React Error: "this.setstate is not a function" - How to Fix
"this.setstate is not a function" is a common error message that comes up in React. In this article, we'll learn how to fix...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@benvium You were right. For some reason npm updated the module only to 0.8.3. I installed now 0.9.0 from GitHub. I also changed the code according to your suggestion. Unfortunately, both did not fix my issue. The Error now changed to:
Great stuff. Glad you got it going.