///
/// JHybridVideoPlayerEventEmitterSpec.cpp
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
/// https://github.com/mrousavy/nitro
/// Copyright © 2025 Marc Rousavy @ Margelo
///

#include "JHybridVideoPlayerEventEmitterSpec.hpp"

// Forward declaration of `BandwidthData` to properly resolve imports.
namespace margelo::nitro::video { struct BandwidthData; }
// Forward declaration of `onLoadData` to properly resolve imports.
namespace margelo::nitro::video { struct onLoadData; }
// Forward declaration of `VideoOrientation` to properly resolve imports.
namespace margelo::nitro::video { enum class VideoOrientation; }
// Forward declaration of `onLoadStartData` to properly resolve imports.
namespace margelo::nitro::video { struct onLoadStartData; }
// Forward declaration of `SourceType` to properly resolve imports.
namespace margelo::nitro::video { enum class SourceType; }
// Forward declaration of `HybridVideoPlayerSourceSpec` to properly resolve imports.
namespace margelo::nitro::video { class HybridVideoPlayerSourceSpec; }
// Forward declaration of `onPlaybackStateChangeData` to properly resolve imports.
namespace margelo::nitro::video { struct onPlaybackStateChangeData; }
// Forward declaration of `onProgressData` to properly resolve imports.
namespace margelo::nitro::video { struct onProgressData; }
// Forward declaration of `TimedMetadata` to properly resolve imports.
namespace margelo::nitro::video { struct TimedMetadata; }
// Forward declaration of `TimedMetadataObject` to properly resolve imports.
namespace margelo::nitro::video { struct TimedMetadataObject; }
// Forward declaration of `TextTrack` to properly resolve imports.
namespace margelo::nitro::video { struct TextTrack; }
// Forward declaration of `onVolumeChangeData` to properly resolve imports.
namespace margelo::nitro::video { struct onVolumeChangeData; }
// Forward declaration of `VideoPlayerStatus` to properly resolve imports.
namespace margelo::nitro::video { enum class VideoPlayerStatus; }

#include <functional>
#include "JFunc_void.hpp"
#include "JFunc_void_bool.hpp"
#include "BandwidthData.hpp"
#include "JFunc_void_BandwidthData.hpp"
#include "JBandwidthData.hpp"
#include <optional>
#include "onLoadData.hpp"
#include "JFunc_void_onLoadData.hpp"
#include "JonLoadData.hpp"
#include "VideoOrientation.hpp"
#include "JVideoOrientation.hpp"
#include "onLoadStartData.hpp"
#include "JFunc_void_onLoadStartData.hpp"
#include "JonLoadStartData.hpp"
#include "SourceType.hpp"
#include "JSourceType.hpp"
#include <memory>
#include "HybridVideoPlayerSourceSpec.hpp"
#include "JHybridVideoPlayerSourceSpec.hpp"
#include "onPlaybackStateChangeData.hpp"
#include "JFunc_void_onPlaybackStateChangeData.hpp"
#include "JonPlaybackStateChangeData.hpp"
#include "JFunc_void_double.hpp"
#include "onProgressData.hpp"
#include "JFunc_void_onProgressData.hpp"
#include "JonProgressData.hpp"
#include "TimedMetadata.hpp"
#include "JFunc_void_TimedMetadata.hpp"
#include "JTimedMetadata.hpp"
#include "TimedMetadataObject.hpp"
#include <vector>
#include "JTimedMetadataObject.hpp"
#include <string>
#include "JFunc_void_std__vector_std__string_.hpp"
#include "TextTrack.hpp"
#include "JFunc_void_std__optional_TextTrack_.hpp"
#include "JTextTrack.hpp"
#include "onVolumeChangeData.hpp"
#include "JFunc_void_onVolumeChangeData.hpp"
#include "JonVolumeChangeData.hpp"
#include "VideoPlayerStatus.hpp"
#include "JFunc_void_VideoPlayerStatus.hpp"
#include "JVideoPlayerStatus.hpp"

namespace margelo::nitro::video {

  jni::local_ref<JHybridVideoPlayerEventEmitterSpec::jhybriddata> JHybridVideoPlayerEventEmitterSpec::initHybrid(jni::alias_ref<jhybridobject> jThis) {
    return makeCxxInstance(jThis);
  }

