AudioPlayerAgent.OnError Method

[ This article is for Windows Phone 8 developers. If you’re developing for Windows 10, see the latest documentation. ]

Called when there is an error with playback, such as an audio track not downloading correctly.

Namespace:  Microsoft.Phone.BackgroundAudio
Assembly:  Microsoft.Phone (in Microsoft.Phone.dll)

Syntax

Protected Overridable Sub OnError ( _
    player As BackgroundAudioPlayer, _
    track As AudioTrack, _
    error As Exception, _
    isFatal As Boolean _
)
protected virtual void OnError(
    BackgroundAudioPlayer player,
    AudioTrack track,
    Exception error,
    bool isFatal
)

Parameters

  • isFatal
    Type: System..::.Boolean
    If true, playback cannot continue and playback of the track stops.

Remarks

This method is not guaranteed to be called in all cases. For example, if the background agent itself has an unhandled exception, it does not get called back to handle its own errors.

If you don’t override the OnError(BackgroundAudioPlayer, AudioTrack, Exception, Boolean) method, then it simply calls Abort()()() if the value of isFatal is true; otherwise, it simply calls NotifyComplete()()().

Warning

This API is not supported for Silverlight 8.1 apps.

Version Information

Windows Phone OS

Supported in: 8.1, 8.0, 7.1

Platforms

Windows Phone

See Also

Reference

AudioPlayerAgent Class

Microsoft.Phone.BackgroundAudio Namespace