Using AdvancedLoggingPlugin with SMFPlayer

Mar 4, 2011 at 10:35 AM

Hi,

I was looking if there is a way to configure AdvancedLoggingPlugin to work with SMFPlayer. I don't see any references to it in the project so I guess it's not built-in. I came up with following.

I override OnMediaPluginLoaded in my derrived player and add following code:

 	   var ssme = ActiveAdaptiveMediaPlugin != null ? ActiveAdaptiveMediaPlugin.VisualElement as SmoothStreamingMediaElement : null;
            
            if (ssme != null && !string.IsNullOrEmpty(LoggingUrl))
            {
                // enable logging
                if (_loggingPlugin == null)
                {
                    _loggingPlugin = new AdvancedLoggingPlugin();
                    _loggingPlugin.SmoothStreamingMediaElement = ssme;
                }
                _loggingPlugin.ApplicationLogUrls = new List<string> { LoggingUrl };
                _loggingPlugin.TimerInterval = LoggingInterval;
            }
            else
            {
                // disable logging
                if (_loggingPlugin != null)
                {
                    _loggingPlugin.SmoothStreamingMediaElement = null;
                    _loggingPlugin = null;
                }
            }

Properties LoggingUrl and LoggingInterval are added on my player class too. Please let me know if there is a better way to handle this.