Ho un componente simile:reagire suono gioco nativo su evento
import React, { Component } from 'react'
import { StyleSheet, Text, View, TouchableOpacity } from 'react-native'
class MovieList extends Component {
handlePress() {
// Play some sound here
}
render() {
const { movie } = this.props
return (
<TouchableOpacity onPress={this.handlePress.bind(this)}>
<View style={styles.movie}>
<Text style={styles.name}>{movie.name}</Text>
<View style={styles.start}>
<Text style={styles.text}>Start</Text>
</View>
</View>
</TouchableOpacity>
)
}
}
Qui quando tocco la view
voglio giocare qualche suono. Ho cercato su google ma non ho trovato nessuna risposta appropriata
C'è comunque la possibilità di riprodurre il suono quando premo qualcosa? Come posso fare questo?
Date un'occhiata a https://github.com/zmxv/react-native-sound lo fa esattamente ciò che serve. –