Sitemap
Andrew Zuo

Andrew Zuo

Nerdy and [maybe too] opinionated. I like tech and have a few apps. Check out my idle game Ctrl C (Cmd C on iOS)

Adding Playback Controller Support To Stratum

4 min readMar 2, 2026

For my RSS reader Stratum, I introduced a feature a while back called autoread. This builds off of the text-to-speech (TTS) feature. I liked TTS but I didn’t want to press the TTS button for every single story. So what if there was an autoread button which would queue a bunch of stories to be read one after each other.

I tried implementing it with some really hacky async thing, and it actually worked surprisingly well. It was only later that I upgraded the app to use queues properly. It also works really well when combined with things like auto AI summaries and auto readability (full text) because it allows you to read RSS stories sort of like a podcast. But there was one problem: it did not integrate with the device’s media controls.

Now, not integrating with the media controls was not really a big deal for a long time. Although that was mostly because autoread was incredibly basic and hacky for a long time. But since then I added a pause option. It’s actually a little interesting how I set it up. The package I use, flutter_tts, has a pause method but no resume method. o.o

So we have to listen to the current position and keep track of where we are in the text. Quite hacky but it works.

And now I would like to be able to use the pause option from my Bluetooth earbuds. This way I could pause the speech if someone tries to talk to me. Right now I have to manually pull out my earbuds which is annoying.

I noticed another problem when I upgraded to an iPhone Air. The iPhone Air has the Dynamic Island. And if you go home from an app actively playing audio, that app goes into the Dynamic Island and looks all fancy with an icon and playback animation.

Press enter or click to view image in full size
Dynamic island music animation

Stratum did not do that with text-to-speech, even though it was playing audio. It just felt weird not seeing Stratum use the Dynamic Island.

Also when you play a YouTube video in Stratum it does use the Dynamic Island. Although it will automatically pause when you leave the app making the Dynamic Island integration useless. I suspect this is because the YouTube player I’m using is actually native. It’s also why Picture in Picture works when you full-screen the video despite me not doing anything to integrate it.

So I looked into how to fix this problem. And I found it. It was actually extremely simple: all I had to use was the audio_service package.

Get Andrew Zuo’s stories in your inbox

Join Medium for free to get updates from this writer.

To use this package all you have to do is create an audio controller class.

Then register it on startup.

Then finally notify the system when the audio state or what you’re currently playing changes.

Then you have to follow the additional instructions in the package’s page to get it working in iOS and Android. And now I can see my articles in the Dynamic Island.

Press enter or click to view image in full size

It was actually surprisingly easy, especially as I don’t support seeking, only play and pause. Of course not having seek controls means I can’t use the media controls to seek to a point in the text-to-speech text. I thought about adding this feature, but it would rely on me saving the audio to a file and then playing it. But why bother? The text-to-speech output is already so short and I’ve never been like, “I wish I could seek to a specific point in the TTS output.” It’s good enough already.

The important thing is that the app uses the Dynamic Island now. Now I’ve always said the Dynamic Island is a gimmick. It physically intrudes into the screen more and you can see the front-facing camera in almost all lighting conditions and you can see the FaceID system in most lighting conditions. But it’s a pretty nice gimmick. And I’m happy that Stratum can take advantage of this now.

You know, recently I’ve been using Stratum a lot while playing my idle game Cmd C, Ctrl C on Android. Because I recently added this difficulty option which allows you to increase difficulty levels in exchange for more rewards. It actually works surprisingly well, you can basically play the game forever now.

And now when I’m doing that I can look at the story artwork being animated on the Dynamic Island. It’s really great. You can try it out in Stratum 5.4.0.

--

--

Andrew Zuo
Andrew Zuo

Written by Andrew Zuo

Nerdy and [maybe too] opinionated. I like tech and have a few apps. Check out my idle game Ctrl C (Cmd C on iOS)