  void JHybridVideoPlayerEventEmitterSpec::registerNatives() {
    registerHybrid({
      makeNativeMethod("initHybrid", JHybridVideoPlayerEventEmitterSpec::initHybrid),
    });
  }

  size_t JHybridVideoPlayerEventEmitterSpec::getExternalMemorySize() noexcept {
    static const auto method = javaClassStatic()->getMethod<jlong()>("getMemorySize");
    return method(_javaPart);
  }

  void JHybridVideoPlayerEventEmitterSpec::dispose() noexcept {
    static const auto method = javaClassStatic()->getMethod<void()>("dispose");
    method(_javaPart);
  }

  // Properties
  std::function<void()> JHybridVideoPlayerEventEmitterSpec::getOnAudioBecomingNoisy() {
    static const auto method = javaClassStatic()->getMethod<jni::local_ref<JFunc_void::javaobject>()>("getOnAudioBecomingNoisy_cxx");
    auto __result = method(_javaPart);
    return [&]() -> std::function<void()> {
      if (__result->isInstanceOf(JFunc_void_cxx::javaClassStatic())) [[likely]] {
        auto downcast = jni::static_ref_cast<JFunc_void_cxx::javaobject>(__result);
        return downcast->cthis()->getFunction();
      } else {
        auto __resultRef = jni::make_global(__result);
        return [__resultRef]() -> void {
          return __resultRef->invoke();
        };
      }
    }();
  }
  void JHybridVideoPlayerEventEmitterSpec::setOnAudioBecomingNoisy(const std::function<void()>& onAudioBecomingNoisy) {
    static const auto method = javaClassStatic()->getMethod<void(jni::alias_ref<JFunc_void::javaobject> /* onAudioBecomingNoisy */)>("setOnAudioBecomingNoisy_cxx");
    method(_javaPart, JFunc_void_cxx::fromCpp(onAudioBecomingNoisy));
  }
  std::function<void(bool /* hasAudioFocus */)> JHybridVideoPlayerEventEmitterSpec::getOnAudioFocusChange() {
    static const auto method = javaClassStatic()->getMethod<jni::local_ref<JFunc_void_bool::javaobject>()>("getOnAudioFocusChange_cxx");
    auto __result = method(_javaPart);
    return [&]() -> std::function<void(bool /* hasAudioFocus */)> {
      if (__result->isInstanceOf(JFunc_void_bool_cxx::javaClassStatic())) [[likely]] {
        auto downcast = jni::static_ref_cast<JFunc_void_bool_cxx::javaobject>(__result);
        return downcast->cthis()->getFunction();
      } else {
        auto __resultRef = jni::make_global(__result);
        return [__resultRef](bool hasAudioFocus) -> void {
          return __resultRef->invoke(hasAudioFocus);
        };
      }
    }();
  }
  void JHybridVideoPlayerEventEmitterSpec::setOnAudioFocusChange(const std::function<void(bool /* hasAudioFocus */)>& onAudioFocusChange) {
    static const auto method = javaClassStatic()->getMethod<void(jni::alias_ref<JFunc_void_bool::javaobject> /* onAudioFocusChange */)>("setOnAudioFocusChange_cxx");
    method(_javaPart, JFunc_void_bool_cxx::fromCpp(onAudioFocusChange));
  }
  std::function<void(const BandwidthData& /* data */)> JHybridVideoPlayerEventEmitterSpec::getOnBandwidthUpdate() {
    static const auto method = javaClassStatic()->getMethod<jni::local_ref<JFunc_void_BandwidthData::javaobject>()>("getOnBandwidthUpdate_cxx");
    auto __result = method(_javaPart);
    return [&]() -> std::function<void(const BandwidthData& /* data */)> {
      if (__result->isInstanceOf(JFunc_void_BandwidthData_cxx::javaClassStatic())) [[likely]] {
        auto downcast = jni::static_ref_cast<JFunc_void_BandwidthData_cxx::javaobject>(__result);
        return downcast->cthis()->getFunction();
      } else {
        auto __resultRef = jni::make_global(__result);
        return [__resultRef](BandwidthData data) -> void {
          return __resultRef->invoke(data);
        };
      }
    }();
  }
  void JHybridVideoPlayerEventEmitterSpec::setOnBandwidthUpdate(const std::function<void(const BandwidthData& /* data */)>& onBandwidthUpdate) {
    static const auto method = javaClassStatic()->getMethod<void(jni::alias_ref<JFunc_void_BandwidthData::javaobject> /* onBandwidthUpdate */)>("setOnBandwidthUpdate_cxx");
    method(_javaPart, JFunc_void_BandwidthData_cxx::fromCpp(onBandwidthUpdate));
  }
  std::function<void(bool /* buffering */)> JHybridVideoPlayerEventEmitterSpec::getOnBuffer() {
    static const auto method = javaClassStatic()->getMethod<jni::local_ref<JFunc_void_bool::javaobject>()>("getOnBuffer_cxx");
    auto __result = method(_javaPart);
    return [&]() -> std::function<void(bool /* buffering */)> {
      if (__result->isInstanceOf(JFunc_void_bool_cxx::javaClassStatic())) [[likely]] {
        auto downcast = jni::static_ref_cast<JFunc_void_bool_cxx::javaobject>(__result);
        return downcast->cthis()->getFunction();
      } else {
        auto __resultRef = jni::make_global(__result);
        return [__resultRef](bool buffering) -> void {
          return __resultRef->invoke(buffering);
        };
      }
    }();
  }
  void JHybridVideoPlayerEventEmitterSpec::setOnBuffer(const std::function<void(bool /* buffering */)>& onBuffer) {
    static const auto method = javaClassStatic()->getMethod<void(jni::alias_ref<JFunc_void_bool::javaobject> /* onBuffer */)>("setOnBuffer_cxx");
    method(_javaPart, JFunc_void_bool_cxx::fromCpp(onBuffer));
  }
  std::function<void(bool /* visible */)> JHybridVideoPlayerEventEmitterSpec::getOnControlsVisibleChange() {
    static const auto method = javaClassStatic()->getMethod<jni::local_ref<JFunc_void_bool::javaobject>()>("getOnControlsVisibleChange_cxx");
    auto __result = method(_javaPart);
    return [&]() -> std::function<void(bool /* visible */)> {
      if (__result->isInstanceOf(JFunc_void_bool_cxx::javaClassStatic())) [[likely]] {
        auto downcast = jni::static_ref_cast<JFunc_void_bool_cxx::javaobject>(__result);
        return downcast->cthis()->getFunction();
      } else {
        auto __resultRef = jni::make_global(__result);
        return [__resultRef](bool visible) -> void {
          return __resultRef->invoke(visible);
        };
      }
    }();
  }
  void JHybridVideoPlayerEventEmitterSpec::setOnControlsVisibleChange(const std::function<void(bool /* visible */)>& onControlsVisibleChange) {
    static const auto method = javaClassStatic()->getMethod<void(jni::alias_ref<JFunc_void_bool::javaobject> /* onControlsVisibleChange */)>("setOnControlsVisibleChange_cxx");
    method(_javaPart, JFunc_void_bool_cxx::fromCpp(onControlsVisibleChange));
  }
  std::function<void()> JHybridVideoPlayerEventEmitterSpec::getOnEnd() {
    static const auto method = javaClassStatic()->getMethod<jni::local_ref<JFunc_void::javaobject>()>("getOnEnd_cxx");
    auto __result = method(_javaPart);
    return [&]() -> std::function<void()> {
      if (__result->isInstanceOf(JFunc_void_cxx::javaClassStatic())) [[likely]] {
        auto downcast = jni::static_ref_cast<JFunc_void_cxx::javaobject>(__result);
        return downcast->cthis()->getFunction();
      } else {
        auto __resultRef = jni::make_global(__result);
        return [__resultRef]() -> void {
          return __resultRef->invoke();
        };
      }
    }();
  }
  void JHybridVideoPlayerEventEmitterSpec::setOnEnd(const std::function<void()>& onEnd) {
    static const auto method = javaClassStatic()->getMethod<void(jni::alias_ref<JFunc_void::javaobject> /* onEnd */)>("setOnEnd_cxx");
    method(_javaPart, JFunc_void_cxx::fromCpp(onEnd));
  }
  std::function<void(bool /* externalPlaybackActive */)> JHybridVideoPlayerEventEmitterSpec::getOnExternalPlaybackChange() {
    static const auto method = javaClassStatic()->getMethod<jni::local_ref<JFunc_void_bool::javaobject>()>("getOnExternalPlaybackChange_cxx");
    auto __result = method(_javaPart);
    return [&]() -> std::function<void(bool /* externalPlaybackActive */)> {
      if (__result->isInstanceOf(JFunc_void_bool_cxx::javaClassStatic())) [[likely]] {
        auto downcast = jni::static_ref_cast<JFunc_void_bool_cxx::javaobject>(__result);
        return downcast->cthis()->getFunction();
      } else {
        auto __resultRef = jni::make_global(__result);
        return [__resultRef](bool externalPlaybackActive) -> void {
          return __resultRef->invoke(externalPlaybackActive);
        };
      }
    }();
  }
  void JHybridVideoPlayerEventEmitterSpec::setOnExternalPlaybackChange(const std::function<void(bool /* externalPlaybackActive */)>& onExternalPlaybackChange) {
    static const auto method = javaClassStatic()->getMethod<void(jni::alias_ref<JFunc_void_bool::javaobject> /* onExternalPlaybackChange */)>("setOnExternalPlaybackChange_cxx");
    method(_javaPart, JFunc_void_bool_cxx::fromCpp(onExternalPlaybackChange));
  }
  std::function<void(const onLoadData& /* data */)> JHybridVideoPlayerEventEmitterSpec::getOnLoad() {
    static const auto method = javaClassStatic()->getMethod<jni::local_ref<JFunc_void_onLoadData::javaobject>()>("getOnLoad_cxx");
    auto __result = method(_javaPart);
    return [&]() -> std::function<void(const onLoadData& /* data */)> {
      if (__result->isInstanceOf(JFunc_void_onLoadData_cxx::javaClassStatic())) [[likely]] {
        auto downcast = jni::static_ref_cast<JFunc_void_onLoadData_cxx::javaobject>(__result);
        return downcast->cthis()->getFunction();
      } else {
        auto __resultRef = jni::make_global(__result);
        return [__resultRef](onLoadData data) -> void {
          return __resultRef->invoke(data);
        };
      }
    }();
  }
  void JHybridVideoPlayerEventEmitterSpec::setOnLoad(const std::function<void(const onLoadData& /* data */)>& onLoad) {
    static const auto method = javaClassStatic()->getMethod<void(jni::alias_ref<JFunc_void_onLoadData::javaobject> /* onLoad */)>("setOnLoad_cxx");
    method(_javaPart, JFunc_void_onLoadData_cxx::fromCpp(onLoad));
  }
  std::function<void(const onLoadStartData& /* data */)> JHybridVideoPlayerEventEmitterSpec::getOnLoadStart() {
    static const auto method = javaClassStatic()->getMethod<jni::local_ref<JFunc_void_onLoadStartData::javaobject>()>("getOnLoadStart_cxx");
    auto __result = method(_javaPart);
    return [&]() -> std::function<void(const onLoadStartData& /* data */)> {
      if (__result->isInstanceOf(JFunc_void_onLoadStartData_cxx::javaClassStatic())) [[likely]] {
        auto downcast = jni::static_ref_cast<JFunc_void_onLoadStartData_cxx::javaobject>(__result);
        return downcast->cthis()->getFunction();
      } else {
        auto __resultRef = jni::make_global(__result);
        return [__resultRef](onLoadStartData data) -> void {
          return __resultRef->invoke(data);
        };
      }
    }();
  }
  void JHybridVideoPlayerEventEmitterSpec::setOnLoadStart(const std::function<void(const onLoadStartData& /* data */)>& onLoadStart) {
    static const auto method = javaClassStatic()->getMethod<void(jni::alias_ref<JFunc_void_onLoadStartData::javaobject> /* onLoadStart */)>("setOnLoadStart_cxx");
    method(_javaPart, JFunc_void_onLoadStartData_cxx::fromCpp(onLoadStart));
  }
  std::function<void(const onPlaybackStateChangeData& /* data */)> JHybridVideoPlayerEventEmitterSpec::getOnPlaybackStateChange() {
    static const auto method = javaClassStatic()->getMethod<jni::local_ref<JFunc_void_onPlaybackStateChangeData::javaobject>()>("getOnPlaybackStateChange_cxx");
    auto __result = method(_javaPart);
    return [&]() -> std::function<void(const onPlaybackStateChangeData& /* data */)> {
      if (__result->isInstanceOf(JFunc_void_onPlaybackStateChangeData_cxx::javaClassStatic())) [[likely]] {
        auto downcast = jni::static_ref_cast<JFunc_void_onPlaybackStateChangeData_cxx::javaobject>(__result);
        return downcast->cthis()->getFunction();
      } else {
        auto __resultRef = jni::make_global(__result);
        return [__resultRef](onPlaybackStateChangeData data) -> void {
          return __resultRef->invoke(data);
        };
      }
    }();
  }
  void JHybridVideoPlayerEventEmitterSpec::setOnPlaybackStateChange(const std::function<void(const onPlaybackStateChangeData& /* data */)>& onPlaybackStateChange) {
    static const auto method = javaClassStatic()->getMethod<void(jni::alias_ref<JFunc_void_onPlaybackStateChangeData::javaobject> /* onPlaybackStateChange */)>("setOnPlaybackStateChange_cxx");
    method(_javaPart, JFunc_void_onPlaybackStateChangeData_cxx::fromCpp(onPlaybackStateChange));
  }
  std::function<void(double /* rate */)> JHybridVideoPlayerEventEmitterSpec::getOnPlaybackRateChange() {
    static const auto method = javaClassStatic()->getMethod<jni::local_ref<JFunc_void_double::javaobject>()>("getOnPlaybackRateChange_cxx");
    auto __result = method(_javaPart);
    return [&]() -> std::function<void(double /* rate */)> {
      if (__result->isInstanceOf(JFunc_void_double_cxx::javaClassStatic())) [[likely]] {
        auto downcast = jni::static_ref_cast<JFunc_void_double_cxx::javaobject>(__result);
        return downcast->cthis()->getFunction();
      } else {
        auto __resultRef = jni::make_global(__result);
        return [__resultRef](double rate) -> void {
          return __resultRef->invoke(rate);
        };
      }
    }();
  }
  void JHybridVideoPlayerEventEmitterSpec::setOnPlaybackRateChange(const std::function<void(double /* rate */)>& onPlaybackRateChange) {
    static const auto method = javaClassStatic()->getMethod<void(jni::alias_ref<JFunc_void_double::javaobject> /* onPlaybackRateChange */)>("setOnPlaybackRateChange_cxx");
    method(_javaPart, JFunc_void_double_cxx::fromCpp(onPlaybackRateChange));
  }
  std::function<void(const onProgressData& /* data */)> JHybridVideoPlayerEventEmitterSpec::getOnProgress() {
    static const auto method = javaClassStatic()->getMethod<jni::local_ref<JFunc_void_onProgressData::javaobject>()>("getOnProgress_cxx");
    auto __result = method(_javaPart);
    return [&]() -> std::function<void(const onProgressData& /* data */)> {
      if (__result->isInstanceOf(JFunc_void_onProgressData_cxx::javaClassStatic())) [[likely]] {
        auto downcast = jni::static_ref_cast<JFunc_void_onProgressData_cxx::javaobject>(__result);
        return downcast->cthis()->getFunction();
      } else {
        auto __resultRef = jni::make_global(__result);
        return [__resultRef](onProgressData data) -> void {
          return __resultRef->invoke(data);
        };
      }
    }();
  }
  void JHybridVideoPlayerEventEmitterSpec::setOnProgress(const std::function<void(const onProgressData& /* data */)>& onProgress) {
    static const auto method = javaClassStatic()->getMethod<void(jni::alias_ref<JFunc_void_onProgressData::javaobject> /* onProgress */)>("setOnProgress_cxx");
    method(_javaPart, JFunc_void_onProgressData_cxx::fromCpp(onProgress));
  }
  std::function<void()> JHybridVideoPlayerEventEmitterSpec::getOnReadyToDisplay() {
    static const auto method = javaClassStatic()->getMethod<jni::local_ref<JFunc_void::javaobject>()>("getOnReadyToDisplay_cxx");
    auto __result = method(_javaPart);
    return [&]() -> std::function<void()> {
      if (__result->isInstanceOf(JFunc_void_cxx::javaClassStatic())) [[likely]] {
        auto downcast = jni::static_ref_cast<JFunc_void_cxx::javaobject>(__result);
        return downcast->cthis()->getFunction();
      } else {
        auto __resultRef = jni::make_global(__result);
        return [__resultRef]() -> void {
          return __resultRef->invoke();
        };
      }
    }();
  }
  void JHybridVideoPlayerEventEmitterSpec::setOnReadyToDisplay(const std::function<void()>& onReadyToDisplay) {
    static const auto method = javaClassStatic()->getMethod<void(jni::alias_ref<JFunc_void::javaobject> /* onReadyToDisplay */)>("setOnReadyToDisplay_cxx");
    method(_javaPart, JFunc_void_cxx::fromCpp(onReadyToDisplay));
  }
  std::function<void(double /* seekTime */)> JHybridVideoPlayerEventEmitterSpec::getOnSeek() {
    static const auto method = javaClassStatic()->getMethod<jni::local_ref<JFunc_void_double::javaobject>()>("getOnSeek_cxx");
    auto __result = method(_javaPart);
    return [&]() -> std::function<void(double /* seekTime */)> {
      if (__result->isInstanceOf(JFunc_void_double_cxx::javaClassStatic())) [[likely]] {
        auto downcast = jni::static_ref_cast<JFunc_void_double_cxx::javaobject>(__result);
        return downcast->cthis()->getFunction();
      } else {
        auto __resultRef = jni::make_global(__result);
        return [__resultRef](double seekTime) -> void {
          return __resultRef->invoke(seekTime);
        };
      }
    }();
  }
  void JHybridVideoPlayerEventEmitterSpec::setOnSeek(const std::function<void(double /* seekTime */)>& onSeek) {
    static const auto method = javaClassStatic()->getMethod<void(jni::alias_ref<JFunc_void_double::javaobject> /* onSeek */)>("setOnSeek_cxx");
    method(_javaPart, JFunc_void_double_cxx::fromCpp(onSeek));
  }
  std::function<void(const TimedMetadata& /* metadata */)> JHybridVideoPlayerEventEmitterSpec::getOnTimedMetadata() {
    static const auto method = javaClassStatic()->getMethod<jni::local_ref<JFunc_void_TimedMetadata::javaobject>()>("getOnTimedMetadata_cxx");
    auto __result = method(_javaPart);
    return [&]() -> std::function<void(const TimedMetadata& /* metadata */)> {
      if (__result->isInstanceOf(JFunc_void_TimedMetadata_cxx::javaClassStatic())) [[likely]] {
        auto downcast = jni::static_ref_cast<JFunc_void_TimedMetadata_cxx::javaobject>(__result);
        return downcast->cthis()->getFunction();
      } else {
        auto __resultRef = jni::make_global(__result);
        return [__resultRef](TimedMetadata metadata) -> void {
          return __resultRef->invoke(metadata);
        };
      }
    }();
  }
  void JHybridVideoPlayerEventEmitterSpec::setOnTimedMetadata(const std::function<void(const TimedMetadata& /* metadata */)>& onTimedMetadata) {
    static const auto method = javaClassStatic()->getMethod<void(jni::alias_ref<JFunc_void_TimedMetadata::javaobject> /* onTimedMetadata */)>("setOnTimedMetadata_cxx");
    method(_javaPart, JFunc_void_TimedMetadata_cxx::fromCpp(onTimedMetadata));
  }
  std::function<void(const std::vector<std::string>& /* texts */)> JHybridVideoPlayerEventEmitterSpec::getOnTextTrackDataChanged() {
    static const auto method = javaClassStatic()->getMethod<jni::local_ref<JFunc_void_std__vector_std__string_::javaobject>()>("getOnTextTrackDataChanged_cxx");
    auto __result = method(_javaPart);
    return [&]() -> std::function<void(const std::vector<std::string>& /* texts */)> {
      if (__result->isInstanceOf(JFunc_void_std__vector_std__string__cxx::javaClassStatic())) [[likely]] {
        auto downcast = jni::static_ref_cast<JFunc_void_std__vector_std__string__cxx::javaobject>(__result);
        return downcast->cthis()->getFunction();
      } else {
        auto __resultRef = jni::make_global(__result);
        return [__resultRef](std::vector<std::string> texts) -> void {
          return __resultRef->invoke(texts);
        };
      }
    }();
  }
  void JHybridVideoPlayerEventEmitterSpec::setOnTextTrackDataChanged(const std::function<void(const std::vector<std::string>& /* texts */)>& onTextTrackDataChanged) {
    static const auto method = javaClassStatic()->getMethod<void(jni::alias_ref<JFunc_void_std__vector_std__string_::javaobject> /* onTextTrackDataChanged */)>("setOnTextTrackDataChanged_cxx");
    method(_javaPart, JFunc_void_std__vector_std__string__cxx::fromCpp(onTextTrackDataChanged));
  }
  std::function<void(const std::optional<TextTrack>& /* track */)> JHybridVideoPlayerEventEmitterSpec::getOnTrackChange() {
    static const auto method = javaClassStatic()->getMethod<jni::local_ref<JFunc_void_std__optional_TextTrack_::javaobject>()>("getOnTrackChange_cxx");
    auto __result = method(_javaPart);
    return [&]() -> std::function<void(const std::optional<TextTrack>& /* track */)> {
      if (__result->isInstanceOf(JFunc_void_std__optional_TextTrack__cxx::javaClassStatic())) [[likely]] {
        auto downcast = jni::static_ref_cast<JFunc_void_std__optional_TextTrack__cxx::javaobject>(__result);
        return downcast->cthis()->getFunction();
      } else {
        auto __resultRef = jni::make_global(__result);
        return [__resultRef](std::optional<TextTrack> track) -> void {
          return __resultRef->invoke(track);
        };
      }
    }();
  }
  void JHybridVideoPlayerEventEmitterSpec::setOnTrackChange(const std::function<void(const std::optional<TextTrack>& /* track */)>& onTrackChange) {
    static const auto method = javaClassStatic()->getMethod<void(jni::alias_ref<JFunc_void_std__optional_TextTrack_::javaobject> /* onTrackChange */)>("setOnTrackChange_cxx");
    method(_javaPart, JFunc_void_std__optional_TextTrack__cxx::fromCpp(onTrackChange));
  }
  std::function<void(const onVolumeChangeData& /* data */)> JHybridVideoPlayerEventEmitterSpec::getOnVolumeChange() {
    static const auto method = javaClassStatic()->getMethod<jni::local_ref<JFunc_void_onVolumeChangeData::javaobject>()>("getOnVolumeChange_cxx");
    auto __result = method(_javaPart);
    return [&]() -> std::function<void(const onVolumeChangeData& /* data */)> {
      if (__result->isInstanceOf(JFunc_void_onVolumeChangeData_cxx::javaClassStatic())) [[likely]] {
        auto downcast = jni::static_ref_cast<JFunc_void_onVolumeChangeData_cxx::javaobject>(__result);
        return downcast->cthis()->getFunction();
      } else {
        auto __resultRef = jni::make_global(__result);
        return [__resultRef](onVolumeChangeData data) -> void {
          return __resultRef->invoke(data);
        };
      }
    }();
  }
  void JHybridVideoPlayerEventEmitterSpec::setOnVolumeChange(const std::function<void(const onVolumeChangeData& /* data */)>& onVolumeChange) {
    static const auto method = javaClassStatic()->getMethod<void(jni::alias_ref<JFunc_void_onVolumeChangeData::javaobject> /* onVolumeChange */)>("setOnVolumeChange_cxx");
    method(_javaPart, JFunc_void_onVolumeChangeData_cxx::fromCpp(onVolumeChange));
  }
  std::function<void(VideoPlayerStatus /* status */)> JHybridVideoPlayerEventEmitterSpec::getOnStatusChange() {
    static const auto method = javaClassStatic()->getMethod<jni::local_ref<JFunc_void_VideoPlayerStatus::javaobject>()>("getOnStatusChange_cxx");
    auto __result = method(_javaPart);
    return [&]() -> std::function<void(VideoPlayerStatus /* status */)> {
      if (__result->isInstanceOf(JFunc_void_VideoPlayerStatus_cxx::javaClassStatic())) [[likely]] {
        auto downcast = jni::static_ref_cast<JFunc_void_VideoPlayerStatus_cxx::javaobject>(__result);
        return downcast->cthis()->getFunction();
      } else {
        auto __resultRef = jni::make_global(__result);
        return [__resultRef](VideoPlayerStatus status) -> void {
          return __resultRef->invoke(status);
        };
      }
    }();
  }
  void JHybridVideoPlayerEventEmitterSpec::setOnStatusChange(const std::function<void(VideoPlayerStatus /* status */)>& onStatusChange) {
    static const auto method = javaClassStatic()->getMethod<void(jni::alias_ref<JFunc_void_VideoPlayerStatus::javaobject> /* onStatusChange */)>("setOnStatusChange_cxx");
    method(_javaPart, JFunc_void_VideoPlayerStatus_cxx::fromCpp(onStatusChange));
  }

  // Methods
  

} // namespace margelo::nitro::video
