0

Is it possible to extract Artist / Title with the MediaPlayerElement / MediPlayer / MediaItem Classes in UWP, if it's delivered in the Web Stream? f.e. this URL https://swr-dasding-live.cast.addradio.de/swr/dasding/live/mp3/128/stream.mp3 delivers with the AIMP Radioplayer exactly the Artist / Title. But with my MediaPlayerElement I can't get this. I have already added events to the MediaItem. But they are only triggered the first time and give "0" back.

 using Windows.Media.Core;
 using Windows.Media.Playback;
////////// USINGS ABOVE ///
 MediaPlayer mp = new MediaPlayer();
 MediaSource _mediaSource = MediaSource.CreateFromUri(new Uri(https://swr-dasding-live.cast.addradio.de/swr/dasding/live/mp3/128/stream.mp3"));
 MediaPlaybackItem mpItem = new MediaPlaybackItem(_mediaSource);
 mpItem.AudioTracksChanged += PlaybackItem_AudioTracksChanged;
 mpItem.TimedMetadataTracksChanged += PlaybackItem_TimedMetadataTracksChanged;
 mpItem.VideoTracksChanged += PlaybackItem_VideoTracksChanged;
 mp.Source = mpItem;
 mp.Play();

Hope someone can give me a hint how to get this working. Thanks in advance Christian

TiMeJuMp
  • 353
  • 1
  • 2
  • 14
  • I tested the music from the linked URL, it seems that the information of the music file does not contain the `Artist` and `Title` information. You could use the following code to get `Artist` and `Title` information: `var properties = mpItem.GetDisplayProperties(); var artist = properties.MusicProperties.Artist; var title = properties.MusicProperties.Title;` – YanGu Feb 01 '21 at 06:29
  • f.e. the AIMP player (https://www.microsoft.com/store/productId/9PCLLLH15SMT) can extract the artist and title of the current track. I don't know how this player gets the details :( But they must be included – TiMeJuMp Feb 01 '21 at 13:37
  • You could try to download the web stream to local machine and read the information about Artist or Title for the music file. – YanGu Feb 03 '21 at 09:34

0 Answers0