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

Adds step to prepare() when calling PlayQueueItem #910

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from
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 MediaManager.Forms/MediaManager.Forms.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
<!--<Page Include="Platforms\Uap\**\*.xaml" SubType="Designer" Generator="MSBuild:Compile" />-->
<None Update="**\*.xaml.cs" DependentUpon="%(Filename)" />
<Compile Update="**\*.xaml.cs" DependentUpon="%(Filename)" />
<PackageReference Include="Microsoft.Windows.SDK.BuildTools" Version="10.0.22621.755" />
<PackageReference Include="Microsoft.Windows.SDK.BuildTools" Version="10.0.22621.756" />
<PackageReference Include="Microsoft.WindowsAppSDK" Version="1.2.221209.1" />
</ItemGroup>

Expand Down
15 changes: 5 additions & 10 deletions MediaManager/Platforms/Android/MediaManagerImplementation.cs
Original file line number Diff line number Diff line change
Expand Up @@ -290,17 +290,9 @@ public override async Task<bool> PlayPrevious()
return false;
}

public override async Task<bool> PlayQueueItem(IMediaItem mediaItem)
public override Task<bool> PlayQueueItem(IMediaItem mediaItem)
{
await EnsureInit();

if (mediaItem == null || !Queue.Contains(mediaItem))
return false;

Queue.CurrentIndex = Queue.IndexOf(mediaItem);

MediaController.GetTransportControls().SkipToQueueItem(Queue.IndexOf(mediaItem));
return true;
return PlayQueueItem(Queue.IndexOf(mediaItem));
}

public override async Task<bool> PlayQueueItem(int index)
Expand All @@ -313,6 +305,9 @@ public override async Task<bool> PlayQueueItem(int index)

Queue.CurrentIndex = index;

if (this.IsStopped())
MediaController.GetTransportControls().Prepare();

MediaController.GetTransportControls().SkipToQueueItem(index);
return true;
}
Expand Down