fix(android): add support of square video format

This commit is contained in:
olivier bouillet 2022-08-05 19:04:35 +02:00
parent a03c7342fb
commit 3675dc2789

View File

@ -160,8 +160,11 @@ class VideoEventEmitter {
naturalSize.putInt(EVENT_PROP_HEIGHT, videoHeight); naturalSize.putInt(EVENT_PROP_HEIGHT, videoHeight);
if (videoWidth > videoHeight) { if (videoWidth > videoHeight) {
naturalSize.putString(EVENT_PROP_ORIENTATION, "landscape"); naturalSize.putString(EVENT_PROP_ORIENTATION, "landscape");
} else { } else if (videoWidth < videoHeight) {
naturalSize.putString(EVENT_PROP_ORIENTATION, "portrait"); naturalSize.putString(EVENT_PROP_ORIENTATION, "portrait");
} else {
naturalSize.putString(EVENT_PROP_ORIENTATION, "square");
}
} }
event.putMap(EVENT_PROP_NATURAL_SIZE, naturalSize); event.putMap(EVENT_PROP_NATURAL_SIZE, naturalSize);
event.putString(EVENT_PROP_TRACK_ID, trackId); event.putString(EVENT_PROP_TRACK_ID, trackId);