mirror of
https://github.com/zoriya/react-native-omni.git
synced 2026-08-16 02:44:51 +00:00
Handle rendition selection
This commit is contained in:
@@ -48,6 +48,9 @@ namespace margelo::nitro::omni {
|
||||
case BoolProperty::MUTED:
|
||||
static const auto fieldMUTED = clazz->getStaticField<JBoolProperty>("MUTED");
|
||||
return clazz->getStaticFieldValue(fieldMUTED);
|
||||
case BoolProperty::ISAUTOQUALITY:
|
||||
static const auto fieldISAUTOQUALITY = clazz->getStaticField<JBoolProperty>("ISAUTOQUALITY");
|
||||
return clazz->getStaticFieldValue(fieldISAUTOQUALITY);
|
||||
default:
|
||||
std::string stringValue = std::to_string(static_cast<int>(value));
|
||||
throw std::invalid_argument("Invalid enum value (" + stringValue + "!");
|
||||
|
||||
@@ -225,6 +225,11 @@ namespace margelo::nitro::omni {
|
||||
static const auto method = _javaPart->javaClassStatic()->getMethod<void(jboolean /* muted */)>("setMuted");
|
||||
method(_javaPart, muted);
|
||||
}
|
||||
bool JHybridOmniPlayerSpec::getIsAutoQuality() {
|
||||
static const auto method = _javaPart->javaClassStatic()->getMethod<jboolean()>("isAutoQuality");
|
||||
auto __result = method(_javaPart);
|
||||
return static_cast<bool>(__result);
|
||||
}
|
||||
|
||||
// Methods
|
||||
void JHybridOmniPlayerSpec::play() {
|
||||
|
||||
@@ -73,6 +73,7 @@ namespace margelo::nitro::omni {
|
||||
void setVolume(double volume) override;
|
||||
bool getMuted() override;
|
||||
void setMuted(bool muted) override;
|
||||
bool getIsAutoQuality() override;
|
||||
|
||||
public:
|
||||
// Methods
|
||||
|
||||
@@ -57,6 +57,9 @@ namespace margelo::nitro::omni {
|
||||
case NumberProperty::VOLUME:
|
||||
static const auto fieldVOLUME = clazz->getStaticField<JNumberProperty>("VOLUME");
|
||||
return clazz->getStaticFieldValue(fieldVOLUME);
|
||||
case NumberProperty::ISAUTOQUALITY:
|
||||
static const auto fieldISAUTOQUALITY = clazz->getStaticField<JNumberProperty>("ISAUTOQUALITY");
|
||||
return clazz->getStaticFieldValue(fieldISAUTOQUALITY);
|
||||
default:
|
||||
std::string stringValue = std::to_string(static_cast<int>(value));
|
||||
throw std::invalid_argument("Invalid enum value (" + stringValue + "!");
|
||||
|
||||
@@ -17,7 +17,8 @@ import com.facebook.proguard.annotations.DoNotStrip
|
||||
@Keep
|
||||
enum class BoolProperty(@DoNotStrip @Keep val value: Int) {
|
||||
ISPLAYING(0),
|
||||
MUTED(1);
|
||||
MUTED(1),
|
||||
ISAUTOQUALITY(2);
|
||||
|
||||
companion object
|
||||
}
|
||||
|
||||
+4
@@ -104,6 +104,10 @@ abstract class HybridOmniPlayerSpec: HybridObject() {
|
||||
@set:DoNotStrip
|
||||
@set:Keep
|
||||
abstract var muted: Boolean
|
||||
|
||||
@get:DoNotStrip
|
||||
@get:Keep
|
||||
abstract val isAutoQuality: Boolean
|
||||
|
||||
// Methods
|
||||
@DoNotStrip
|
||||
|
||||
+2
-1
@@ -20,7 +20,8 @@ enum class NumberProperty(@DoNotStrip @Keep val value: Int) {
|
||||
BUFFERED(1),
|
||||
DURATION(2),
|
||||
PLAYBACKRATE(3),
|
||||
VOLUME(4);
|
||||
VOLUME(4),
|
||||
ISAUTOQUALITY(5);
|
||||
|
||||
companion object
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user