Baseflow / XamarinMediaManager

Cross platform Xamarin plugin to play and control Audio and Video
https://baseflow.com
MIT License
769 stars 306 forks source link

iOS: remote mp3 duration is 0, MetadataUpdated doesn't fire #742

Open FutureMillennium opened 4 years ago

FutureMillennium commented 4 years ago

🐛 Bug Report

On iOS in Xamarin.Forms, when playing a remote mp3, Duration is always zero {0:00:00}. Furthermore the MetadataUpdated event doesn't fire, even when metadata is loaded (IsMetadataExtracted is true).

The audio plays, but Duration is always 0. I've tried several mp3s, including the one in the wiki.

Expected behavior

  1. MediaItem.Duration is non-zero after metadata loads. (The example mp3 is 0:04:30)
  2. mediaItem.MetadataUpdated event gets fired when metadata loads.

Reproduction steps

CrossMediaManager.Current.StateChanged += (sender, e) => {
    if (e.State == MediaManager.Player.MediaPlayerState.Playing)
    {
        var duration = CrossMediaManager.Current.Queue.Current.Duration; // Duration is zero {0:00:00}
    }
};

var mediaItem = await CrossMediaManager.Current.Play("https://ia800806.us.archive.org/15/items/Mp3Playlist_555/AaronNeville-CrazyLove.mp3");
mediaItem.MetadataUpdated += (sender, args) => {
    // This never fires on iOS
    var duration = args.MediaItem.Duration;
};

Configuration

Version: 0.9.7 to 0.9.9, Xamarin.Forms 4.7.0 to 4.8.0.1269

Platform:

FetFrumos commented 3 years ago

any news? it is bug