Fixed TSAM-9021 Thumbnail blank when play Audio only file 52/93152/1
authorbhutani.92 <bhutani.92@samsung.com>
Thu, 20 Oct 2016 13:05:13 +0000 (18:35 +0530)
committerbhutani.92 <bhutani.92@samsung.com>
Thu, 20 Oct 2016 13:05:13 +0000 (18:35 +0530)
Change-Id: I2bba409026cf4cd8616808bc1dad8d3a9e89b15b
Signed-off-by: bhutani.92 <bhutani.92@samsung.com>
playview/src/widget/vp-play-minicontroller.c
res/edje/vp-images.edc

index 70a7caa..35e873c 100644 (file)
@@ -24,6 +24,7 @@
 #include <minicontrol-type.h>
 
 #include "vp-play-type-define.h"
+#include "mp-video-value-define.h"
 #include "vp-play-string-define.h"
 #include "vp-play-value-define.h"
 #include "vp-play-macro-define.h"
@@ -194,7 +195,7 @@ _load_minicontroller(PlayView *pPlayView)
                return;
        }
        Evas_Object *win = NULL;
-       win = minicontrol_create_window("musicplayer-mini", MINICONTROL_TARGET_VIEWER_QUICK_PANEL, _quick_panel_cb);
+       win = minicontrol_create_window("videoplayer-mini", MINICONTROL_TARGET_VIEWER_QUICK_PANEL, _quick_panel_cb);
 
        if (!win) {
                VideoLogError("window is NULL");
@@ -681,8 +682,20 @@ vp_minicontroller_update(PlayView *pPlayView, bool with_title)
        VideoLogDebug("Updating thumbnail!!!!!!!!!!!!!!");
        char *thumbnail_path = NULL;
        vp_media_contents_get_video_thumbnail_path(pPlayView->szMediaURL, &thumbnail_path);
-       VideoLogInfo("thumbnail = %s:%s", pPlayView->szMediaURL, thumbnail_path);
-       elm_image_file_set(pPlayView->minicon_icon, thumbnail_path, NULL);
+
+       if (thumbnail_path == NULL) {
+               VideoLogInfo("Cannot generate thumbnail for video file. Switching to default path.");
+               char edj_path[1024] = {0};
+
+               char *path = app_get_resource_path();
+               snprintf(edj_path, 1024, "%s%s/%s", path, "edje", VIDEO_PLAYER_IMAGE_NAME_EDJ);
+               free(path);
+               elm_image_file_set(pPlayView->minicon_icon, edj_path, VP_PLAY_NORMAL_AUDIO_ONLY_IMG);
+               evas_object_color_set(pPlayView->minicon_icon, 0, 0, 0, 255);
+       } else {
+               VideoLogInfo("thumbnail = %s:%s", pPlayView->szMediaURL, thumbnail_path);
+               elm_image_file_set(pPlayView->minicon_icon, thumbnail_path, NULL);
+       }
        evas_object_show(pPlayView->minicon_icon);
 
        if (with_title) {
index cc93b6d..af06038 100644 (file)
@@ -29,6 +29,7 @@ RESOURCE_IMAGE("icon/T01_2_button_expand_cancel_press.png")
 
 RESOURCE_IMAGE("player_library_list_thumbnail_default.png")
 RESOURCE_IMAGE("icon/T01_2_icon_search.png")
+RESOURCE_IMAGE(sound_only.png);
 
 RESOURCE_IMAGE("icon/T01_2_icon_video.png")
 RESOURCE_IMAGE("icon/T01-2_video_noitem.png")