2 * @defgroup Video Video
8 * @image html video_inheritance_tree.png
9 * @image latex video_inheritance_tree.eps
11 * @image html player_inheritance_tree.png
12 * @image latex player_inheritance_tree.eps
14 * Elementary comes with two object that help design application that need
17 * The first one, Elm_Video, display a video by using Emotion.
18 * It embeds the video inside an Edje object, so you can do some
19 * animation depending on the video state change. It also implements a
20 * resource management policy to remove this burden from the application.
23 * Elm_Player is a video player that need to be linked with an Elm_Video.
24 * It take care of updating its content according to Emotion event and provide a
25 * way to theme itself. It also automatically raises the priority of the
26 * linked Elm_Video so it will use the video decoder, if available. It also
27 * activates the "remember" function on the linked Elm_Video object.
29 * Both widgets inherit from the @ref Layout one, so that all the
30 * functions acting on it also work for video objects.
32 * The player widget emits the following signals, besides the ones
33 * sent from @ref Layout:
34 * - @c "forward,clicked" - the user clicked the forward button.
35 * - @c "info,clicked" - the user clicked the info button.
36 * - @c "next,clicked" - the user clicked the next button.
37 * - @c "pause,clicked" - the user clicked the pause button.
38 * - @c "play,clicked" - the user clicked the play button.
39 * - @c "prev,clicked" - the user clicked the prev button.
40 * - @c "rewind,clicked" - the user clicked the rewind button.
41 * - @c "stop,clicked" - the user clicked the stop button.
43 * Default content parts of the player widget that you can use for are:
44 * @li "video" - A video of the player
49 * @brief Add a new Elm_Player object to the given parent Elementary (container) object.
51 * @param parent The parent object
52 * @return a new player widget handle or @c NULL, on errors.
54 * This function inserts a new player widget on the canvas.
56 * @see elm_object_part_content_set()
60 EAPI Evas_Object *elm_player_add(Evas_Object *parent);
63 * @brief Add a new Elm_Video object to the given parent Elementary (container) object.
65 * @param parent The parent object
66 * @return a new video widget handle or @c NULL, on errors.
68 * This function inserts a new video widget on the canvas.
70 * @see elm_video_file_set()
74 EAPI Evas_Object *elm_video_add(Evas_Object *parent);
77 * @brief Define the file or URI that will be the video source.
79 * @param video The video object to define the file or URI for the video
80 * of the Elm_Video object.
82 * @param filename The file or URI to target.
83 * Local files can be specified using file:// or by using full file paths.
84 * URI could be remote source of video, like http:// or local source like
85 * WebCam (v4l2://). (You can use Emotion API to request and list
86 * the available Webcam on your system).
88 * @return @c EINA_TRUE on success, @c EINA_FALSE otherwise
90 * This function will explicitly define a file or URI as a source
91 * for the video of the Elm_Video object.
93 * @see elm_video_add()
94 * @see elm_player_add()
98 EAPI Eina_Bool elm_video_file_set(Evas_Object *video, const char *filename);
101 * @brief Get the underlying Emotion object.
103 * @param video The video object to proceed the request on.
104 * @return the underlying Emotion object.
108 EAPI Evas_Object *elm_video_emotion_get(const Evas_Object *video);
111 * @brief Start to play the video
113 * @param video The video object to proceed the request on.
115 * Start to play the video and cancel all suspend state.
119 EAPI void elm_video_play(Evas_Object *video);
122 * @brief Pause the video
124 * @param video The video object to proceed the request on.
126 * Pause the video and start a timer to trigger suspend mode.
130 EAPI void elm_video_pause(Evas_Object *video);
133 * @brief Stop the video
135 * @param video The video object to proceed the request on.
137 * Stop the video and put the emotion in deep sleep mode.
141 EAPI void elm_video_stop(Evas_Object *video);
144 * @brief Is the video actually playing.
146 * @param video The video object to proceed the request on.
147 * @return @c EINA_TRUE if the video is actually playing.
149 * You should consider watching event on the object instead of polling
154 EAPI Eina_Bool elm_video_is_playing_get(const Evas_Object *video);
157 * @brief Is it possible to seek inside the video.
159 * @param video The video object to proceed the request on.
160 * @return @c EINA_TRUE if is possible to seek inside the video.
164 EAPI Eina_Bool elm_video_is_seekable_get(const Evas_Object *video);
167 * @brief Is the audio muted.
169 * @param video The video object to proceed the request on.
170 * @return @c EINA_TRUE if the audio is muted.
174 EAPI Eina_Bool elm_video_audio_mute_get(const Evas_Object *video);
177 * @brief Change the mute state of the Elm_Video object.
179 * @param video The video object to proceed the request on.
180 * @param mute The new mute state.
184 EAPI void elm_video_audio_mute_set(Evas_Object *video, Eina_Bool mute);
187 * @brief Get the audio level of the current video.
189 * @param video The video object to proceed the request on.
190 * @return the current audio level.
194 EAPI double elm_video_audio_level_get(const Evas_Object *video);
197 * @brief Set the audio level of an Elm_Video object.
199 * @param video The video object to proceed the request on.
200 * @param volume The new audio volume.
204 EAPI void elm_video_audio_level_set(Evas_Object *video, double volume);
207 * @brief Get the current position (in seconds) being played in the
210 * @param video The video object.
211 * @return The time (in seconds) since the beginning of the media file.
215 EAPI double elm_video_play_position_get(const Evas_Object *video);
218 * @brief Set the current position (in seconds) to be played in the
221 * @param video The video object.
222 * @param position The time (in seconds) since the beginning of the media file.
226 EAPI void elm_video_play_position_set(Evas_Object *video, double position);
228 * @brief Get the total playing time (in seconds) of the Elm_Video object.
230 * @param video The video object.
231 * @return The total duration (in seconds) of the media file.
235 EAPI double elm_video_play_length_get(const Evas_Object *video);
238 * @brief Set whether the object can remember the last played position.
240 * @param video The video object.
241 * @param remember the last played position of the Elm_Video object.
243 * @note This API only serves as indication. System support is required.
247 EAPI void elm_video_remember_position_set(Evas_Object *video, Eina_Bool remember);
250 * @brief Set whether the object can remember the last played position.
252 * @param video The video object.
253 * @return whether the object remembers the last played position (@c EINA_TRUE)
256 * @note This API only serves as indication. System support is required.
260 EAPI Eina_Bool elm_video_remember_position_get(const Evas_Object *video);
263 * @brief Get the title (for instance DVD title) from this emotion object.
265 * @param video The Elm_Video object.
266 * @return A string containing the title.
268 * This function is only useful when playing a DVD.
270 * @note Don't change or free the string returned by this function.
274 EAPI const char *elm_video_title_get(const Evas_Object *video);