Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .flutter-plugins-dependencies
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"info":"This is a generated file; do not edit or check into version control.","plugins":{"ios":[{"name":"audio_session","path":"/Users/kaival/.pub-cache/hosted/pub.dev/audio_session-0.1.25/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"flutter_inappwebview_ios","path":"/Users/kaival/.pub-cache/hosted/pub.dev/flutter_inappwebview_ios-1.1.2/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"just_audio","path":"/Users/kaival/.pub-cache/hosted/pub.dev/just_audio-0.9.46/","shared_darwin_source":true,"native_build":true,"dependencies":["audio_session"],"dev_dependency":false},{"name":"path_provider_foundation","path":"/Users/kaival/.pub-cache/hosted/pub.dev/path_provider_foundation-2.4.2/","shared_darwin_source":true,"native_build":true,"dependencies":[],"dev_dependency":false},{"name":"sqflite_darwin","path":"/Users/kaival/.pub-cache/hosted/pub.dev/sqflite_darwin-2.4.2/","shared_darwin_source":true,"native_build":true,"dependencies":[],"dev_dependency":false},{"name":"video_player_avfoundation","path":"/Users/kaival/.pub-cache/hosted/pub.dev/video_player_avfoundation-2.8.4/","shared_darwin_source":true,"native_build":true,"dependencies":[],"dev_dependency":false}],"android":[{"name":"audio_session","path":"/Users/kaival/.pub-cache/hosted/pub.dev/audio_session-0.1.25/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"flutter_inappwebview_android","path":"/Users/kaival/.pub-cache/hosted/pub.dev/flutter_inappwebview_android-1.1.3/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"just_audio","path":"/Users/kaival/.pub-cache/hosted/pub.dev/just_audio-0.9.46/","native_build":true,"dependencies":["audio_session"],"dev_dependency":false},{"name":"path_provider_android","path":"/Users/kaival/.pub-cache/hosted/pub.dev/path_provider_android-2.2.17/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"sqflite_android","path":"/Users/kaival/.pub-cache/hosted/pub.dev/sqflite_android-2.4.2+2/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"video_player_android","path":"/Users/kaival/.pub-cache/hosted/pub.dev/video_player_android-2.8.12/","native_build":true,"dependencies":[],"dev_dependency":false}],"macos":[{"name":"audio_session","path":"/Users/kaival/.pub-cache/hosted/pub.dev/audio_session-0.1.25/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"flutter_inappwebview_macos","path":"/Users/kaival/.pub-cache/hosted/pub.dev/flutter_inappwebview_macos-1.1.2/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"just_audio","path":"/Users/kaival/.pub-cache/hosted/pub.dev/just_audio-0.9.46/","shared_darwin_source":true,"native_build":true,"dependencies":["audio_session"],"dev_dependency":false},{"name":"path_provider_foundation","path":"/Users/kaival/.pub-cache/hosted/pub.dev/path_provider_foundation-2.4.2/","shared_darwin_source":true,"native_build":true,"dependencies":[],"dev_dependency":false},{"name":"sqflite_darwin","path":"/Users/kaival/.pub-cache/hosted/pub.dev/sqflite_darwin-2.4.2/","shared_darwin_source":true,"native_build":true,"dependencies":[],"dev_dependency":false},{"name":"video_player_avfoundation","path":"/Users/kaival/.pub-cache/hosted/pub.dev/video_player_avfoundation-2.8.4/","shared_darwin_source":true,"native_build":true,"dependencies":[],"dev_dependency":false}],"linux":[{"name":"path_provider_linux","path":"/Users/kaival/.pub-cache/hosted/pub.dev/path_provider_linux-2.2.1/","native_build":false,"dependencies":[],"dev_dependency":false}],"windows":[{"name":"flutter_inappwebview_windows","path":"/Users/kaival/.pub-cache/hosted/pub.dev/flutter_inappwebview_windows-0.6.0/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"path_provider_windows","path":"/Users/kaival/.pub-cache/hosted/pub.dev/path_provider_windows-2.3.0/","native_build":false,"dependencies":[],"dev_dependency":false}],"web":[{"name":"audio_session","path":"/Users/kaival/.pub-cache/hosted/pub.dev/audio_session-0.1.25/","dependencies":[],"dev_dependency":false},{"name":"flutter_inappwebview_web","path":"/Users/kaival/.pub-cache/hosted/pub.dev/flutter_inappwebview_web-1.1.2/","dependencies":[],"dev_dependency":false},{"name":"just_audio_web","path":"/Users/kaival/.pub-cache/hosted/pub.dev/just_audio_web-0.4.16/","dependencies":[],"dev_dependency":false},{"name":"video_player_web","path":"/Users/kaival/.pub-cache/hosted/pub.dev/video_player_web-2.4.0/","dependencies":[],"dev_dependency":false}]},"dependencyGraph":[{"name":"audio_session","dependencies":[]},{"name":"flutter_inappwebview","dependencies":["flutter_inappwebview_android","flutter_inappwebview_ios","flutter_inappwebview_macos","flutter_inappwebview_web","flutter_inappwebview_windows"]},{"name":"flutter_inappwebview_android","dependencies":[]},{"name":"flutter_inappwebview_ios","dependencies":[]},{"name":"flutter_inappwebview_macos","dependencies":[]},{"name":"flutter_inappwebview_web","dependencies":[]},{"name":"flutter_inappwebview_windows","dependencies":[]},{"name":"just_audio","dependencies":["just_audio_web","audio_session","path_provider"]},{"name":"just_audio_web","dependencies":[]},{"name":"path_provider","dependencies":["path_provider_android","path_provider_foundation","path_provider_linux","path_provider_windows"]},{"name":"path_provider_android","dependencies":[]},{"name":"path_provider_foundation","dependencies":[]},{"name":"path_provider_linux","dependencies":[]},{"name":"path_provider_windows","dependencies":[]},{"name":"sqflite","dependencies":["sqflite_android","sqflite_darwin"]},{"name":"sqflite_android","dependencies":[]},{"name":"sqflite_darwin","dependencies":[]},{"name":"video_player","dependencies":["video_player_android","video_player_avfoundation","video_player_web"]},{"name":"video_player_android","dependencies":[]},{"name":"video_player_avfoundation","dependencies":[]},{"name":"video_player_web","dependencies":[]}],"date_created":"2025-08-22 16:43:34.662574","version":"3.35.1","swift_package_manager_enabled":{"ios":false,"macos":false}}
{"info":"This is a generated file; do not edit or check into version control.","plugins":{"ios":[{"name":"audio_session","path":"/Users/lucas.campaneruti/.pub-cache/hosted/pub.dev/audio_session-0.2.3/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"flutter_inappwebview_ios","path":"/Users/lucas.campaneruti/.pub-cache/hosted/pub.dev/flutter_inappwebview_ios-1.1.2/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"just_audio","path":"/Users/lucas.campaneruti/.pub-cache/hosted/pub.dev/just_audio-0.10.5/","shared_darwin_source":true,"native_build":true,"dependencies":["audio_session"],"dev_dependency":false},{"name":"path_provider_foundation","path":"/Users/lucas.campaneruti/.pub-cache/hosted/pub.dev/path_provider_foundation-2.6.0/","native_build":false,"dependencies":[],"dev_dependency":false},{"name":"sqflite_darwin","path":"/Users/lucas.campaneruti/.pub-cache/hosted/pub.dev/sqflite_darwin-2.4.2/","shared_darwin_source":true,"native_build":true,"dependencies":[],"dev_dependency":false},{"name":"video_player_avfoundation","path":"/Users/lucas.campaneruti/.pub-cache/hosted/pub.dev/video_player_avfoundation-2.9.4/","shared_darwin_source":true,"native_build":true,"dependencies":[],"dev_dependency":false}],"android":[{"name":"audio_session","path":"/Users/lucas.campaneruti/.pub-cache/hosted/pub.dev/audio_session-0.2.3/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"flutter_inappwebview_android","path":"/Users/lucas.campaneruti/.pub-cache/hosted/pub.dev/flutter_inappwebview_android-1.1.3/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"just_audio","path":"/Users/lucas.campaneruti/.pub-cache/hosted/pub.dev/just_audio-0.10.5/","native_build":true,"dependencies":["audio_session"],"dev_dependency":false},{"name":"path_provider_android","path":"/Users/lucas.campaneruti/.pub-cache/hosted/pub.dev/path_provider_android-2.2.23/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"sqflite_android","path":"/Users/lucas.campaneruti/.pub-cache/hosted/pub.dev/sqflite_android-2.4.2+3/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"video_player_android","path":"/Users/lucas.campaneruti/.pub-cache/hosted/pub.dev/video_player_android-2.9.5/","native_build":true,"dependencies":[],"dev_dependency":false}],"macos":[{"name":"audio_session","path":"/Users/lucas.campaneruti/.pub-cache/hosted/pub.dev/audio_session-0.2.3/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"flutter_inappwebview_macos","path":"/Users/lucas.campaneruti/.pub-cache/hosted/pub.dev/flutter_inappwebview_macos-1.1.2/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"just_audio","path":"/Users/lucas.campaneruti/.pub-cache/hosted/pub.dev/just_audio-0.10.5/","shared_darwin_source":true,"native_build":true,"dependencies":["audio_session"],"dev_dependency":false},{"name":"path_provider_foundation","path":"/Users/lucas.campaneruti/.pub-cache/hosted/pub.dev/path_provider_foundation-2.6.0/","native_build":false,"dependencies":[],"dev_dependency":false},{"name":"sqflite_darwin","path":"/Users/lucas.campaneruti/.pub-cache/hosted/pub.dev/sqflite_darwin-2.4.2/","shared_darwin_source":true,"native_build":true,"dependencies":[],"dev_dependency":false},{"name":"video_player_avfoundation","path":"/Users/lucas.campaneruti/.pub-cache/hosted/pub.dev/video_player_avfoundation-2.9.4/","shared_darwin_source":true,"native_build":true,"dependencies":[],"dev_dependency":false}],"linux":[{"name":"path_provider_linux","path":"/Users/lucas.campaneruti/.pub-cache/hosted/pub.dev/path_provider_linux-2.2.1/","native_build":false,"dependencies":[],"dev_dependency":false}],"windows":[{"name":"flutter_inappwebview_windows","path":"/Users/lucas.campaneruti/.pub-cache/hosted/pub.dev/flutter_inappwebview_windows-0.6.0/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"path_provider_windows","path":"/Users/lucas.campaneruti/.pub-cache/hosted/pub.dev/path_provider_windows-2.3.0/","native_build":false,"dependencies":[],"dev_dependency":false}],"web":[{"name":"audio_session","path":"/Users/lucas.campaneruti/.pub-cache/hosted/pub.dev/audio_session-0.2.3/","dependencies":[],"dev_dependency":false},{"name":"flutter_inappwebview_web","path":"/Users/lucas.campaneruti/.pub-cache/hosted/pub.dev/flutter_inappwebview_web-1.1.2/","dependencies":[],"dev_dependency":false},{"name":"just_audio_web","path":"/Users/lucas.campaneruti/.pub-cache/hosted/pub.dev/just_audio_web-0.4.16/","dependencies":[],"dev_dependency":false},{"name":"video_player_web","path":"/Users/lucas.campaneruti/.pub-cache/hosted/pub.dev/video_player_web-2.4.0/","dependencies":[],"dev_dependency":false}]},"dependencyGraph":[{"name":"audio_session","dependencies":[]},{"name":"flutter_inappwebview","dependencies":["flutter_inappwebview_android","flutter_inappwebview_ios","flutter_inappwebview_macos","flutter_inappwebview_web","flutter_inappwebview_windows"]},{"name":"flutter_inappwebview_android","dependencies":[]},{"name":"flutter_inappwebview_ios","dependencies":[]},{"name":"flutter_inappwebview_macos","dependencies":[]},{"name":"flutter_inappwebview_web","dependencies":[]},{"name":"flutter_inappwebview_windows","dependencies":[]},{"name":"just_audio","dependencies":["just_audio_web","audio_session","path_provider"]},{"name":"just_audio_web","dependencies":[]},{"name":"path_provider","dependencies":["path_provider_android","path_provider_foundation","path_provider_linux","path_provider_windows"]},{"name":"path_provider_android","dependencies":[]},{"name":"path_provider_foundation","dependencies":[]},{"name":"path_provider_linux","dependencies":[]},{"name":"path_provider_windows","dependencies":[]},{"name":"sqflite","dependencies":["sqflite_android","sqflite_darwin"]},{"name":"sqflite_android","dependencies":[]},{"name":"sqflite_darwin","dependencies":[]},{"name":"video_player","dependencies":["video_player_android","video_player_avfoundation","video_player_web"]},{"name":"video_player_android","dependencies":[]},{"name":"video_player_avfoundation","dependencies":[]},{"name":"video_player_web","dependencies":[]}],"date_created":"2026-04-06 09:38:57.193269","version":"3.41.6","swift_package_manager_enabled":{"ios":false,"macos":false}}
24 changes: 12 additions & 12 deletions example/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,10 @@ packages:
dependency: transitive
description:
name: characters
sha256: f71061c654a3380576a52b451dd5532377954cf9dbd272a78fc8479606670803
sha256: faf38497bda5ead2a8c7615f4f7939df04333478bf32e4173fcb06d428b5716b
url: "https://pub.dev"
source: hosted
version: "1.4.0"
version: "1.4.1"
clock:
dependency: transitive
description:
Expand Down Expand Up @@ -283,10 +283,10 @@ packages:
dependency: "direct main"
description:
name: just_audio
sha256: f978d5b4ccea08f267dae0232ec5405c1b05d3f3cd63f82097ea46c015d5c09e
sha256: "9694e4734f515f2a052493d1d7e0d6de219ee0427c7c29492e246ff32a219908"
url: "https://pub.dev"
source: hosted
version: "0.9.46"
version: "0.10.5"
just_audio_platform_interface:
dependency: transitive
description:
Expand Down Expand Up @@ -339,26 +339,26 @@ packages:
dependency: transitive
description:
name: matcher
sha256: dc58c723c3c24bf8d3e2d3ad3f2f9d7bd9cf43ec6feaa64181775e60190153f2
sha256: dc0b7dc7651697ea4ff3e69ef44b0407ea32c487a39fff6a4004fa585e901861
url: "https://pub.dev"
source: hosted
version: "0.12.17"
version: "0.12.19"
material_color_utilities:
dependency: transitive
description:
name: material_color_utilities
sha256: f7142bb1154231d7ea5f96bc7bde4bda2a0945d2806bb11670e30b850d56bdec
sha256: "9c337007e82b1889149c82ed242ed1cb24a66044e30979c44912381e9be4c48b"
url: "https://pub.dev"
source: hosted
version: "0.11.1"
version: "0.13.0"
meta:
dependency: transitive
description:
name: meta
sha256: e3641ec5d63ebf0d9b41bd43201a66e3fc79a65db5f61fc181f04cd27aab950c
sha256: "23f08335362185a5ea2ad3a4e597f1375e78bce8a040df5c600c8d3552ef2394"
url: "https://pub.dev"
source: hosted
version: "1.16.0"
version: "1.17.0"
mime:
dependency: transitive
description:
Expand Down Expand Up @@ -568,10 +568,10 @@ packages:
dependency: transitive
description:
name: test_api
sha256: "522f00f556e73044315fa4585ec3270f1808a4b186c936e612cab0b565ff1e00"
sha256: "8161c84903fd860b26bfdefb7963b3f0b68fee7adea0f59ef805ecca346f0c7a"
url: "https://pub.dev"
source: hosted
version: "0.7.6"
version: "0.7.10"
typed_data:
dependency: transitive
description:
Expand Down
30 changes: 26 additions & 4 deletions lib/src/story_presenter/story_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -237,21 +237,39 @@ class _FlutterStoryPresenterState extends State<FlutterStoryPresenter>
}

if (currentItem.audioConfig != null) {
_audioPlayer?.durationFuture?.then((v) {
_totalAudioDuration = v;
void setupAudioAnimation(Duration duration) {
_totalAudioDuration = duration;
_animationController ??= AnimationController(
vsync: this,
);

_animationController?.duration = v;
_animationController?.duration = duration;

_animationController
?..removeListener(animationListener)
..removeStatusListener(animationStatusListener);

_currentProgressAnimation =
Tween<double>(begin: 0, end: 1).animate(_animationController!)
..addListener(animationListener)
..addStatusListener(animationStatusListener);

_animationController!.forward();
});
}

final audioDuration = _audioPlayer?.duration;
if (audioDuration != null) {
setupAudioAnimation(audioDuration);
} else {
_audioPlayer?.durationStream
.firstWhere((duration) => duration != null)
.then((duration) {
if (!mounted || duration == null) {
return;
}
setupAudioAnimation(duration);
});
}
_audioDurationSubscriptionStream =
_audioPlayer?.positionStream.listen(audioPositionListener);
_audioPlayerStateStream = _audioPlayer?.playerStateStream.listen(
Expand All @@ -276,6 +294,10 @@ class _FlutterStoryPresenterState extends State<FlutterStoryPresenter>
_animationController?.duration =
_currentVideoPlayer?.value.duration ?? currentItem.duration;

_animationController
?..removeListener(animationListener)
..removeStatusListener(animationStatusListener);

_currentProgressAnimation =
Tween<double>(begin: 0, end: 1).animate(_animationController!)
..addListener(animationListener)
Expand Down
3 changes: 1 addition & 2 deletions pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,14 @@ environment:
flutter: ">=1.17.0"

dependencies:

flutter:
sdk: flutter
cached_network_image: ^3.3.1
flutter_cache_manager: ^3.3.1
flutter_hooks: ^0.21.3+1
video_player: ^2.9.1
flutter_inappwebview: ^6.0.0
just_audio: ^0.9.37
just_audio: ^0.10.5

dev_dependencies:
flutter_test:
Expand Down