Skip to content

Conversation

@tomislav-arambasic
Copy link
Contributor

@tomislav-arambasic tomislav-arambasic commented Aug 11, 2025

Added a custom user-agent string to prevent 403 errors when playing Live365 streams using Media3.

Resolves #2495.

Issue

Some streams require user-agent to be defined. Such as
https://streaming.live365.com/a39417 & https://streaming.live365.com/a62429.
Starting those streams with new media3 implementation resulted in playback error

{
    "message": "Source error",
    "code": "android-io-bad-http-status"
}

Tested in example app, on various emulators, physical devices and on different Android versions & Android Studio versions... Same issue everywhere.
main branch did work as expected, streams played in all scenarios.

After looking into it, server was throwing 403 - Forbidden for media3 implementation.

Native error in media3 exoplayer:
Screenshot 2025-08-11 at 11 45 53

Fix

Added default user-agent to comply with those restrictions.

Users are still able to override user-agent, by defining it inside track object.

Example:

{
    "url": "https://das-edge11-live365-dal03.cdnstream.com/a39417",
    "title": "Radio Stream 1",
    "artist": "Not Working",
    "artwork": "https://rntp.dev/example/smooth-jazz-24-7.jpeg",
    "isLiveStream": true,
    "userAgent": "TestUserAgent"
  }

Verified in example app, running on Motorola g34 5G, Android 14.

Added a custom user-agent string to prevent 403 errors when playing Live365 streams using Media3.
@tomislav-arambasic tomislav-arambasic changed the title feat(player): add default user-agent for Media3 requests fix(android-media3): add default user-agent for Media3 requests Aug 11, 2025
Copy link
Collaborator

@jspizziri jspizziri left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@tomislav-arambasic this is great! Thanks for running this down and doing the work to resolve it. I've left some feedback.

define default user-agent as per CR  requested change by @jspizziri
@jspizziri jspizziri changed the title fix(android-media3): add default user-agent for Media3 requests fix(android): prevent livestream failures by assigning a default user-agent for Media3 requests Aug 11, 2025
@jspizziri jspizziri merged commit 492d349 into doublesymmetry:feat/media3-newarch Aug 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants