Fix clicking position links in shownotes (#8477)

### Description

Fix clicking position links in shownotes with new playback service

### Checklist
<!-- 
To help us keep the issue tracker clean and work as efficient as
possible,
  please make sure that you have done all of the following.
You can tick the boxes below by placing an x inside the brackets like
this: [x]
-->
- [x] I have read the contribution guidelines:
https://github.com/AntennaPod/AntennaPod/blob/develop/CONTRIBUTING.md#submit-a-pull-request
- [x] I have performed a self-review of my code, going through my
changes line by line and carefully considering why this line change is
necessary
- [x] I have run the automated code checks using `./gradlew checkstyle
lint`
- [x] My code follows the style guidelines of the AntennaPod project:
https://antennapod.org/contribute/develop/app/code-style
- [x] I have mentioned the corresponding issue and the relevant keyword
(e.g., "Closes: #xy") in the description (see
https://docs.github.com/en/issues/tracking-your-work-with-issues/linking-a-pull-request-to-an-issue)
- [x] If it is a core feature, I have added automated tests
This commit is contained in:
Hans-Peter Lehmann
2026-05-25 22:31:18 +02:00
committed by GitHub
parent 6fb78719f5
commit 2a84466d3f
2 changed files with 15 additions and 2 deletions

View File

@ -24,6 +24,7 @@ import com.skydoves.balloon.ArrowOrientation;
import com.skydoves.balloon.ArrowOrientationRules;
import com.skydoves.balloon.Balloon;
import com.skydoves.balloon.BalloonAnimation;
import de.danoeh.antennapod.BuildConfig;
import de.danoeh.antennapod.R;
import de.danoeh.antennapod.actionbutton.CancelDownloadActionButton;
import de.danoeh.antennapod.actionbutton.DeleteActionButton;
@ -125,6 +126,11 @@ public class ItemFragment extends Fragment {
new MessageEvent(getString(R.string.play_this_to_seek_position_message)));
return;
}
if (BuildConfig.USE_MEDIA3_PLAYBACK_SERVICE) {
PlaybackController.bindToMedia3Service(getActivity(), controller ->
controller.seekTo(time));
return;
}
PlaybackController.bindToService(getActivity(), playbackService -> {
if (item.getMedia() != null && playbackService.getPlayable() != null
&& Objects.equals(item.getMedia().getIdentifier(),

View File

@ -13,6 +13,7 @@ import android.view.ViewGroup;
import androidx.fragment.app.Fragment;
import de.danoeh.antennapod.BuildConfig;
import de.danoeh.antennapod.R;
import de.danoeh.antennapod.event.PlayerStatusEvent;
import de.danoeh.antennapod.playback.service.PlaybackController;
@ -49,9 +50,15 @@ public class ItemDescriptionFragment extends Fragment {
Log.d(TAG, "Creating view");
View root = inflater.inflate(R.layout.item_description_fragment, container, false);
webvDescription = root.findViewById(R.id.webview);
webvDescription.setTimecodeSelectedListener(time ->
webvDescription.setTimecodeSelectedListener(time -> {
if (BuildConfig.USE_MEDIA3_PLAYBACK_SERVICE) {
PlaybackController.bindToMedia3Service(getActivity(), controller ->
controller.seekTo(time));
} else {
PlaybackController.bindToService(getActivity(), playbackService ->
playbackService.seekTo(time)));
playbackService.seekTo(time));
}
});
webvDescription.setPageFinishedListener(() -> {
// Restoring the scroll position might not always work
webvDescription.postDelayed(ItemDescriptionFragment.this::restoreFromPreference, 50);