mirror of
https://github.com/Dr-Blank/Vaani.git
synced 2026-01-23 02:29:33 +00:00
downloads and offline playback
This commit is contained in:
parent
1c95d1e4bb
commit
c24541f1cd
38 changed files with 1590 additions and 109 deletions
|
|
@ -1,16 +1,16 @@
|
|||
import 'package:riverpod_annotation/riverpod_annotation.dart';
|
||||
import 'package:whispering_pages/api/api_provider.dart';
|
||||
import 'package:whispering_pages/features/player/core/audiobook_player.dart'
|
||||
as abp;
|
||||
as core;
|
||||
|
||||
part 'audiobook_player.g.dart';
|
||||
|
||||
// @Riverpod(keepAlive: true)
|
||||
// abp.AudiobookPlayer audiobookPlayer(
|
||||
// core.AudiobookPlayer audiobookPlayer(
|
||||
// AudiobookPlayerRef ref,
|
||||
// ) {
|
||||
// final api = ref.watch(authenticatedApiProvider);
|
||||
// final player = abp.AudiobookPlayer(api.token!, api.baseUrl);
|
||||
// final player = core.AudiobookPlayer(api.token!, api.baseUrl);
|
||||
|
||||
// ref.onDispose(player.dispose);
|
||||
|
||||
|
|
@ -24,9 +24,12 @@ const playerId = 'audiobook_player';
|
|||
@Riverpod(keepAlive: true)
|
||||
class SimpleAudiobookPlayer extends _$SimpleAudiobookPlayer {
|
||||
@override
|
||||
abp.AudiobookPlayer build() {
|
||||
core.AudiobookPlayer build() {
|
||||
final api = ref.watch(authenticatedApiProvider);
|
||||
final player = abp.AudiobookPlayer(api.token!, api.baseUrl);
|
||||
final player = core.AudiobookPlayer(
|
||||
api.token!,
|
||||
api.baseUrl,
|
||||
);
|
||||
|
||||
ref.onDispose(player.dispose);
|
||||
|
||||
|
|
@ -37,7 +40,7 @@ class SimpleAudiobookPlayer extends _$SimpleAudiobookPlayer {
|
|||
@Riverpod(keepAlive: true)
|
||||
class AudiobookPlayer extends _$AudiobookPlayer {
|
||||
@override
|
||||
abp.AudiobookPlayer build() {
|
||||
core.AudiobookPlayer build() {
|
||||
final player = ref.watch(simpleAudiobookPlayerProvider);
|
||||
|
||||
ref.onDispose(player.dispose);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue