public RetryMonitor(CoreSmoothStreamingMediaElement mediaElement) { // store media element monitoring this.mediaElement = mediaElement; // status timer statusTimer = new DispatcherTimer(); statusTimer.Interval = TimeSpan.FromMilliseconds(1000); statusTimer.Tick += statusTimer_Tick; // retry timer retryTimer = new DispatcherTimer(); retryTimer.Interval = retryInterval; retryTimer.Tick += retryTimer_Tick; // events, note use the base class SmoothStreamingMediaElement // events since SmoothStreamingMediaElement shadows some events SmoothStreamingMediaElement baseMediaElement = (SmoothStreamingMediaElement)mediaElement; baseMediaElement.MediaOpened += mediaElement_MediaOpened; baseMediaElement.MediaEnded += mediaElement_MediaEnded; baseMediaElement.MediaFailed += mediaElement_MediaFailed; //Breaking Change: Moving PDC team from SSME build 604.9 to 604.3 //SmoothStreamingMediaElement.ManifestReady event is no longer //available --Kevin Rohling (11/5/2009 4:20PM) //baseMediaElement.ManifestReady += baseMediaElement_ManifestReady; ResetAutoRetry(); }
public void InitializeComponent() { if (_contentLoaded) { return; } _contentLoaded = true; System.Windows.Application.LoadComponent(this, new System.Uri("/SmfSimplePlayer;component/MainPage.xaml", System.UriKind.Relative)); this.LayoutRoot = ((System.Windows.Controls.Grid)(this.FindName("LayoutRoot"))); this.PlayerRoot = ((SmfSimplePlayer.CustomSmf)(this.FindName("PlayerRoot"))); this.MediaBits = ((Microsoft.SilverlightMediaFramework.Player.CoreSmoothStreamingMediaElement)(this.FindName("MediaBits"))); }