Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Uses position as int64 #36

Merged
merged 2 commits into from
May 31, 2024
Merged
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 just_audio_windows/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: just_audio_windows
description: Windows platform implementation of just_audio. Implemented using WinRT MediaPlayer
version: 0.2.1
version: 0.2.2
homepage: https://github.com/bdlukaa/just_audio_windows/tree/master/just_audio_windows

environment:
Expand Down
8 changes: 5 additions & 3 deletions just_audio_windows/windows/player.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -337,10 +337,12 @@ class AudioPlayer {
seekToItem((uint32_t)*index);
}

const auto* position = std::get_if<int>(ValueOrNull(*args, "position"));
const auto* position = ValueOrNull(*args, "position");

if (position != nullptr) {
seekToPosition(*position);
seekToPosition((*position).LongValue());
}

result->Success(flutter::EncodableMap());
} else if (method_call.method_name().compare("concatenatingInsertAll") == 0) {
const auto* index = std::get_if<int>(ValueOrNull(*args, "index"));
Expand Down Expand Up @@ -627,7 +629,7 @@ class AudioPlayer {
broadcastState();
}

void AudioPlayer::seekToPosition(int microseconds) {
void AudioPlayer::seekToPosition(int64_t microseconds) {
mediaPlayer.Position(TimeSpan(std::chrono::microseconds(microseconds)));

broadcastState();
Expand Down