Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Display transcript text and follow along the audio #7103

Merged
merged 58 commits into from May 18, 2024

Conversation

tonytamsf
Copy link
Member

@tonytamsf tonytamsf commented Apr 14, 2024

fix #4935

Description

Display contents of podcast:transcript tag as a full dialog view using RecylerView.

  1. When tapping the currently playing transcript paragraph, tapping it will pause or start the podcast
  2. When tapping another paragraph, will skip and start playing
  3. better handling of scrolling, so the user can scroll to future and past and not have the software automatically scroll back to the current stat of the audio

Yet to do

  • allow for copy and pasting
  • allow for sharing and episode at a certain time from the transcript

Future

  • allow for searching for text in the transcript

Image & Video

Version 0.9

Follow audio checkbox

audio.follow.mp4

follow audio

Version 0.1

Screenshot 2024-04-14 at 10 50 34 PM
transcript-window-480.mov

@tonytamsf tonytamsf marked this pull request as draft April 14, 2024 20:58
@Matth7878
Copy link

Matth7878 commented Apr 15, 2024

Nice. A suggestion after looking at the screenshot. I think text should be justified to make it easier to read.

@keunes
Copy link
Member

keunes commented Apr 15, 2024

@Matth7878 Full justified text is only acceptable when hyphenation is applied correctly. Otherwise you get 'rivers' (vertical lanes of white space) which aren't great, especially for folks with dyslexia. I don't know if good hyphenation (which of course is langue-dependant) is doable in Android

Some resources on this:
https://blog.prototypr.io/text-alignment-best-practises-c4114daf1a9b
https://yesimadesigner.com/justification-vs-alignment/
https://uxmovement.com/content/6-surprising-bad-practices-that-hurt-dyslexic-users/

@keunes
Copy link
Member

keunes commented Apr 15, 2024

@tonytamsf Nice! I think I'd put it in a full window, though, instead of a modal. Gives just that little extra space, and with a top bar we get a logical place to add a search icon (in future).

@tonytamsf
Copy link
Member Author

@tonytamsf Nice! I think I'd put it in a full window, though, instead of a modal. Gives just that little extra space, and with a top bar we get a logical place to add a search icon (in future).

@keunes
If we did the full window, do we have to handle any of the player controls like forward, pause?

Thoughts about dialog vs full fragment view @ByteHamster ?

@keunes
Copy link
Member

keunes commented Apr 15, 2024

Hi @tonytamsf

If we did the full window, do we have to handle any of the player controls like forward, pause?

Not in any different way from a dialog, I would say. (I believe we did discuss having player controls but potentially in future.)

Maybe a full screen dialog would be easier to implement than a dedicated fragment?

https://m3.material.io/components/dialogs/specs

Copy link
Member

@ByteHamster ByteHamster left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! It's nice seeing the transcript run by on by own phone. It already works great.

