void mediaElement_ClipProgressUpdate(object sender, ClipPlaybackEventArgs e) { if (e.Progress == ClipProgress.Start) { SmoothStreamingEvent ssEvent = new SmoothStreamingEvent(); ssEvent.Data1 = e.Context.ClipInformation.ClipUri.ToString(); ssEvent.EventType = EventType.ClipStarted; ssEvent.ClipId = TraceMonitor.GenerateStreamIdentifier(); Enqueue(ssEvent); } else if (e.Progress == ClipProgress.Complete) { SmoothStreamingEvent ssEvent = new SmoothStreamingEvent(); ssEvent.EventType = EventType.ClipEnded; ssEvent.Data1 = e.Context.ClipInformation.ClipUri.ToString(); Enqueue(ssEvent); } }
private void MediaElement_ClipProgressUpdate(object sender, ClipPlaybackEventArgs e) { AdProgress adProgress; #if SILVERLIGHT3 if (AdProgressUpdated != null && SystemExtensions.TryParse(e.Progress.ToString(), true, out adProgress)) #else if (AdProgressUpdated != null && Enum.TryParse(e.Progress.ToString(), true, out adProgress)) #endif { var adContext = new AdContext(e.Context); AdProgressUpdated(this, adContext, adProgress); } }