3 # include "elementary_config.h"
5 #include <Elementary.h>
6 #ifndef ELM_LIB_QUICKLAUNCH
9 my_bt_open(void *data, Evas_Object *obj __UNUSED__, void *event_info)
11 Evas_Object *video = data;
12 const char *file = event_info;
16 elm_video_file_set(video, file);
17 elm_video_play(video);
22 _notify_show(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
24 evas_object_show(data);
28 _notify_block(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
30 elm_notify_timeout_set(data, 0);
31 evas_object_show(data);
35 _notify_unblock(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
37 elm_notify_timeout_set(data, 3.0);
38 evas_object_show(data);
42 test_video(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
44 Evas_Object *win, *bg, *video, *bt, *tb, *notify, *player;
46 win = elm_win_add(NULL, "video", ELM_WIN_BASIC);
47 elm_win_title_set(win, "Video");
48 elm_win_autodel_set(win, EINA_TRUE);
49 elm_win_alpha_set(win, EINA_TRUE); /* Needed to turn video fast path on */
52 evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
53 elm_win_resize_object_add(win, bg);
56 video = elm_video_add(win);
57 evas_object_size_hint_weight_set(video, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
58 elm_win_resize_object_add(win, video);
59 evas_object_show(video);
61 notify = elm_notify_add(win);
62 elm_notify_orient_set(notify, ELM_NOTIFY_ORIENT_BOTTOM);
63 elm_notify_timeout_set(notify, 3.0);
65 player = elm_player_add(win);
66 elm_object_content_set(player, video);
67 elm_object_content_set(notify, player);
68 evas_object_show(player);
70 tb = elm_table_add(win);
71 evas_object_size_hint_weight_set(tb, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
72 elm_win_resize_object_add(win, tb);
74 bt = elm_fileselector_button_add(win);
75 elm_object_text_set(bt, "Select Video");
76 evas_object_smart_callback_add(bt, "file,chosen", my_bt_open, video);
77 evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
78 evas_object_size_hint_align_set(bt, 0.5, 0.1);
79 elm_table_pack(tb, bt, 0, 0, 1, 1);
84 evas_object_event_callback_add(video, EVAS_CALLBACK_MOUSE_MOVE, _notify_show, notify);
85 evas_object_event_callback_add(video, EVAS_CALLBACK_MOUSE_IN, _notify_block, notify);
86 evas_object_event_callback_add(video, EVAS_CALLBACK_MOUSE_OUT, _notify_unblock, notify);
88 evas_object_resize(win, 800, 800);
89 evas_object_show(win);