[MM][WEBRTC] Allow User Media request for Camera/Mic, automatically for EFLWebViewApp.
authorkapil.kumar <kapil.kumar@samsung.com>
Mon, 1 Dec 2014 10:07:04 +0000 (15:37 +0530)
committerYoungsoo Choi <kenshin.choi@samsung.com>
Tue, 10 Jul 2018 06:57:09 +0000 (06:57 +0000)
As EFLWebViewApp doesnt have any UI dialogs to ask user,
for allowing/denying media permission requested by webpage.
So its allowed by default in webview application.

Bug: http://107.108.218.239/bugzilla/show_bug.cgi?id=9477
Reviewed by: Antonio Gomes, Min-Soo Koo

Change-Id: I06d7ceb42fad8186da901e73cf45f61d21c9b134
Signed-off-by: kapil.kumar <kapil.kumar@samsung.com>
tizen_src/ewk/efl_webview_app/app.c

index 4ff1f938f1e35c1f9b600689f134f7980940661e..7fe08fdea17dc3119ae96833d989764231ec132b 100644 (file)
@@ -15,6 +15,7 @@
 #include "public/ewk_text_style.h"
 #include "public/ewk_cookie_manager.h"
 #include "public/ewk_console_message.h"
+#include "public/ewk_user_media.h"
 
 #include <Ecore.h>
 #include <Ecore_Evas.h>
@@ -100,6 +101,7 @@ static void __auth_challenge_cb(void* data, Evas_Object *obj, void *event_info);
 static void __policy_response_decide_cb(void *data, Evas_Object *obj, void *event_info);
 static void __customize_context_menu_cb(void* data, Evas_Object *obj, void *event_info);
 static void __customize_context_menu_item_selected_cb(void* data, Evas_Object *obj, void *event_info);
+static void __usermedia_permission_request_cb(void *data, Evas_Object *obj, void *event_info);
 static void __navigation_policy_decide_cb(void *data, Evas_Object *obj, void *event_info);
 static void __text_found_cb(void *data, Evas_Object *obj, void *event_info);
 static void __newwindow_policy_cb(void *data, Evas_Object *obj, void* policy);
@@ -454,6 +456,7 @@ int main(int argc, char** argv)
   evas_object_smart_callback_add(view, "load,finished", __load_finished_cb, context);
   evas_object_smart_callback_add(view, "load,error", __load_error_cb, 0);
   evas_object_smart_callback_add(view, "url,changed", __uri_changed_cb,0);
+  evas_object_smart_callback_add(view, "usermedia,permission,request", __usermedia_permission_request_cb, NULL);
   evas_object_smart_callback_add(view, "title,changed", __title_changed_cb,0);
   evas_object_smart_callback_add(view, "load,progress", __load_progress_cb,0);
   evas_object_smart_callback_add(view, "load,progress,started", __load_progress_started_cb,0);
@@ -898,6 +901,16 @@ void __search_unfocused_cb(void *data, Evas_Object *obj, void *event_info)
     elm_entry_entry_set(entry, "input search text");
 }
 
+// Callback for showing permission request for media request
+void __usermedia_permission_request_cb(void *data, Evas_Object *obj, void *event_info)
+{
+  Ewk_User_Media_Permission_Request* permissionRequest=
+      (Ewk_User_Media_Permission_Request*)event_info;
+  // Simulating the User Pemission request for Allowing the media request.
+  ewk_user_media_permission_request_set(permissionRequest,EINA_TRUE);
+  printf("APP.C __usermedia_permission_request_cb Allowed User Media Request: \n");
+}
+
 void __search_focused_cb(void *data, Evas_Object *obj, void *event_info)
 {
   Evas_Object* entry = data;