docs: @Subscribe
      public void onSegmentWritten(HlsSegmentWrittenEvent event) {
          try {
              File hlsSegment = event.getSegment();
              queueOrSubmitUpload(keyForFilename(hlsSegment.getName()), hlsSegment);
              if (isKitKat() && mConfig.isAdaptiveBitrate() && isRecording()) {
                  // Adjust bitrate to match expected filesize
                  long actualSegmentSizeBytes = hlsSegment.length();
                  long expectedSizeBytes = ((mConfig.getAudioBitrate() / 8) + (mVideoBitrate / 8)) * mConfig.getHlsSegmentDuration();
                  float filesizeRatio = actualSegmentSizeBytes / (float) expectedSizeBytes;
                  if (VERBOSE)
                      Log.i(TAG, "OnSegmentWritten. Segment size: " + (actualSegmentSizeBytes / 1000) + "kB. ratio: " + filesizeRatio);
                  if (filesizeRatio < .7) {
                      if (mLastRealizedBandwidthBytesPerSec != 0) {
                          // Scale bitrate while not exceeding available bandwidth
                          float scaledBitrate = mVideoBitrate * (1 / filesizeRatio);
                          float bandwidthBitrate = mLastRealizedBandwidthBytesPerSec * 8;
                          mVideoBitrate = (int) Math.min(scaledBitrate, bandwidthBitrate);
                      } else {
                          // Scale bitrate to match expected fileSize
                          mVideoBitrate *= (1 / filesizeRatio);
                      }
                      if (VERBOSE) Log.i(TAG, "Scaling video bitrate to " + mVideoBitrate + " bps");
                      adjustVideoBitrate(mVideoBitrate);
                  }
              }
          } catch (Exception ex) {
              ex.printStackTrace();
          }
      }