|
1 | | -# NewPipe External Player (feature/mx-like-external-player) |
| 1 | +# NewPipe External Player (feature/mx-like-external-player) — updated |
2 | 2 |
|
3 | | -This module provides an ExoPlayer-based external video player which can be used as a system external player: |
4 | | -- Accepts VIEW and SEND intents (http(s) links, text share). |
5 | | -- Basic ExoPlayer integration with PlayerView and controls. |
6 | | -- Picture-in-Picture (PiP) support (Android O+). |
7 | | -- UI skeleton matching typical external players (MX-style quick controls). |
| 3 | +What's in this update: |
| 4 | +- Foreground PlayerService for background playback and persistent MediaStyle notification. |
| 5 | +- MediaSession integration so lockscreen/playback controls work. |
| 6 | +- Activity delegates playback to the service (better lifecycle behavior). |
| 7 | +- Playbook speed control (cycle speeds), subtitle toggle placeholder. |
| 8 | +- Updated manifest to request FOREGROUND_SERVICE permission. |
8 | 9 |
|
9 | | -What is included in this branch: |
10 | | -- external-player module with PlayerActivity, layout, and manifest intent filters. |
11 | | -- build.gradle configured for ExoPlayer. |
12 | | - |
13 | | -Important notes / Limitations: |
14 | | -- Direct YouTube links cannot be played directly by ExoPlayer; YouTube requires stream extraction. This branch includes placeholders and a TODO where the app should call the extractor already present in the main app (NewPipe's extractor) to produce playable stream URLs, or integrate a secure YouTube extraction pipeline. |
15 | | -- DRM, subtitles, audio-only background service, casting, and advanced subtitle selection are not yet implemented in this initial commit. |
16 | | - |
17 | | -Planned next steps / TODOs (can be split to issues): |
18 | | -- Integrate with NewPipe extractor API to handle YouTube pages/IDs -> actual video stream URLs (muxed/dash) (High priority) |
19 | | -- Support background playback and notification controls (media session & notification) |
20 | | -- Support playlists and queueing (play next/previous) |
21 | | -- Add subtitle downloading and selection (TTML/SRT/WebVTT) |
22 | | -- Add audio boost, hardware acceleration toggles, speed control, equalizer integration |
23 | | -- Implement Chromecast / DLNA / Google Cast support |
24 | | -- Improve UX: gestures (seek/surface brightness/volume), aspect-ratio toggles, resume playback |
25 | | -- Add tests and instrumentation tests for intent handling and PiP flows |
| 10 | +Important integration notes: |
| 11 | +- YouTube: ExoPlayer cannot play raw youtube.com/watch?v= links. Use NewPipe's extractor module to transform a YouTube page/ID into direct stream URLs (muxed/DASH) before passing URIs to PlayerService. |
| 12 | +- Subtitles: This is currently a UI placeholder. To implement, supply VTT/SRT/TTML URLs from the extractor and attach the subtitle tracks to ExoPlayer in PlayerService. |
| 13 | +- Audio focus & interruptions: Basic playback is implemented; extend audio focus handling and proper interruption handling for production. |
| 14 | +- Casting, DRM, AD handling, advanced subtitle formats and timing are not in scope for this commit and should be added incrementally. |
26 | 15 |
|
27 | 16 | How to test locally: |
28 | 17 | 1. Add `include ':external-player'` to your root settings.gradle |
29 | | -2. Build and install the app variant or run as a standalone APK and send an ACTION_VIEW intent: |
| 18 | +2. Build and install. |
| 19 | +3. Start a direct HTTP(S) playable URL: |
30 | 20 | adb shell am start -a android.intent.action.VIEW -d "https://www.example.com/video.mp4" org.newpipe.externalplayer/.ExternalPlayerActivity |
31 | | -3. Share a YouTube URL via Android share sheet to the player to validate intent handling (extraction not implemented yet). |
| 21 | +4. Observe playback continues when you press Home (notification appears). Use notification controls to pause/play. |
| 22 | +5. Share a text containing a direct video URL via Android share sheet -> choose NewPipe External Player. |
| 23 | +6. Try the speed button to cycle speeds, and the SUB button to toggle the placeholder. |
32 | 24 |
|
33 | | -Security & privacy notes: |
34 | | -- Do not embed broken/unsafe YouTube extractors. Prefer reusing the app's extractor or server-assisted extraction. Respect Terms of Service where applicable. |
35 | | -- If integrating with YouTube, prefer the app's existing extractor infrastructure to avoid duplicating logic and leaking credentials. |
| 25 | +Next steps: |
| 26 | +- Integrate with the app's extractor to resolve YouTube links into playable stream URLs. |
| 27 | +- Implement subtitles support in PlayerService and UI for subtitle selection. |
| 28 | +- Implement proper audio focus handling and media-button receiver plumbing. |
| 29 | +- Add instrumentation tests for service lifecycle and notification behavior. |
0 commit comments