devilhorns pushed a commit to branch master.

http://git.enlightenment.org/apps/express.git/commit/?id=98551bf3d7f82bee62809a6693f65d65bf7217e7

commit 98551bf3d7f82bee62809a6693f65d65bf7217e7
Author: Chris Michael <cp.mich...@samsung.com>
Date:   Thu Aug 13 12:08:44 2015 -0400

    express: Allow download progress for movies played in popup window
    
    Signed-off-by: Chris Michael <cp.mich...@samsung.com>
---
 src/bin/media.c | 32 +++++++++++++++++++++++++++-----
 1 file changed, 27 insertions(+), 5 deletions(-)

diff --git a/src/bin/media.c b/src/bin/media.c
index e020d70..e7791c6 100644
--- a/src/bin/media.c
+++ b/src/bin/media.c
@@ -700,11 +700,27 @@ _mov_cb_decode_stop(void *data, Evas_Object *obj 
EINA_UNUSED, void *event EINA_U
    evas_object_smart_callback_call(data, "loop", NULL);
 }
 
-/* static void */
-/* _mov_cb_progress(void *data, Evas_Object *obj EINA_UNUSED, void *event 
EINA_UNUSED) */
-/* { */
+static void
+_mov_cb_progress(void *data, Evas_Object *obj EINA_UNUSED, void *event 
EINA_UNUSED)
+{
+   Media *sd;
+
+   if (!(sd = evas_object_smart_data_get(data))) return;
+   DBG("Movie Progress: '%s' '%3.3f",
+       emotion_object_progress_info_get(sd->o_img),
+       emotion_object_progress_status_get(sd->o_img));
+}
 
-/* } */
+static void
+_mov_cb_ref(void *data, Evas_Object *obj EINA_UNUSED, void *event EINA_UNUSED)
+{
+   Media *sd;
+
+   if (!(sd = evas_object_smart_data_get(data))) return;
+   DBG("Movie Ref: '%s' num '%i'",
+       emotion_object_ref_file_get(sd->o_img),
+       emotion_object_ref_num_get(sd->o_img));
+}
 
 static void
 _mov_cb_play(void *data, Evas_Object *obj EINA_UNUSED, const char *emission 
EINA_UNUSED, const char *src EINA_UNUSED)
@@ -809,6 +825,10 @@ _mov_type_init(Evas_Object *obj)
                                   _mov_cb_frame_resize, obj);
    evas_object_smart_callback_add(sd->o_img, "decode_stop",
                                   _mov_cb_decode_stop, obj);
+   evas_object_smart_callback_add(sd->o_img, "progress_change",
+                                  _mov_cb_progress, obj);
+   evas_object_smart_callback_add(sd->o_img, "ref_change",
+                                  _mov_cb_ref, obj);
 
    emotion_object_file_set(sd->o_img, sd->realf);
    if (((sd->mode & MEDIA_OPTIONS_MASK) & MEDIA_RECOVER)
@@ -1137,7 +1157,7 @@ _media_add(Evas_Object *parent, const char *src, int 
mode, Media_Type type)
    sd->tmpfd = -1;
 
 #if HAVE_MKSTEMPS
-   if (_util_link_is_url(sd->src) && (type != MEDIA_TYPE_MOV))
+   if (_util_link_is_url(sd->src))// && (type != MEDIA_TYPE_MOV))
      {
         const char *ext = NULL;
         char *buff;
@@ -1196,6 +1216,7 @@ _media_add(Evas_Object *parent, const char *src, int 
mode, Media_Type type)
                {
                   if (!(sd->url = ecore_con_url_new(buff)))
                     {
+                       ERR("Failed to connect to url: %s", buff);
                        unlink(tmp);
                        close(sd->tmpfd);
                     }
@@ -1206,6 +1227,7 @@ _media_add(Evas_Object *parent, const char *src, int 
mode, Media_Type type)
                          {
                             unlink(tmp);
                             close(sd->tmpfd);
+                            sd->url = NULL;
                          }
                        else
                          {

-- 


Reply via email to