I've been trying to develop a ringtone app for windows phone 8. Ringtone are loaded from remote server. when preview button is tapped on, loading indicator is shown then after sometime play sound successfully and loading indicator goes to invisible.
But only for one audio file loading indicator remain visible (though sound is playing).
I debug BufferingProgressChanged and found maximum BufferingProgress value 0.300304 like this.
If that's why loading indicator remain visible. Now how should i do??? please suggest me.
<pre lang="c#"><pre lang="c#">
RingtoneClass selectedRingtone = null;
<pre lang="text"><pre lang="text"><pre lang="text"><pre lang="text">
MediaElement myRingtonePalyer = new MediaElement();
private void playButton_Tap(object sender, System.Windows.Input.GestureEventArgs e)
{
myRingtonePalyer.BufferingProgressChanged += myRingtonePalyer_BufferingProgressChanged;
soundLoading.Visibility = Visibility.Visible;
var element = (FrameworkElement)sender;
selectedRingtone = (Ringtone)element.DataContext;
myRingtonePalyer.Source = new Uri(selectedRingtone.Source, UriKind.RelativeOrAbsolute);
myRingtonePalyer.Play();
}
private void myRingtonePalyer_BufferingProgressChanged(object sender, RoutedEventArgs e)
{
MediaElement m = sender as MediaElement;
double progressValue = m.BufferingProgress;
if progressValue>= 1)
{
soundLoading.Visibility = Visibility.Collapsed;
}
}