Example #1
0
 /// <summary>
 /// Called when a bitrate switch has been canceled.
 /// </summary>
 /// <param name="sender">The currently playing HLS playlist.</param>
 /// <param name="args">The <see cref="IHLSBitrateSwitchEventArgs"/> that contains the details for the
 /// canceled bitrate switch.</param>
 private void HLSPlaylist_BitrateSwitchCancelled(object sender, IHLSBitrateSwitchEventArgs args)
 {
     if (null != this.BitrateSwitchCancelled)
     {
         this.BitrateSwitchCancelled(sender, args);
     }
 }
Example #2
0
 private void HLSPlaylist_BitrateSwitchCompleted(IHLSPlaylist sender, IHLSBitrateSwitchEventArgs args)
 {
     this.WriteStatsMsgAsync(
         "HLSPlaylist_BitrateSwitchCompleted",
         "from bitrate: {0}, to bitrate: {1}",
         args.FromBitrate, args.ToBitrate);
 }
        void Playlist_BitrateSwitchSuggested(IHLSPlaylist sender, IHLSBitrateSwitchEventArgs args)
        {
            _player.Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, () =>
            {
                try
                {
                    if (args.FromBitrate > args.ToBitrate)
                    {
                        _downshiftPending = true;
                        _upshiftPending   = false;
                    }
                    else
                    {
                        _upshiftPending   = true;
                        _downshiftPending = false;
                    }

                    _targetBitrate = args.ToBitrate;
                    if (PropertyChanged != null)
                    {
                        PropertyChanged(this, new PropertyChangedEventArgs("TargetBitrate"));
                        PropertyChanged(this, new PropertyChangedEventArgs("UpshiftPending"));
                        PropertyChanged(this, new PropertyChangedEventArgs("DownshiftPending"));
                    }
                }
                catch (Exception Ex)
                {
                }
            });
        }
Example #4
0
        /// <summary>
        /// Called after the currently playing HLS playlist has switched bitrates.
        /// </summary>
        /// <param name="sender">The currently playling HLS playlist.</param>
        /// <param name="args">The <see cref="IHLSBitrateSwitchEventArgs"/> that contains the details for the
        /// bitrate switch.  Changes to the Cancel property will be ignored by the HLS Client.</param>
        private async void HLSPlaylist_BitrateSwitchCompleted(object sender, IHLSBitrateSwitchEventArgs args)
        {
            await this.RefreshStateAsync();

            if (null != this.BitrateSwitchCompleted)
            {
                this.BitrateSwitchCompleted(sender, args);
            }
        }
Example #5
0
 void Playlist_BitrateSwitchCancelled(IHLSPlaylist sender, IHLSBitrateSwitchEventArgs args)
 {
     _player.Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, () =>
     {
         _data.IsBitrateShiftPending = false;
         _data.IsBitrateShiftingDown = false;
         _data.IsBitrateShiftingUp   = false;
     });
 }
 void Playlist_BitrateSwitchCancelled(IHLSPlaylist sender, IHLSBitrateSwitchEventArgs args)
 {
     _player.Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, () =>
     {
         _downshiftPending = false;
         _upshiftPending   = false;
         if (PropertyChanged != null)
         {
             PropertyChanged(this, new PropertyChangedEventArgs("UpshiftPending"));
             PropertyChanged(this, new PropertyChangedEventArgs("DownshiftPending"));
         }
     });
 }
Example #7
0
 void Playlist_BitrateSwitchSuggested(IHLSPlaylist sender, IHLSBitrateSwitchEventArgs args)
 {
     _player.Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, () =>
     {
         try
         {
             _data.ToBitrate             = args.ToBitrate;
             _data.IsBitrateShiftingDown = args.FromBitrate > args.ToBitrate;
             _data.IsBitrateShiftingUp   = args.ToBitrate > args.FromBitrate;
             _data.IsBitrateShiftPending = true;
         }
         catch (Exception Ex)
         { }
     });
 }
Example #8
0
 void Playlist_BitrateSwitchCompleted(IHLSPlaylist sender, IHLSBitrateSwitchEventArgs args)
 {
     _player.Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, () =>
     {
         try
         {
             if (_controller != null && _controller.IsValid && _controller.Playlist.IsMaster && _controller.Playlist != null && _controller.Playlist.ActiveVariantStream != null)
             {
                 _data.CurrentBitrate = _controller.Playlist.ActiveVariantStream.Bitrate;
             }
             _data.IsBitrateShiftPending = false;
             _data.IsBitrateShiftingDown = false;
             _data.IsBitrateShiftingUp   = false;
         }
         catch (Exception Ex) { }
     });
 }
 void Playlist_BitrateSwitchCompleted(IHLSPlaylist sender, IHLSBitrateSwitchEventArgs args)
 {
     _player.Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, () =>
     {
         try
         {
             _downshiftPending = false;
             _upshiftPending   = false;
             _currentBitrate   = args.ToBitrate;
             if (PropertyChanged != null)
             {
                 PropertyChanged(this, new PropertyChangedEventArgs("CurrentBitrate"));
                 PropertyChanged(this, new PropertyChangedEventArgs("UpshiftPending"));
                 PropertyChanged(this, new PropertyChangedEventArgs("DownshiftPending"));
             }
         }
         catch (Exception Ex)
         {
         }
     });
 }
    void Playlist_BitrateSwitchCancelled(IHLSPlaylist sender, IHLSBitrateSwitchEventArgs args)
    {
      _player.Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, () =>
      {

        _downshiftPending = false;
        _upshiftPending = false;
        if (PropertyChanged != null)
        {
          PropertyChanged(this, new PropertyChangedEventArgs("UpshiftPending"));
          PropertyChanged(this, new PropertyChangedEventArgs("DownshiftPending"));
        }
      });
    }
