Skip to content

fix(player): client creation - #18008

Merged
alperozturk96 merged 3 commits into
masterfrom
fix/player-client-creation
Nov 11, 2026
Merged

alperozturk96 merged 3 commits into
masterfrom
fix/player-client-creation

Conversation

@alperozturk96

@alperozturk96 alperozturk96 commented Nov 10, 2026 •

Copy link
Copy Markdown
Collaborator

Issue

The app crashed when the media player tried to load a track after the account was removed.

Exception com.nextcloud.client.network.ClientFactory$CreationException:
  at com.nextcloud.client.network.ClientFactoryImpl.createNextcloudClient (ClientFactoryImpl.java:51)
  at com.nextcloud.client.player.media3.datasource.PlaybackDataSourceFactory.createHttpDataSourceFactory (PlaybackDataSourceFactory.kt:48)
  at com.nextcloud.client.player.media3.datasource.PlaybackDataSourceFactory.createUpstreamDataSourceFactory$lambda$0 (PlaybackDataSourceFactory.kt:41)
  at com.nextcloud.client.player.media3.datasource.PlaybackDataSourceFactory$$ExternalSyntheticLambda0.createDataSource (D8$$SyntheticClass)
  at androidx.media3.datasource.cache.CacheDataSource$Factory.createDataSource (CacheDataSource.java:258)
  at com.nextcloud.client.player.media3.datasource.PlaybackDataSourceFactory.createDataSource (PlaybackDataSourceFactory.kt:37)
  at androidx.media3.exoplayer.source.ProgressiveMediaSource.createPeriod (ProgressiveMediaSource.java:435)
  at androidx.media3.exoplayer.source.MaskingMediaPeriod.createPeriod (MaskingMediaPeriod.java:134)
  at androidx.media3.exoplayer.source.MaskingMediaSource.onChildSourceInfoRefreshed (MaskingMediaSource.java:206)
  at androidx.media3.exoplayer.source.WrappingMediaSource.onChildSourceInfoRefreshed (WrappingMediaSource.java:155)
  at androidx.media3.exoplayer.source.WrappingMediaSource.onChildSourceInfoRefreshed (WrappingMediaSource.java:50)
  at androidx.media3.exoplayer.source.CompositeMediaSource.lambda$prepareChildSource$0$androidx-media3-exoplayer-source-CompositeMediaSource (CompositeMediaSource.java:119)
  at androidx.media3.exoplayer.source.CompositeMediaSource$$ExternalSyntheticLambda0.onSourceInfoRefreshed (D8$$SyntheticClass)
  at androidx.media3.exoplayer.source.BaseMediaSource.refreshSourceInfo (BaseMediaSource.java:96)
  at androidx.media3.exoplayer.source.ProgressiveMediaSource.notifySourceInfoRefreshed (ProgressiveMediaSource.java:556)
  at androidx.media3.exoplayer.source.ProgressiveMediaSource.prepareSourceInternal (ProgressiveMediaSource.java:425)
  at androidx.media3.exoplayer.source.BaseMediaSource.prepareSource (BaseMediaSource.java:276)
  at androidx.media3.exoplayer.source.CompositeMediaSource.prepareChildSource (CompositeMediaSource.java:124)
  at androidx.media3.exoplayer.source.WrappingMediaSource.prepareChildSource (WrappingMediaSource.java:241)
  at androidx.media3.exoplayer.source.MaskingMediaSource.createPeriod (MaskingMediaSource.java:120)
  at androidx.media3.exoplayer.MediaSourceList.createPeriod (MediaSourceList.java:341)
  at androidx.media3.exoplayer.MediaPeriodHolder.<init> (MediaPeriodHolder.java:126)
  at androidx.media3.exoplayer.ExoPlayerImplInternal.createMediaPeriodHolder (ExoPlayerImplInternal.java:415)
  at androidx.media3.exoplayer.ExoPlayerImplInternal.$r8$lambda$4ByVomVrDZGMrfXELlhTrFd0naQ (ExoPlayerImplInternal.java)
  at androidx.media3.exoplayer.ExoPlayerImplInternal$$ExternalSyntheticLambda3.create (D8$$SyntheticClass)
  at androidx.media3.exoplayer.MediaPeriodQueue.enqueueNextMediaPeriodHolder (MediaPeriodQueue.java:246)
  at androidx.media3.exoplayer.ExoPlayerImplInternal.maybeUpdateLoadingPeriod (ExoPlayerImplInternal.java:2776)
  at androidx.media3.exoplayer.ExoPlayerImplInternal.updatePeriods (ExoPlayerImplInternal.java:2753)
  at androidx.media3.exoplayer.ExoPlayerImplInternal.doSomeWork (ExoPlayerImplInternal.java:1458)
  at androidx.media3.exoplayer.ExoPlayerImplInternal.handleMessage (ExoPlayerImplInternal.java:765)
  at android.os.Handler.dispatchMessage (Handler.java:102)
  at android.os.Looper.loopOnce (Looper.java:222)
  at android.os.Looper.loop (Looper.java:314)
  at android.os.HandlerThread.run (HandlerThread.java:67)

Changes

-PlaybackDataSourceFactory no longer creates clients. PlaybackDataSource now gets them in open().

  • Uses ClientRepository instead of ClientFactory.
  • Builds the delegate after the client is available.
  • Stores the ownCloud client the same way.

How to test?

  1. Play media
  2. Remove account

Signed-off-by: alperozturk96 <alper_ozturk@proton.me>

# Conflicts:
#	app/src/main/java/com/nextcloud/client/player/media3/datasource/PlaybackDataSourceFactory.kt
Signed-off-by: alperozturk96 <alper_ozturk@proton.me>
@alperozturk96
alperozturk96 force-pushed the fix/player-client-creation branch from 393a6ed to b8f1f54 Compare November 10, 2026 14:08
Signed-off-by: alperozturk96 <alper_ozturk@proton.me>
@github-actions

Copy link
Copy Markdown

📱 QA build

Download app-qa-debug.apk
QR code Open the QR code for this download
Commit 311287b
Version 18008
Available until 7 days after this build

The QA build installs alongside a released Nextcloud app, so you can keep
using your existing install while testing.

Downloading the file requires a GitHub account, so open this link on the
device you want to test on, or transfer the APK to it.

@github-actions

Copy link
Copy Markdown

SpotBugs

CategoryBaseNew
Bad practice2424
Correctness4747
Dodgy code126126
Experimental11
Malicious code vulnerability11
Multithreaded correctness1313
Performance2626
Security1515
Total253253

@codecov

codecov Bot commented Nov 10, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 2.85714% with 34 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
...ent/player/media3/datasource/PlaybackDataSource.kt 0.00% 30 Missing ⚠️
...yer/media3/datasource/PlaybackDataSourceFactory.kt 20.00% 4 Missing ⚠️

📢 Thoughts on this report? Let us know!

@alperozturk96

Copy link
Copy Markdown
Collaborator Author

/backport to stable-35.1.x

@alperozturk96
alperozturk96 merged commit 8b30e73 into master Nov 11, 2026
28 of 30 checks passed
@alperozturk96
alperozturk96 deleted the fix/player-client-creation branch November 11, 2026 14:34
@github-actions

Copy link
Copy Markdown

master-IT test failed, but no output was generated. Maybe a preliminary stage failed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants