1 #ifndef __DALI_TOOLKIT_VIDEO_VIEW_H__
2 #define __DALI_TOOLKIT_VIDEO_VIEW_H__
5 * Copyright (c) 2016 Samsung Electronics Co., Ltd.
7 * Licensed under the Apache License, Version 2.0 (the "License");
8 * you may not use this file except in compliance with the License.
9 * You may obtain a copy of the License at
11 * http://www.apache.org/licenses/LICENSE-2.0
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS,
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
22 #include <dali-toolkit/public-api/controls/control.h>
30 namespace Internal DALI_INTERNAL
33 } // namespace Internal
36 * @addtogroup dali_toolkit_controls_video_view
41 * @brief VideoView is a control for video playback and display.
43 * For working VideoView, a video plugin for a platform should be provided.
46 * | %Signal Name | Method |
47 * |---------------|-------------------------|
48 * | finished | @ref FinishedSignal() |
52 * | %Action Name | Attributes | Description |
53 * |-----------------|----------------------------------------------------|---------------------------------------------------------|
54 * | videoPlay | Doesn't have attributes | Plays video. See @ref DoAction() |
55 * | videoPause | Doesn't have attributes | Pauses video. See @ref DoAction() |
56 * | videoStop | Doesn't have attributes | Stops video. See @ref DoAction() |
57 * | videoForward | The position ( millisecond ) for forward playback | Sets forward position for playback. See @ref DoAction() |
58 * | videoBackward | The position ( millisecond ) for backward playback | Sets backward position for playback. See @ref DoAction()|
62 class DALI_IMPORT_API VideoView: public Control
67 typedef Signal< void (VideoView&) > VideoViewSignalType; ///< Video playback finished signal type @ SINCE_1_1.38
70 * @brief The start and end property ranges for this control.
75 PROPERTY_START_INDEX = Control::CONTROL_PROPERTY_END_INDEX + 1, ///< @SINCE_1_0.0
83 * @brief name "video", video file url as string type or Property::Map
86 VIDEO = PROPERTY_START_INDEX,
89 * @brief name "looping", looping status, true or false
95 * @brief name "muted", mute status, true or false
101 * @brief name "volume", left and right volume scalar as float type, Property::Map with two values ( "left" and "right" )
111 * @brief Creates an initialized VideoView.
113 * @return A handle to a newly allocated Dali ImageView
115 * @note VideoView will not display anything
117 static VideoView New();
120 * @brief Creates an initialized VideoView.
121 * If the string is empty, VideoView will not display anything
124 * @param[in] url The url of the video resource to display
125 * @return A handle to a newly allocated Dali VideoView
127 static VideoView New( const std::string& url );
130 * @brief Create an uninitialized VideoView
138 * This is non-virtual since derived Handel types must not contain data or virtual methods
144 * @brief Copy constructor
147 * @param[in] videoView VideoView to copy. The copied VideoView will point at the same implementation
149 VideoView( const VideoView& videoView );
152 * @brief Assignment operator.
155 * @param[in] videoView The VideoView to assign from.
156 * @return The updated VideoView.
158 VideoView& operator=( const VideoView& videoView );
161 * @brief Downcast a handle to VideoView handle.
163 * If handle points to a VideoView the downcast produces valid
164 * handle. If not the returned handle is left uninitialized.
167 * @param[in] handle Handle to an object
168 * @return handle to a VideoView or an uninitialized handle
170 static VideoView DownCast( BaseHandle handle );
173 * @brief Starts the video playback.
179 * @brief Pauses the video playback.
185 * @brief Stops the video playback.
191 * @brief Seeks forward by the specified number of milliseconds.
194 * @param[in] millisecond The position for forward playback
196 void Forward( int millisecond );
199 * @brief Seeks backward by the specified number of milliseconds.
202 * @param[in] millisecond The position for backward playback
204 void Backward( int millisecond );
207 * @brief Connect to this signal to be notified when a video playback have finished.
210 * @return A signal object to connect with.
212 VideoViewSignalType& FinishedSignal();
214 public: // Not intended for application developers
218 * @brief Creates a handle using the Toolkit::Internal implementation.
221 * @param[in] implementation The VideoView implementation.
223 DALI_INTERNAL VideoView( Internal::VideoView& implementation );
226 * @brief Allows the creation of this VideoView from an Internal::CustomActor pointer.
229 * @param[in] internal A pointer to the internal CustomActor.
231 DALI_INTERNAL VideoView( Dali::Internal::CustomActor* internal );
240 } // namespace Toolkit
244 #endif // __DALI_TOOLKIT_VIDEO_VIEW_H__