2010-07-11 5 views
1

버퍼링 할 때 간단한 진행률 표시 줄을 표시하는 MediaElement가 있습니다. BufferingProgressChanged 이벤트에서 표시되거나 숨겨집니다. 코드는 아래를 참조하십시오.Silverlight MediaElement 이중 버퍼링

문제는 MediaElement가 두 번 버퍼링하여 진행률 표시 줄을 두 번 표시하는 경우가 많다는 것입니다. 왜 이것이이 문제를 해결할 수있는 방법일까요?

감사합니다.

private void MediaElement_BufferingProgressChanged(object sender, RoutedEventArgs e) 
{ 
    if (MediaElement.CurrentState == MediaElementState.Buffering) 
    { 
     BufferProgressBar.Value = MediaElement.BufferingProgress; 
     BufferGrid.Visibility = System.Windows.Visibility.Visible; 
    } 
    else 
    { 
     BufferGrid.Visibility = System.Windows.Visibility.Collapsed; 
    } 
} 

답변

0

나는 그럼 당신이 재생 또는 버퍼링에서 버퍼링의 여부를 확인 할 수 있습니다, 당신은 MediaElement에의 마지막 상태를 저장하여이 문제를 해결하기 위해 시도 할 수 있다고 생각합니다.

관련 문제