mirror of
https://github.com/zoriya/react-native-omni.git
synced 2026-08-16 02:44:51 +00:00
wip: Implement events
This commit is contained in:
+3
-3
@@ -42,6 +42,9 @@ namespace margelo::nitro::omni {
|
||||
static jni::alias_ref<JPlayerStatus> fromCpp(PlayerStatus value) {
|
||||
static const auto clazz = javaClassStatic();
|
||||
switch (value) {
|
||||
case PlayerStatus::ERROR:
|
||||
static const auto fieldERROR = clazz->getStaticField<JPlayerStatus>("ERROR");
|
||||
return clazz->getStaticFieldValue(fieldERROR);
|
||||
case PlayerStatus::IDLE:
|
||||
static const auto fieldIDLE = clazz->getStaticField<JPlayerStatus>("IDLE");
|
||||
return clazz->getStaticFieldValue(fieldIDLE);
|
||||
@@ -51,9 +54,6 @@ namespace margelo::nitro::omni {
|
||||
case PlayerStatus::READYTOPLAY:
|
||||
static const auto fieldREADYTOPLAY = clazz->getStaticField<JPlayerStatus>("READYTOPLAY");
|
||||
return clazz->getStaticFieldValue(fieldREADYTOPLAY);
|
||||
case PlayerStatus::ERROR:
|
||||
static const auto fieldERROR = clazz->getStaticField<JPlayerStatus>("ERROR");
|
||||
return clazz->getStaticFieldValue(fieldERROR);
|
||||
default:
|
||||
std::string stringValue = std::to_string(static_cast<int>(value));
|
||||
throw std::invalid_argument("Invalid enum value (" + stringValue + "!");
|
||||
|
||||
Reference in New Issue
Block a user