Questions tagged [react-native-track-player]

71 questions
1
vote
0 answers

Correctly toggling playback state using react-native-track-player for live audio streaming React Native app (shoutcast)

I can't seem to get react-native-track-player fully working in my radio streaming app (shoutcast). The TouchableOpacity I use to toggle the playback seems to only work after the second press.. Even then, the toggle doesn't seem to work reliably. I…
1
vote
1 answer

Unable to skip to the next track - React-Native-Track-Player

I am currently creating a podcast player feature for one of the apps I am developing. However I've hit a wall with this error which is to update the currentIndex of the array to the next one. This is the array i've created to test out the podcast…
1
vote
0 answers

unable to play local storage music using react-native-track-player

I am trying play music from local storage TrackPlayer.add({ id: '1283', url: "file:///storage/emulated/0/Music/Galliyan___Heart_Touching_Ringtone.mp3", }); TrackPlayer.play(); But it didn't playing ,its working fine when i…
1
vote
1 answer

React native track player fails to add songs to playlist

I am working on a music player in react native and have been using the package react-native-track-player. I have so far not had a problem with the package in android. but when I try to run it on ios I get the error You attempted to set the key0with…
harisu
  • 1,376
  • 8
  • 17
1
vote
1 answer

react-native-track-player Notification area player UI

SAMSUNG's Notification Player At Default Size SAMSUNG's Notification Player At Maximized Size react-native-track-player Default Player Notification Player UI react-native-track-player Maximize Player Notification Player UI I want…
0
votes
0 answers

react native track player duration is not updated on Ios background

In my app I allow the users to choose the duration of sounds : 5 min / 10 min .... until the original duration. When I set the duration to Trackplayer.add() and call getActiveTrack().duration the logs display the right duration choosen by the user.…
J.dev
  • 844
  • 3
  • 12
  • 22
0
votes
0 answers

react-native-track-player TrackPlayer.play() doesn't throw an error if the audio url doesn't work

EDIT: I'm using react-native-track-player": "^3.2.0" I have an issue with "react-native-track-player". The audio files in my app are played via this function: async function setUpNewTrack() { try { await TrackPlayer.reset() await…
stehvanin
  • 11
  • 2
0
votes
0 answers

when I use react-native-track-player, can't play audio

import React, {useEffect, useState} from 'react'; import TrackPlayer, {usePlaybackState} from 'react-native-track-player'; import IconButton from './IconButton'; function Player({url}) { const [iconName, setIconName] = useState('play-circle'); …
0
votes
0 answers

Obtaining music information such as (title, album name, artist name, etc.) in React Native

I am making a music player in React Native using the React-Native-Track-Player library that plays music from the phone's internal storage, so far everything is going well, but when I want music information such as album name, I'm having trouble…
Hamid K72
  • 1
  • 1
0
votes
0 answers

Unable to get the exact position of the track player when the app is in background using react-native-track-player

I want to call an API with the current position of the track player when my app is in background whenever I try to stop the track player from the notification panel. Also how can I kill the track player when I kill the app. I want my track player to…
0
votes
1 answer

react-native-track-player error the player has already been initialized via setupPlayer

I have a react-navigation modal with react-native-track-player, closing one and opening it back throws the error The player has already been initialized via setupPlayer. How to make sure it runs only once? I couldn't find a method to do…
0
votes
1 answer

TrackPlayer Play function is not working for website url instead of local path

I am using React Native Track Player version 3.2. Everything is working properly in Android when I am using local media path instead of the website media url. I am also not getting any error in the log. Here is my TrackPlayer.add snippets as…
0
votes
0 answers

React-native-sound-player not playing audio. No errors in debugger

I was using react-native-sound-player with no issues but its now unsupported and it does not work with android so I converted to react-native-track-player but I'm unable to get it to play audio. The flow I have is the tracks to stream are fetched…
Medic305
  • 283
  • 1
  • 3
  • 11
0
votes
0 answers

React Native Track Player - PlaybackMetadataReceived Event not received

My React Native Track Player app implements its own playlist and I need a custom event to send "Next Event" and "Previous Event" to a component deeper in the component tree. In order to do so, I used (hacked) genre property of…
u2gilles
  • 6,888
  • 7
  • 51
  • 75
0
votes
0 answers

Updating the URL in TrackPlayer

How to update the url in react-native-track-player? The urls I have expire after 3 hours and I would like to be able to update them in case we would like to use the app in the morning and continue the music from where we left. I tried the…
Niroda
  • 320
  • 1
  • 3
  • 13