I did some slight reading related to Data Form Media Element in #321.
Link to the PR
Now the only part which is left is, integrating DataForm s with MediaElements.
AFAIK, there is no way in FormField which will allow encapsulation to child element (In this case <media>) other than <value>.
This is because,
all extensions based on XEP-004:Data Form such as
-
XEP-0077: In-Band Registration <https://xmpp.org/extensions/xep-0077.html>.
-
XEP-0055: Jabber Search <https://xmpp.org/extensions/xep-0055.html>.
-
XEP-0045: Multi-User Chat <https://xmpp.org/extensions/xep-0045.html>.
never needed an extension to field.
whereas XEP-0221 is quite different and is based upon wrapping <media/> element inside <field/>.
So I am proposing some ways to face this scenario,
- add method âaddMediaElementToField(MediaElement)â to FormField.java :
But Formfield is defined as per XEP-004 so it might be a contravention to the existing implementation. - Custom made FormField :
customFormField extends FormField(){}
An explicit FormField to encapsulate MediaElement. - add method âwrapInsideField(FormField)â to MediaElement.java :
This will generate
<field>
<media/>
</field>
But will return XmlStringBuilder(which is pretty much like hardcoding) which is a reason I want to discard this option.
I think for the second option, please let me know what you think,
Also if there is some other way, please let me know