[TIZENIOT-2287] Provide video-player service with view type 38/252138/1
authoraman.jeph <aman.jeph@samsung.com>
Tue, 22 Dec 2020 09:18:14 +0000 (14:48 +0530)
committerMohit Kumar <mohit.kr1@samsung.com>
Sat, 23 Jan 2021 06:09:59 +0000 (06:09 +0000)
so player can get correct video-list

Change-Id: I3d28e3744e69710a8f15308ab1be4df12355400d
Signed-off-by: aman.jeph <aman.jeph@samsung.com>
(cherry picked from commit 327cb9baafa1d5f49d2c367bbc0cdb86b31a7692)

inc/ivug-ext-ug.h [changed mode: 0644->0755]
src/main/control/ivug-ext-ug.c [changed mode: 0644->0755]
src/main/control/ivug-parameter.c [changed mode: 0644->0755]
src/main/view/ivug-main-view.cpp [changed mode: 0644->0755]

old mode 100644 (file)
new mode 100755 (executable)
index 9e078af..3b0b7d7
 #include <stdbool.h>
 #include <notification.h>
 
+#include "ivug-datatypes.h"
+
 #ifdef __cplusplus
 extern "C" {
 #endif
 bool ivug_ext_launch_gallery();
 
-bool ivug_ext_launch_videoplayer(const char *uri, bool isLockScreen);
+bool ivug_ext_launch_videoplayer(const char *uri, bool isLockScreen, ivug_view_by type);
 
 #ifdef __cplusplus
 }
old mode 100644 (file)
new mode 100755 (executable)
index 9595090..5bf1bce
@@ -92,7 +92,7 @@ VIDEO_PLAYER_END:
  * @param isLockScreen: lockscreen locked or not
  * @return
  */
-bool ivug_ext_launch_videoplayer(const char *uri, bool isLockScreen)
+bool ivug_ext_launch_videoplayer(const char *uri, bool isLockScreen, ivug_view_by type)
 {
        MSG_IMAGEVIEW_HIGH("URI = %s", uri);
 
@@ -144,6 +144,23 @@ bool ivug_ext_launch_videoplayer(const char *uri, bool isLockScreen)
                goto VIDEO_PLAYER_END;
        }
 
+       // We need to provide the view to video-player to get the correct video list and keep sync of item order
+       // in between the gallery app and video-player.
+       // folder: videos list from a specific folder. folder is obtained from path of passed file
+       // all_folder_video: video list from the folder available
+       // favorite: List of favorite videos
+       char *list_type_value = NULL;
+       if(type == IVUG_VIEW_BY_FAVORITES) {
+               list_type_value = "favorite";
+       } else {
+               list_type_value = (type == IVUG_VIEW_BY_FOLDER)?  "folder" : "all_folder_video";
+       }
+       ret = app_control_add_extra_data(handle, "video_list_type",  list_type_value);
+       if (ret != APP_CONTROL_ERROR_NONE) {
+               MSG_IMAGEVIEW_ERROR("app_control_add_extra_data failed, 0x%08x", ret);
+               goto VIDEO_PLAYER_END;
+       }
+
        ret = app_control_send_launch_request(handle, ivug_ext_app_control_reply_cb, NULL);
        if (ret != APP_CONTROL_ERROR_NONE) {
                MSG_IMAGEVIEW_ERROR("app_control_send_launch_request failed, 0x%08x", ret);
old mode 100644 (file)
new mode 100755 (executable)
old mode 100644 (file)
new mode 100755 (executable)
index 57232f8..0b8ec3c
@@ -789,9 +789,9 @@ _on_slider_playvideo_icon_clicked(void *data, Evas_Object *obj, const char *sour
        } else {
                MSG_MAIN_HIGH("Launching video player");
                if (pMainView->mode == IVUG_MODE_CAMERA_SIMPLE) {
-                       ivug_ext_launch_videoplayer(mdata->filepath, true);
+                       ivug_ext_launch_videoplayer(mdata->filepath, true, pMainView->view_by);
                } else {
-                       ivug_ext_launch_videoplayer(mdata->filepath, false);
+                       ivug_ext_launch_videoplayer(mdata->filepath, false, pMainView->view_by);
                }
        }
 }