Skip to content

Implement Discord Rich Presence and enhance playback integration#745

Open
PastaHimself wants to merge 90 commits into
A-EDev:mainfrom
PastaHimself:main
Open

Implement Discord Rich Presence and enhance playback integration#745
PastaHimself wants to merge 90 commits into
A-EDev:mainfrom
PastaHimself:main

Conversation

@PastaHimself

@PastaHimself PastaHimself commented Jul 14, 2026

Copy link
Copy Markdown

Description

Adds an optional Discord Rich Presence integration to Flow’s GitHub build.

When enabled, Flow can display the currently playing video, Short, livestream, or music track on the user’s Discord profile. The presence updates as playback changes and is cleared when playback stops, Discord is disconnected, or the feature is disabled.

This change includes:

  • A dedicated Discord Rich Presence settings screen
  • An opt-in toggle that is disabled by default
  • Discord login and account linking
  • Encrypted local storage for the Discord session token
  • Playback details for videos, Shorts, livestreams, and music
  • Presence update throttling and duplicate-update prevention
  • Automatic cleanup when playback stops or the app disconnects
  • Documentation covering setup, privacy, limitations, and troubleshooting
  • Android 16 foreground-service and Media3 threading fixes required for stable playback reporting

The FOSS build does not include Discord Rich Presence and reports the feature as unavailable.

This implementation uses an unofficial Discord Gateway connection rather than Discord OAuth or Discord’s official partner SDK. Users are warned about this before enabling the feature.

No additional build dependencies, Discord client secrets, signing keys, or proprietary SDK files are required.

Fixes: N/A

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How Has This Been Tested?

The following checks were completed:

  • Discord login and account linking were tested successfully
  • Discord presence was tested with normal videos
  • Presence update mapping and throttling were covered by unit tests
  • Discord playback dispatcher regression tests passed
  • GitHub and FOSS unit tests passed
  • GitHub-nightly lint passed
  • GitHub release, GitHub nightly, and FOSS release APKs built successfully
  • Expected APK and artifact upload checks passed
  • Android 16 foreground-service startup was tested
  • Media3 player access was moved to the main thread to prevent wrong-thread crashes

To reproduce:

  1. Install the APK.
  2. Open Flow’s settings and select Discord Rich Presence.
  3. Link a Discord account and enable the feature.
  4. Play a normal video for at least 30 seconds.
  5. Confirm that the video appears on the linked Discord profile.
  6. Repeat with a Short, livestream, and music track.
  7. Seek, pause, resume, and change media to confirm that the presence updates.
  8. Stop playback, disable the feature, or unlink Discord and confirm that the presence is cleared.
  • Discord account linking tested
  • Video, Shorts, livestream, and music presence tested

Checklist

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass with my changes
  • Any dependent changes have been merged and published in downstream modules
IMG_20260714_212533 IMG_20260714_212117

@PastaHimself

PastaHimself commented Jul 16, 2026

Copy link
Copy Markdown
Author

@A-EDev just added android tv support if you don't mind. I'm testing it rn.

@haskidogereborn

Copy link
Copy Markdown

Im waiting for this feature to be merge in latest nightly

@PastaHimself

Copy link
Copy Markdown
Author

Im waiting for this feature to be merge in latest nightly

You can download it, on my forked Version. Just go to to actions.

@A-EDev

A-EDev commented Jul 16, 2026

Copy link
Copy Markdown
Owner

Im waiting for this feature to be merge in latest nightly

You can download it, on my forked Version. Just go to to actions.

you reverted the TV integration?

if you did revert it for now, it is good for this PR. if you want open a new PR for the TV related integration for easier management and testing.
Thanks again for your contribution. i will test the Discord rich presence today and merge it

@PastaHimself

PastaHimself commented Jul 16, 2026

Copy link
Copy Markdown
Author

Im waiting for this feature to be merge in latest nightly

You can download it, on my forked Version. Just go to to actions.

you reverted the TV integration?

if you did revert it for now, it is good for this PR. if you want open a new PR for the TV related integration for easier management and testing. Thanks again for your contribution. i will test the Discord rich presence today and merge it

I merged it back, I was thinking to make a separate one but i got lazy. Don't worry I will thoroughly test the tv integration.

@PastaHimself

Copy link
Copy Markdown
Author

Ah fudge there's a conflict

@PastaHimself

Copy link
Copy Markdown
Author

🤧

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.

3 participants