mirror of
https://github.com/amigan/calls.git
synced 2024-11-21 20:39:47 -05:00
Daniel Ponte
f41790d631
commit56ec3e3c53
Author: Daniel Ponte <amigan@gmail.com> Date: Wed Aug 14 15:49:50 2024 -0400 Fix exception in just_audio_media_kit commitc80625d07e
Author: Daniel Ponte <amigan@gmail.com> Date: Wed Aug 14 15:37:25 2024 -0400 Fix justaudio commitb7af6f28bb
Author: Daniel Ponte <amigan@gmail.com> Date: Wed Aug 14 14:44:18 2024 -0400 use justaudio only commit87d5354943
Author: Daniel Ponte <amigan@gmail.com> Date: Wed Aug 14 14:36:58 2024 -0400 Multiple audio drivers commit1e6b0d0439
Author: Daniel Ponte <amigan@gmail.com> Date: Wed Aug 14 14:08:14 2024 -0400 Fix on macos commit47cca3e3c0
Author: Daniel Ponte <amigan@gmail.com> Date: Wed Aug 14 13:10:12 2024 -0400 osx
35 lines
1.5 KiB
Diff
35 lines
1.5 KiB
Diff
diff -ruN /tmp/just_audio_media_kit/lib/mediakit_player.dart /home/dponte/.pub-cache/hosted/pub.dev/just_audio_media_kit-2.0.5/lib/mediakit_player.dart
|
|
--- /tmp/just_audio_media_kit/lib/mediakit_player.dart 2024-08-14 15:47:51.698551487 -0400
|
|
+++ /home/dponte/.pub-cache/hosted/pub.dev/just_audio_media_kit-2.0.5/lib/mediakit_player.dart 2024-08-14 15:48:02.401944337 -0400
|
|
@@ -35,8 +35,11 @@
|
|
/// [LoadRequest.initialPosition] or [seek] request before [Player.play] was called and/or finished loading.
|
|
Duration? _setPosition;
|
|
|
|
- Media get _currentMedia =>
|
|
- _player.state.playlist.medias[_player.state.playlist.index];
|
|
+ Media? get _currentMedia {
|
|
+ var medias = _player.state.playlist.medias;
|
|
+ if (medias.isEmpty) return null;
|
|
+ return medias[_player.state.playlist.index];
|
|
+ }
|
|
|
|
MediaKitPlayer(super.id) {
|
|
_player = Player(
|
|
@@ -57,7 +60,7 @@
|
|
|
|
_streamSubscriptions = [
|
|
_player.stream.duration.listen((duration) {
|
|
- if (_currentMedia.extras?['overrideDuration'] != null) return;
|
|
+ if (_currentMedia?.extras?['overrideDuration'] != null) return;
|
|
|
|
_processingState = ProcessingStateMessage.ready;
|
|
if (_setPosition != null && duration.inSeconds > 0) {
|
|
@@ -111,7 +114,7 @@
|
|
_currentIndex = playlist.index;
|
|
}
|
|
_updatePlaybackEvent(
|
|
- duration: _currentMedia.extras?['overrideDuration']);
|
|
+ duration: _currentMedia?.extras?['overrideDuration']);
|
|
}),
|
|
_player.stream.playlistMode.listen((playlistMode) {
|
|
_dataController.add(
|