mirror of
https://github.com/Dr-Blank/Vaani.git
synced 2026-02-16 14:29:35 +00:00
播放逻辑修改
This commit is contained in:
parent
420438c0df
commit
50a27fdf67
33 changed files with 788 additions and 761 deletions
|
|
@ -3,7 +3,7 @@ import 'dart:async';
|
|||
import 'package:http/http.dart' as http;
|
||||
import 'package:logging/logging.dart';
|
||||
import 'package:shelfsdk/audiobookshelf_api.dart';
|
||||
import 'package:vaani/features/player/core/audiobook_player.dart';
|
||||
import 'package:vaani/shared/audio_player.dart';
|
||||
import 'package:vaani/shared/extensions/obfuscation.dart';
|
||||
|
||||
final _logger = Logger('PlaybackReporter');
|
||||
|
|
@ -14,7 +14,7 @@ final _logger = Logger('PlaybackReporter');
|
|||
/// and also report when the player is paused/stopped/finished/playing
|
||||
class PlaybackReporter {
|
||||
/// The player to watch
|
||||
final AbsAudioHandler player;
|
||||
final AbsAudioPlayer player;
|
||||
|
||||
/// the api to report to
|
||||
final AudiobookshelfApi authenticatedApi;
|
||||
|
|
@ -75,7 +75,7 @@ class PlaybackReporter {
|
|||
this.markCompleteWhenTimeLeft = const Duration(seconds: 5),
|
||||
}) : _reportingInterval = reportingInterval {
|
||||
// initial conditions
|
||||
if (player.player.playing) {
|
||||
if (player.playing) {
|
||||
_stopwatch.start();
|
||||
_setReportTimerIfNotAlready();
|
||||
_logger.fine('starting stopwatch');
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ import 'dart:async';
|
|||
import 'package:http/http.dart' as http;
|
||||
import 'package:logging/logging.dart';
|
||||
import 'package:shelfsdk/audiobookshelf_api.dart';
|
||||
import 'package:vaani/features/player/core/audiobook_player.dart';
|
||||
import 'package:vaani/shared/audio_player.dart';
|
||||
import 'package:vaani/shared/extensions/obfuscation.dart';
|
||||
|
||||
final _logger = Logger('PlaybackReporter');
|
||||
|
|
@ -14,7 +14,7 @@ final _logger = Logger('PlaybackReporter');
|
|||
/// and also report when the player is paused/stopped/finished/playing
|
||||
class PlaybackReporter {
|
||||
/// The player to watch
|
||||
final AbsAudioHandler player;
|
||||
final AbsAudioPlayer player;
|
||||
|
||||
/// the api to report to
|
||||
final AudiobookshelfApi authenticatedApi;
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ import 'package:riverpod_annotation/riverpod_annotation.dart';
|
|||
import 'package:vaani/api/api_provider.dart';
|
||||
import 'package:vaani/features/playback_reporting/core/playback_reporter.dart'
|
||||
as core;
|
||||
import 'package:vaani/features/player/providers/audiobook_player.dart';
|
||||
import 'package:vaani/features/player/providers/abs_provider.dart';
|
||||
import 'package:vaani/features/settings/app_settings_provider.dart';
|
||||
import 'package:vaani/globals.dart';
|
||||
|
||||
|
|
@ -13,7 +13,7 @@ class PlaybackReporter extends _$PlaybackReporter {
|
|||
@override
|
||||
Future<core.PlaybackReporter> build() async {
|
||||
final playerSettings = ref.watch(appSettingsProvider).playerSettings;
|
||||
final player = ref.watch(playerProvider);
|
||||
final player = ref.watch(absAudioPlayerProvider);
|
||||
final api = ref.watch(authenticatedApiProvider);
|
||||
|
||||
final reporter = core.PlaybackReporter(
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ part of 'playback_reporter_provider.dart';
|
|||
// RiverpodGenerator
|
||||
// **************************************************************************
|
||||
|
||||
String _$playbackReporterHash() => r'23b9770d279d921a5766fc2dda20f76dd3e181ed';
|
||||
String _$playbackReporterHash() => r'13936a7d616e9055388d23fa361519b749c524a3';
|
||||
|
||||
/// See also [PlaybackReporter].
|
||||
@ProviderFor(PlaybackReporter)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue