|
@@ -32,13 +32,14 @@
|
|
|
|
|
|
#ifdef JAVASCRIPT_ENABLED
|
|
|
#include "webrtc_peer_connection_js.h"
|
|
|
-#else
|
|
|
-#include "webrtc_peer_connection_extension.h"
|
|
|
#endif
|
|
|
|
|
|
+#include "webrtc_peer_connection_extension.h"
|
|
|
+
|
|
|
StringName WebRTCPeerConnection::default_extension;
|
|
|
|
|
|
void WebRTCPeerConnection::set_default_extension(const StringName &p_extension) {
|
|
|
+ ERR_FAIL_COND_MSG(!ClassDB::is_parent_class(p_extension, WebRTCPeerConnectionExtension::get_class_static()), vformat("Can't make %s the default WebRTC extension since it does not extend WebRTCPeerConnectionExtension.", p_extension));
|
|
|
default_extension = p_extension;
|
|
|
}
|
|
|
|
|
@@ -56,6 +57,8 @@ WebRTCPeerConnection *WebRTCPeerConnection::create() {
|
|
|
}
|
|
|
|
|
|
void WebRTCPeerConnection::_bind_methods() {
|
|
|
+ ClassDB::bind_static_method(get_class_static(), D_METHOD("set_default_extension", "extension_class"), &WebRTCPeerConnectionExtension::set_default_extension);
|
|
|
+
|
|
|
ClassDB::bind_method(D_METHOD("initialize", "configuration"), &WebRTCPeerConnection::initialize, DEFVAL(Dictionary()));
|
|
|
ClassDB::bind_method(D_METHOD("create_data_channel", "label", "options"), &WebRTCPeerConnection::create_data_channel, DEFVAL(Dictionary()));
|
|
|
ClassDB::bind_method(D_METHOD("create_offer"), &WebRTCPeerConnection::create_offer);
|