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

Ios doesnt play from queue #896

Open
Novotnde opened this issue Apr 3, 2023 · 0 comments
Open

Ios doesnt play from queue #896

Novotnde opened this issue Apr 3, 2023 · 0 comments

Comments

@Novotnde
Copy link

Novotnde commented Apr 3, 2023

Hello,

i have impelentation of crossmedia manager and i have been experiencing issues with the player on ios. It plays once i pass the file as a parameter but it doesn't if i just add it to the queue and then trz to play. It works very well on android but not on ios. I really don't want to have two implementations. Plus i have been experiencing some buffering on ios.

try
{
    Console.WriteLine("cleaning");
    await CrossMediaManager.Current.Stop();
    CrossMediaManager.Current.Queue.Clear();
    Console.WriteLine("playing " + filename);
    CrossMediaManager.Current.ClearQueueOnPlay = true;
    CrossMediaManager.Current.RepeatMode = RepeatMode.Off;
    CrossMediaManager.Current.Notification.Enabled = false;
    _mediaItem = new MediaItem(filename)
    {
        Album = detail.NameCz,
        AlbumArtist = detail.Narrator,
        DisplayDescription = "description to be filled",
        DisplayTitle = "title to be filled",
        FileName = language + " " + localTrack,
        Title = filename,
        MediaUri = filename,
        Image = ArticleImage
    };
    if (Device.RuntimePlatform == Device.iOS)
       {
            PlayFile(filename);
       }
     else
      {
            CrossMediaManager.Current.Queue.Add(_mediaItem);
            CrossMediaManager.Current.Play();
        }          
}
catch (Exception ex)
{
    _ = LangUpGlobalExceptionHandler.LogException(ex);
    if (LangUpNetworkDelegate.IsOnline)
    {
        NotificationService.ShowToast(
            "Při přehrávání se vyskytla chyba, zkuste to později prosím.");
    }
    else
    {
        NotificationService.ShowToast(
            "Problém s připojením k internetu, zkuste to později prosím.");
    }
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant