Files
lnreader/specs/NativeTTSMediaControl.ts
T
Rajarshee Chatterjee cc0428752b feat: Replace TTS Notifications with Android MediaSession Controls (Closes #1711)
Replace expo-notifications based TTS controls with a native
NativeTTSMediaControl TurboModule using Android's MediaSessionCompat
and MediaStyle notification. This provides proper media integration
with lock screen controls, cover art display, and seekbar.

- Add NativeTTSMediaControl Kotlin TurboModule with MediaSession
- Support Prev, Rewind, Play/Pause, Next notification buttons
- Show novel cover as notification album art
- Add seekbar with seek-to-element support
- Replace MMKV polling with NativeEventEmitter for instant response
- Add rewind and seekTo methods to TTS in core.js
- Clean up expo-notifications TTS setup from App.tsx

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-20 09:15:54 +05:30

18 lines
528 B
TypeScript

import { TurboModule, TurboModuleRegistry } from 'react-native';
export interface Spec extends TurboModule {
showMediaNotification(
title: string,
subtitle: string,
coverUri: string,
isPlaying: boolean,
): void;
updatePlaybackState(isPlaying: boolean): void;
updateProgress(current: number, total: number): void;
dismiss(): void;
addListener: (eventName: string) => void;
removeListeners: (count: number) => void;
}
export default TurboModuleRegistry.getEnforcing<Spec>('NativeTTSMediaControl');