Example #11
0
 /// <summary>
 /// Called when a bitrate switch has been canceled.
 /// </summary>
 /// <param name="sender">The currently playing HLS playlist.</param>
 /// <param name="args">The <see cref="IHLSBitrateSwitchEventArgs"/> that contains the details for the 
 /// canceled bitrate switch.</param>
 private void HLSPlaylist_BitrateSwitchCancelled(object sender, IHLSBitrateSwitchEventArgs args)
 {
   if (null != this.BitrateSwitchCancelled)
     this.BitrateSwitchCancelled(sender, args);
 }
Example #12
0
    /// <summary>
    /// Called after the currently playing HLS playlist has switched bitrates.
    /// </summary>
    /// <param name="sender">The currently playling HLS playlist.</param>
    /// <param name="args">The <see cref="IHLSBitrateSwitchEventArgs"/> that contains the details for the 
    /// bitrate switch.  Changes to the Cancel property will be ignored by the HLS Client.</param>
    private async void HLSPlaylist_BitrateSwitchCompleted(object sender, IHLSBitrateSwitchEventArgs args)
    {
      await this.RefreshStateAsync();

      if (null != this.BitrateSwitchCompleted)
        this.BitrateSwitchCompleted(sender, args);
    }
 void Playlist_BitrateSwitchCompleted(IHLSPlaylist sender, IHLSBitrateSwitchEventArgs args)
 {
   _player.Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, () =>
   {
     try
     {
       if (_controller != null && _controller.IsValid && _controller.Playlist.IsMaster && _controller.Playlist != null && _controller.Playlist.ActiveVariantStream != null)
         _data.CurrentBitrate = _controller.Playlist.ActiveVariantStream.Bitrate;
       _data.IsBitrateShiftPending = false;
       _data.IsBitrateShiftingDown = false;
       _data.IsBitrateShiftingUp = false;
     }
     catch (Exception Ex) { }
   });
 }
 void Playlist_BitrateSwitchSuggested(IHLSPlaylist sender, IHLSBitrateSwitchEventArgs args)
 {
   _player.Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, () =>
   {
     try
     {
       _data.ToBitrate = args.ToBitrate;
       _data.IsBitrateShiftingDown = args.FromBitrate > args.ToBitrate;
       _data.IsBitrateShiftingUp = args.ToBitrate > args.FromBitrate;
       _data.IsBitrateShiftPending = true;
     }
     catch(Exception Ex)
     { }
   });
 }
    void Playlist_BitrateSwitchCompleted(IHLSPlaylist sender, IHLSBitrateSwitchEventArgs args)
    {
      _player.Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, () =>
      {
        try
        {
          _downshiftPending = false;
          _upshiftPending = false;
          _currentBitrate = args.ToBitrate;
          if (PropertyChanged != null)
          {
            PropertyChanged(this, new PropertyChangedEventArgs("CurrentBitrate"));
            PropertyChanged(this, new PropertyChangedEventArgs("UpshiftPending"));
            PropertyChanged(this, new PropertyChangedEventArgs("DownshiftPending"));
          }
        }
        catch(Exception Ex)
        {

        }
      });
    }
 private void HLSPlaylist_BitrateSwitchCompleted(IHLSPlaylist sender, IHLSBitrateSwitchEventArgs args)
 {
   this.WriteStatsMsgAsync(
     "HLSPlaylist_BitrateSwitchCompleted",
     "from bitrate: {0}, to bitrate: {1}",
     args.FromBitrate, args.ToBitrate);
 }
    void Playlist_BitrateSwitchSuggested(IHLSPlaylist sender, IHLSBitrateSwitchEventArgs args)
    {
      _player.Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, () =>
        {
          try
          {
            if (args.FromBitrate > args.ToBitrate)
            {
              _downshiftPending = true;
              _upshiftPending = false;
            }
            else
            {
              _upshiftPending = true;
              _downshiftPending = false;
            }

            _targetBitrate = args.ToBitrate;
            if (PropertyChanged != null)
            {
              PropertyChanged(this, new PropertyChangedEventArgs("TargetBitrate"));
              PropertyChanged(this, new PropertyChangedEventArgs("UpshiftPending"));
              PropertyChanged(this, new PropertyChangedEventArgs("DownshiftPending"));
            }
          }
          catch(Exception Ex)
          {

          }
        });
    }
 void Playlist_BitrateSwitchCancelled(IHLSPlaylist sender, IHLSBitrateSwitchEventArgs args)
 {
   _player.Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, () =>
   {
     _data.IsBitrateShiftPending = false;
     _data.IsBitrateShiftingDown = false;
     _data.IsBitrateShiftingUp = false;
   });
 }