Skip to content

External player: background service, MediaSession & controls#12761

Closed
osphvdhwj wants to merge 20 commits intoTeamNewPipe:devfrom
osphvdhwj:feature/mx-like-external-player
Closed

External player: background service, MediaSession & controls#12761
osphvdhwj wants to merge 20 commits intoTeamNewPipe:devfrom
osphvdhwj:feature/mx-like-external-player

Conversation

@osphvdhwj
Copy link
Copy Markdown

Adds PlayerService, MediaSession, MediaStyle notification, speed control and subtitle placeholder. TODO: integrate extractor for YouTube streams, subtitle track support, casting, DRM and UX polish.

What's new in this PR:

  • Foreground PlayerService: Background playback with persistent MediaStyle notification
  • MediaSession integration: Lockscreen and system playback controls work properly
  • Service-based architecture: Activity delegates playback to service for better lifecycle behavior
  • Speed control: Button to cycle through playback speeds (1.0x, 1.25x, 1.5x, 2.0x, 0.5x)
  • Subtitle toggle: UI placeholder for future subtitle implementation
  • Updated manifest: Added FOREGROUND_SERVICE permission

Technical details:

  • PlayerService: LifecycleService with ExoPlayer and MediaSession integration
  • MediaNotificationManager: Handles notification creation and media controls
  • ExternalPlayerActivity: Updated with service integration and new UI controls
  • Enhanced layout with speed and subtitle controls

Testing:

  1. Build and install the app
  2. Test with direct video URLs: adb shell am start -a android.intent.action.VIEW -d "https://example.com/video.mp4" org.newpipe.externalplayer/.ExternalPlayerActivity
  3. Verify background playback continues when pressing Home
  4. Test notification controls (play/pause/stop)
  5. Try speed cycling and subtitle toggle

Next steps:

  • Integrate with NewPipe's extractor for YouTube stream resolution
  • Implement actual subtitle support in PlayerService
  • Add proper audio focus handling
  • Add instrumentation tests for service lifecycle

@github-actions github-actions Bot added the size/large PRs with less than 750 changed lines label Nov 1, 2025
@github-actions github-actions Bot added size/giant PRs with more than 750 changed lines and removed size/large PRs with less than 750 changed lines labels Nov 1, 2025
@TobiGr
Copy link
Copy Markdown
Contributor

TobiGr commented Nov 1, 2025

What's the goal of this PR? I don't really understand what you are trying to achive and why you are deleting a lot of code. Please explain what this PR is trying to achive.
Also please not that new features should only be introduced on the refactor branch and not dev. There is also development on our new player library NewPlayer.

@osphvdhwj osphvdhwj closed this by deleting the head repository Nov 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/giant PRs with more than 750 changed lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants