示例#1
0
        void smfPlayer_CaptionsVisibilityChanged(object sender, EventArgs e)
        {
            SMFPlayer smfPlayer = sender as SMFPlayer;

            if (CaptionsVisibility != smfPlayer.CaptionsVisibility)
            {
                // only log when the state has changed, this weeds out the initial state
                CaptionsVisibility = smfPlayer.CaptionsVisibility;
                var ccLog = new ClosedCaptionChangedLog(smfPlayer.CaptionsVisibility == FeatureVisibility.Visible);
                healthMonitorLogger.PopulateSimpleVideoLog(ccLog);
                LoggingService.Current.Log(ccLog);
            }
        }
示例#2
0
        /// <summary>
        /// Attaches the SMFPlayer so it can be monitored
        /// </summary>
        public void AttachToSMF(SMFPlayer smfPlayer)
        {
            smfPlayer.LogLevel = LogLevel.Information;
            CaptionsVisibility = smfPlayer.CaptionsVisibility;
            smfPlayer.CaptionsVisibilityChanged += smfPlayer_CaptionsVisibilityChanged;
            smfPlayer.AudioStreamChanged        += smfPlayer_AudioStreamChanged;
            smfPlayer.RetryFailed         += smfPlayer_RetryFailed;
            smfPlayer.RetrySuccessful     += smfPlayer_RetrySuccessful;
            smfPlayer.PlayStateChanged    += smfPlayer_PlayStateChanged;
            smfPlayer.PlaylistItemChanged += smfPlayer_PlaylistItemChanged;
#if PROGRAMMATICCOMPOSITION
            // get a list of logagents from the players generic plugins
            var logAgents = ((IPlayer)smfPlayer).Plugins.OfType <ILogAgent>().ToList();
            // merge the plugins with the existing ones
            LoggingService.Current.Agents = LoggingService.Current.Agents.Concat(logAgents).Distinct();
#endif
        }
        /// <summary>
        /// Attaches the SMFPlayer so it can be monitored
        /// </summary>
        public void AttachToSMF(SMFPlayer smfPlayer)
        {
            smfPlayer.LogLevel = LogLevel.Information;
            CaptionsVisibility = smfPlayer.CaptionsVisibility;
            smfPlayer.CaptionsVisibilityChanged += smfPlayer_CaptionsVisibilityChanged;
            smfPlayer.AudioStreamChanged += smfPlayer_AudioStreamChanged;
            smfPlayer.RetryFailed += smfPlayer_RetryFailed;
            smfPlayer.RetrySuccessful += smfPlayer_RetrySuccessful;
            smfPlayer.PlayStateChanged += smfPlayer_PlayStateChanged;
            smfPlayer.PlaylistItemChanged += smfPlayer_PlaylistItemChanged;
#if PROGRAMMATICCOMPOSITION
            // get a list of logagents from the players generic plugins
            var logAgents = ((IPlayer)smfPlayer).Plugins.OfType<ILogAgent>().ToList();
            // merge the plugins with the existing ones
            LoggingService.Current.Agents = LoggingService.Current.Agents.Concat(logAgents).Distinct();
#endif
        }
 void smfPlayer_CaptionsVisibilityChanged(object sender, EventArgs e)
 {
     SMFPlayer smfPlayer = sender as SMFPlayer;
     if (CaptionsVisibility != smfPlayer.CaptionsVisibility)
     {
         // only log when the state has changed, this weeds out the initial state
         CaptionsVisibility = smfPlayer.CaptionsVisibility;
         var ccLog = new ClosedCaptionChangedLog(smfPlayer.CaptionsVisibility == FeatureVisibility.Visible);
         healthMonitorLogger.PopulateSimpleVideoLog(ccLog);
         LoggingService.Current.Log(ccLog);
     }
 }
示例#5
0
 /// <summary>
 /// Sets <see cref="IPlayerSettings.CaptionsVisibility"/> property of caller <see cref="IPlayerSettings"/> instance to given <see cref="FeatureVisibility"/> value.
 /// </summary>
 /// <param name="playerSettings">Caller <see cref="IPlayerSettings"/> instance.</param>
 /// <param name="visibility">Given <see cref="FeatureVisibility"/> value.</param>
 /// <returns>The caller <see cref="IPlayerSettings"/> instance with <see cref="IPlayerSettings.CaptionsVisibility"/> property setted to given <see cref="FeatureVisibility"/> value.</returns>
 public static IPlayerSettings WithCaptionsVisibility(this IPlayerSettings playerSettings, FeatureVisibility visibility)
 {
     playerSettings.CaptionsVisibility = visibility;
     return playerSettings;
 }
示例#6
0
 /// <summary>
 /// Sets <see cref="IPlayerSettings.PlaylistVisibility"/> property of caller <see cref="IPlayerSettings"/> instance to given <see cref="FeatureVisibility"/> value.
 /// </summary>
 /// <param name="playerSettings">Caller <see cref="IPlayerSettings"/> instance.</param>
 /// <param name="visibility">Given <see cref="FeatureVisibility"/> value.</param>
 /// <returns>The caller <see cref="IPlayerSettings"/> instance with <see cref="IPlayerSettings.PlaylistVisibility"/> property setted to given <see cref="FeatureVisibility"/> value.</returns>
 public static IPlayerSettings WithPlaylistVisibility(this IPlayerSettings playerSettings, FeatureVisibility visibility)
 {
     playerSettings.PlaylistVisibility = visibility;
     return playerSettings;
 }