static void _init_video(Evas_Object *win) { Evas_Object *bg, *video, *emotion; bg = elm_bg_add(win); evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); elm_win_resize_object_add(win, bg); evas_object_show(bg); video = elm_video_add(win); evas_object_size_hint_weight_set(video, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); elm_win_resize_object_add(win, video); evas_object_show(video); elm_video_file_set(video, VIDEO_FILE); elm_video_play(video); emotion = elm_video_emotion_get(video); evas_object_smart_callback_add(emotion, "playback_started", _playback_started, win); evas_object_resize(win, 800, 800); evas_object_show(win); }
eina_strbuf_free(str); } static void _emotion_position_update_cb(void *data, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED) { Enna_View_Player_Video_Data *priv = data; Evas_Object *emotion; Evas_Object *edje; double v; time_t timestamp; struct tm *t; Eina_Strbuf *str; emotion = elm_video_emotion_get(priv->video); _update_time_part(priv->layout, "time_current.text", emotion_object_position_get(emotion)); _update_time_part(priv->layout, "time_duration.text", emotion_object_play_length_get(emotion)); timestamp = time(NULL); timestamp += emotion_object_play_length_get(emotion) - emotion_object_position_get(emotion); t = localtime(×tamp); str = eina_strbuf_new(); eina_strbuf_append_printf(str, "End at %02dh%02d", t->tm_hour, t->tm_min); elm_object_part_text_set(priv->layout, "time_end_at.text", eina_strbuf_string_get(str)); eina_strbuf_free(str);