Baseflow / Baseflow/XamarinMediaManager

How to manage errors related to the URL or to connectivity?

Open
#791 7 comments 0 reactions 0 assignees View on GitHub
Dominant language
C#
Stars
763
Forks
299
PR merge metrics
No merged PRs in 30d

Description

Hello,

I use the **XamarinMediaManager** in a **Xamarin.Forms** project, to play audio from a web radio.

But I would like to manage error cases, like when the URL is no longer available, or if there is not internet access for example.

I launch the audio stream like this:
`var mediaItem = await CrossMediaManager.Current.Play(audioUrl);`

If I use a "wrong" URL, nothing happens, but I didn't found how to "identify" this case. It's the same thing if I activate the airplane mode.

I would like to display an error message to the user in both cases, so he could understand why the audio doesn't launch.

Is there a way to manage this?

Contributor guide

Open the contributing guide

Research direction

Start at the CrossMediaManager.Current.Play(audioUrl) call and trace how invalid URLs and unavailable connectivity are reported across the media platforms. Check the existing error or playback event APIs and their documentation. Done means both failure cases expose a distinguishable result or notification that the Xamarin.Forms app can use to show an error message.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
mobile
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.