I added a bunch of comments below. The CI server also left a comment about a SpotBugs violation (that's new with the rebase :) )

Copy link
Member Author

@tonytamsf tonytamsf left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

address most comments, still have a few more to go

@keunes
Copy link
Member

keunes commented May 12, 2024

Thanks @tonytamsf!

A few additional comments/thoughts:

  • For me the tickbox seems to not untick automatically on manual scroll.
  • The current segment highlight is better. Just one additional tweak I would like to request: tiny left and right padding (there already seems a top & bottom padding, probably thanks to the line height).
  • When tapping a segment, the timestamps & names are highlighted still. I would change that to only cover the text itself as well.
  • When currently paused, then tapping on a segment initiated playback. I think it would be better to jump position but stay paused (e.g. if you want to share the episode with relevant timestamp).
  • The toggle, refresh and close buttons are not vertically centred in the available space and have a rather small bottom margin.
  • I also had the transcript screen staying empty (as @ByteHamster mentioned), after switching to another app and back, while episode was paused and transcript dialog was shown. Interestingly, tapping the 'close' button made the empty dialog go away and display immediately the (previously rendered?) dialog with text.
  • I'm still wondering if we shouldn't make this a full-screen dialog. Although the current form has been growing on me.
  • I would increase the font size a bit and align it with what we have for the episode description.

@ByteHamster
Copy link
Member

There is still one quirk I don't understand. When opening the dialog for the second time while playing, it crashes. Error message: Inconsistency detected. Invalid item position. The chapters fragment does pretty much the same thing and does not crash. 🤔

@tonytamsf
Copy link
Member Author

There is still one quirk I don't understand. When opening the dialog for the second time while playing, it crashes. Error message: Inconsistency detected. Invalid item position. The chapters fragment does pretty much the same thing and does not crash. 🤔

@ByteHamster Remind me of which podcast you are seeing this? Using Podcasting 2.0, I am not seeing this problem.

@ByteHamster
Copy link
Member

I think I fixed this in 3d09a7c. The problem was that when loading was interrupted, it returned null instead of throwing. This meant that it re-tried loading the chapters (with force network) in an already interrupted thread, which caused a race condition with updating the RecyclerView.

@ByteHamster
Copy link
Member

Looks ready for merging to me. Is there anything open from your side, tony?

@tonytamsf
Copy link
Member Author

Looks ready for merging to me. Is there anything open from your side, tony?

I have one more fix to make the dialog buttons not scroll and disable the refresh button during a refresh.

@tonytamsf
Copy link
Member Author

Looks ready for merging to me. Is there anything open from your side, tony?

I'm ready to merge @ByteHamster now, the refresh button is disabled during a refresh

  • @keunes I think the font size is the same in the dialog compare with the description
  • I see @ByteHamster moved the transcript button to the menu, I'm fine with that during the initial launch, it's hard to discover it though

@tonytamsf
Copy link
Member Author

Thanks @tonytamsf!

A few additional comments/thoughts:

We have addressed all of your comments except the font size, I think they are the same.

@keunes
Copy link
Member

keunes commented May 16, 2024

The transcript button disappeared and it's also not in the overflow menu any-more for me 🫤
I'm testing with Podcasting 2.0 and see there's a transcript tag on the most recent episode.

I also got a crash in the test build when attempting to stream Boostagram Ball for the first time (tapping the stream button after did work). Dunno if related to the chapters.

Environment

Android version: 13
OS version: 5.4.219-qgki-g95eb98a8c435
AntennaPod version: 3.3.2
Model: FP5
Device: FP5
Product: FP5

Crash info

Time: 16-05-2024 08:58:02
AntennaPod version: 3.3.2

StackTrace

java.lang.NullPointerException: Attempt to invoke virtual method 'void android.support.v4.media.session.MediaSessionCompat.setQueue(java.util.List)' on a null object reference
	at de.danoeh.antennapod.playback.service.PlaybackService.lambda$loadQueueForMediaSession$1(PlaybackService.java:364)
	at de.danoeh.antennapod.playback.service.PlaybackService.$r8$lambda$3WT6xURXkVDC9YruKSvbc6mTkWk(Unknown Source:0)
	at de.danoeh.antennapod.playback.service.PlaybackService$$ExternalSyntheticLambda8.accept(Unknown Source:4)
	at io.reactivex.internal.observers.ConsumerSingleObserver.onSuccess(ConsumerSingleObserver.java:62)
	at io.reactivex.internal.operators.single.SingleObserveOn$ObserveOnSingleObserver.run(SingleObserveOn.java:81)
	at io.reactivex.android.schedulers.HandlerScheduler$ScheduledRunnable.run(HandlerScheduler.java:124)
	at android.os.Handler.handleCallback(Handler.java:942)
	at android.os.Handler.dispatchMessage(Handler.java:99)
	at android.os.Looper.loopOnce(Looper.java:201)
	at android.os.Looper.loop(Looper.java:288)
	at android.app.ActivityThread.main(ActivityThread.java:7918)
	at java.lang.reflect.Method.invoke(Native Method)
	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:548)
	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:942)

@tonytamsf
Copy link
Member Author

@keunes that crash looks unrelated, could you tell me which SHA is the AP debug build you are running?

I suspect it is not the right build because the overflow button for transcript is not there

@keunes
Copy link
Member

keunes commented May 16, 2024

Hi @tonytamsf
3.3.2 (37ef84f). I just downloaded the debug build from GH right before testing.

@ByteHamster
Copy link
Member

I see @ByteHamster moved the transcript button to the menu, I'm fine with that during the initial launch, it's hard to discover it though

Yeah, that's because we already have too many toolbar icons for small screens. Having it in the overflow menu is indeed hard to discover but I wanted to merge your PR before we start working on redesigning the player screen

3.3.2 (37ef84f). I just downloaded the debug build from GH right before testing.

