-
-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[iOS] Stream error on specific audio #2316
Comments
hows anyone supposed to help if u dont post the media source if it happens to that specific media |
Hello, yes, is a radio stream link => http://91.121.29.128:8068/stream |
u cant use http in android prod unless apecially configed
…On Mon, Jun 3, 2024, 4:14 AM gh-pro ***@***.***> wrote:
hows anyone supposed to help if u dont post the media source if it happens
to that specific media
Hello, yes, is a radio stream link => http://91.121.29.128:8068/stream
—
Reply to this email directly, view it on GitHub
<#2316 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AZMOVVRNZCAM2QPLMJXHVULZFRF3BAVCNFSM6AAAAABIFJNPLKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCNBUHEZTANBWGM>
.
You are receiving this because you commented.Message ID:
***@***.***
com>
|
its work i add android:usesCleartextTraffic="true" |
oh u meant ios. |
@gh-pro I never tried using an HTTP within react-native-track-player in iOS but I did have problems before in other portions of my app, like calling our dev API or even passing an HTTP link as a Lunch URL in a notification through OneSignal, so maybe it is because of that can you try doing what's suggested in this stack overflow answer? https://stackoverflow.com/a/32560433/15986662 |
Hello, yes i try, and not success. |
But i, added this, and its works. "NSAllowsArbitraryLoads" can you, add this require setting on the repos ? thanks you.
|
Hello, i have same issue on this url |
Hi @gh-pro , I tried replicating the issue with your URL and it works fine with .aac, can you provide more detail on when it happens? |
I had the same issue, but only on the iOS Simulator en TrackPater 4.1.1 not on a real iPhone. When I changed to https:// the error was gone on the simulator with this url https://icecast.omroep.nl/3fm-bb-mp3 |
Describe the Bug
An error occured while playing the current track. {"error": "L’opération n’a pas pu s’achever. (SwiftAudioEx.AudioPlayerError.PlaybackError erreur 1.)", "type": "playback-error"}
Steps To Reproduce
After play music an error and no sound only certain audio formats
Code To Reproduce
`import React, {useEffect, useState} from 'react';
import {
Box,
Button,
useColorMode,
Text,
ScrollView,
} from 'native-base';
import {useIsFocused, useNavigation} from '@react-navigation/native';
import TrackPlayer, { useTrackPlayerEvents, Event } from 'react-native-track-player';
// Subscribing to the following events inside MyComponent
const events = [
Event.PlaybackState,
Event.PlaybackError,
];
function HomeScreen() {
const {colorMode} = useColorMode();
const isFocused = useIsFocused();
const [radiosList, setRadiosList] = useState([]);
const [isLoad, setLoad] = useState(true);
async function trackPlayerInit() {
try {
await TrackPlayer.setupPlayer();
return true;
} catch (error) {
return false;
}
}
async function initTrackPlayer() {
await trackPlayerInit();
const radioPLayer = radiosList.map((index, key) => {
return {
url: index.url, // Load media from the file system
title: index.name,
};
});
await TrackPlayer.add(radioPLayer);
console.warn('ok loaded');
}
useEffect(() => {
if (radiosList.length > 0) {
console.warn('ok init trackplayer: ');
}, [isFocused, radiosList]);
useTrackPlayerEvents(events, (event) => {
if (event.type === Event.PlaybackError) {
console.warn('An error occured while playing the current track.', event);
}
if (event.type === Event.PlaybackState) {
// setPlayerState(event.state);
}
});
useEffect(() => {
console.warn('ok focus');
init();
}, [isFocused]);
return (
<Box
safeArea
bg={colorMode === 'light' ? 'coolGray.50' : 'trueGray.900'}
flex={1}>
{!isLoad && (
{radiosList.map((index, key) => {
return (
<Button
onPress={async () => {
await TrackPlayer.skip(key);
console.warn('ok played');
TrackPlayer.play();
const trackIndex = await TrackPlayer.getActiveTrackIndex();
const trackData = await TrackPlayer.getTrack(trackIndex);
console.warn(
'ok track: ',
trackData
);
}}>
{index.name}
);
})}
)}
);
}
export default HomeScreen;
`
Replicable on Example App?
Can you replicate this bug in the React Native Track Player Example App? yes i reproduce
Environment Info:
Paste the results of
info Fetching system and libraries information... System: OS: macOS 13.6 CPU: (10) arm64 Apple M2 Pro Memory: 139.11 MB / 16.00 GB Shell: version: "5.9" path: /bin/zsh Binaries: Node: version: 21.7.3 path: /opt/homebrew/bin/node Yarn: version: 1.22.19 path: /opt/homebrew/bin/yarn npm: version: 10.5.0 path: /opt/homebrew/bin/npm Watchman: version: 2024.05.06.00 path: /opt/homebrew/bin/watchman Managers: CocoaPods: version: 1.15.2 path: /Users/User1/.rbenv/shims/pod SDKs: iOS SDK: Platforms: - DriverKit 23.2 - iOS 17.2 - macOS 14.2 - tvOS 17.2 - visionOS 1.0 - watchOS 10.2 Android SDK: API Levels: - "28" - "29" - "30" - "31" - "32" - "33" - "33" - "33" - "34" Build Tools: - 29.0.2 - 30.0.2 - 30.0.3 - 31.0.0 - 32.0.0 - 33.0.0 - 33.0.1 - 34.0.0 System Images: - android-16 | Intel x86 Atom - android-16 | Google APIs ARM EABI v7a - android-16 | Google APIs Intel x86 Atom - android-29 | Google Play ARM 64 v8a - android-31 | Google TV Intel x86 Atom - android-31 | Google APIs ARM 64 v8a - android-33 | Google APIs ARM 64 v8a - android-33 | Google APIs Intel x86_64 Atom Android NDK: Not Found IDEs: Android Studio: 2023.2 AI-232.10227.8.2321.11479570 Xcode: version: 15.2/15C500b path: /usr/bin/xcodebuild Languages: Java: version: 17.0.10 path: /usr/bin/javac Ruby: version: 2.7.6 path: /Users/User1/.rbenv/shims/ruby npmPackages: "@react-native-community/cli": Not Found react: installed: 18.2.0 wanted: 18.2.0 react-native: installed: 0.72.6 wanted: 0.72.6 react-native-macos: Not Found npmGlobalPackages: "*react-native*": Not Found Android: hermesEnabled: true newArchEnabled: false iOS: hermesEnabled: true newArchEnabled: false
Paste the exact
react-native-track-player
version you are using 4.1.1Real device? Or simulator? Real device
What OS are you running? iOS 17.1
How I can Help
What can you do to help resolve this? I don't know...
Have you investigated the underlying JS or Swift/Android code causing this bug? No
Can you create a Pull Request with a fix? No
The text was updated successfully, but these errors were encountered: