Microsoft.PlayerFramework.Adaptive.HLS.HLSPlugin.InitializeController C# (CSharp) Method

InitializeController() private method

Initialize the controller.
private InitializeController ( ) : void
return void
    private void InitializeController()
    {
      try
      {
        if (null != this._Controller && this._Controller.IsValid && null != this._Controller.Playlist)
        {
          this._Controller.Playlist.BitrateSwitchSuggested += this.HLSPlaylist_BitrateSwitchSuggested;
          this._Controller.Playlist.BitrateSwitchCompleted += this.HLSPlaylist_BitrateSwitchCompleted;
          this._Controller.Playlist.BitrateSwitchCancelled += this.HLSPlaylist_BitrateSwitchCancelled;
          this._Controller.Playlist.StreamSelectionChanged += this.HLSPlaylist_StreamSelectionChanged;
          this._Controller.Playlist.SegmentSwitched += this.Playlist_SegmentSwitched;

          if (this.StartupBitrate.HasValue)
            this._Controller.Playlist.StartBitrate = this.StartupBitrate.Value;

          if (this.MinBitrate.HasValue)
            this._Controller.Playlist.MinimumAllowedBitrate = this.MinBitrate.Value;

          if (this.MaxBitrate.HasValue)
            this._Controller.Playlist.MaximumAllowedBitrate = this.MaxBitrate.Value;
        }
      }
      catch { }
    }