That's a weird commit SHA. It doesn't belong to any commit in this PR. Probably some github internal stuff... I can confirm that it is indeed the artifact that can be downloaded here.

I do see the button on my device. Maybe try another episode?

@tonytamsf
Copy link
Member Author

tonytamsf commented May 17, 2024

Hi @tonytamsf
3.3.2 (37ef84f). I just downloaded the debug build from GH right before testing.

@keunes I can see the transcript menu, and Podcasting 2.0 and Bostagram Ball works for me.

Can you uninstall the debug AP and reinstall?

Could you test again? Nothing has changed with the build.

@keunes
Copy link
Member

keunes commented May 17, 2024

Ok, I identified the issue:

  • I imported my database, which already had the known episode. Refreshing the feed after having started streaming the episode: no transcript.
  • Import database, refresh feed, then start streaming: transcript shows.
  • No db import, clean add feed, start streaming: transcript shows.

Not sure if the problematic scenario is supposed to be supported, but it'd be nice.

we already have too many toolbar icons for small screens. Having it in the overflow menu is indeed hard to discover

I'm just thinking: is it possible to switch around the share button and the transcript, while keeping the share visible if there's no transcript? (I.e., can we set a maximum number of icons for in the top bar and let Android figure out which one, depending on button relevance?)

Reason:

  • we want to maintain the same number of buttons,
  • we want to display the share if possible (recently changed to make it always visible),
  • but I would like to make transcript more discoverable when relevant, taking priority over share (which is known already)
    • Given the limited number of episodes with a transcript, if the above can be applied I don't expect any comments about share disappearing. Also because most of the episodes which do have a transcript button probably serve a tech audience.

I wanted to merge your PR before we start working on redesigning the player screen

I fully agree, but can we agree that this should be one of our priorities then? I'm a bit afraid that otherwise most of the podcasting 2.0 stuff will remain with little impact because we can't/don't want to expose them too much.

@ByteHamster
Copy link
Member

Not sure if the problematic scenario is supposed to be supported, but it'd be nice.

I don't think supporting the edge case of importing an old database into the new app and playing before refreshing is a case we have to spend too much time on. Supporting that would complicate things without a real benefit.

I'm just thinking: is it possible to switch around the share button and the transcript, while keeping the share visible if there's no transcript? (I.e., can we set a maximum number of icons for in the top bar and let Android figure out which one, depending on button relevance?)

We already let Android figure out the number. If it thinks there is space for the transcript, it already shows it. I don't think it ever does, though. Maybe on tablets.

I'm not a big fan of displaying the share button in different places for different episodes. That feels a bit inconsistent.

@keunes
Copy link
Member

keunes commented May 17, 2024

I'm not a big fan of displaying the share button in different places for different episodes. That feels a bit inconsistent.

Like I said: the general public probably won't be affected. Also, I wouldn't say they are "different places"; the buttons and overflow menu are right next to each other, both in the end corner of the top app bar.

I am really afraid, and I'm sorry to bring this up again, that the player screen redesign won't be prioritised (because it's a big & complex work, which will linger just like multiple queues) and then all the effort of implementing innovative changes in the ecosystem won't reach their potential. As we always say: workarounds are likely to stay. I would prefer to avoid that transcripts fall victim to this, even at the cost of tiny inconsistency for a minor amount of episodes.

@ByteHamster
Copy link
Member

Considering other new features like podcast:socialinteract, we cannot add them all to the toolbar icons. Even if we decided we want to move the "share" button. If you want to make it more prominent, I would rather add it to the buttons below the cover. It does make the cover smaller, but only if chapters or comments are supported for that episode. Next to chapters and description is a more logical place than next to sleep timer and favorite anyway.

@Matth7878
Copy link

Does having vertical buttons along cover has been considered ? I don't feel it's a good idea because cover won't be centered but it could be a solution to fit more buttons

@tonytamsf
Copy link
Member Author

I am in favor of merging this PR as is, to get it in the hands of real users during beta. I am pretty certain they will have one to two bugs or feature requests before we go live.

@ByteHamster ByteHamster merged commit 1bb3ca4 into AntennaPod:transcript May 18, 2024
6 checks passed
@ByteHamster
Copy link
Member

Thanks! I will rebase and merge the transcript branch now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: Podcast Index / Podcasting 2.0 Anything related to PodcastIndex.org and/or Podcasting 2.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants