1 #ifndef __DALI_VIDEO_PLAYER_H__
2 #define __DALI_VIDEO_PLAYER_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/public-api/object/base-handle.h>
25 #include "video-player-plugin.h"
38 } // namespace Adaptor
40 } // namespace Internal
43 * @brief VideoPlayer class is used for video playback.
46 class DALI_IMPORT_API VideoPlayer: public BaseHandle
63 * @brief Creates a new instance of a VideoPlayer.
66 static VideoPlayer New();
69 * @brief Copy constructor.
72 * @param[in] player VideoPlayer to copy. The copied player will point at the same implementation
74 VideoPlayer( const VideoPlayer& player );
77 * @brief Assignment operator.
80 * @param[in] player The VideoPlayer to assign from.
81 * @return The updated VideoPlayer.
83 VideoPlayer& operator=( const VideoPlayer& player );
86 * @brief Downcast a handle to VideoPlayer handle.
88 * If handle points to a VideoPlayer the downcast produces valid
89 * handle. If not the returned handle is left uninitialized.
92 * @param[in] handle Handle to an object
93 * @return Handle to a VideoPlayer or an uninitialized handle
95 static VideoPlayer DownCast( BaseHandle handle );
98 * @brief Sets a URL of the video file to play.
101 * @param [in] url The url of video file
103 void SetUrl( const std::string& url );
106 * @brief Returns the URL of the video file.
108 * @return Url of string type
110 std::string GetUrl();
113 * @brief Sets the player looping status.
116 * @param [in] looping The new looping status: true or false
118 void SetLooping(bool looping);
121 * @brief Returns the player looping status.
124 * @return True if player is looping, false otherwise.
129 * @brief Starts the video playback.
135 * @brief Pauses the video playback.
141 * @brief Stops the video playback.
147 * @brief Sets the player mute status.
149 * @param[in] mute The new mute status, true is mute.
151 void SetMute( bool mute );
154 * @brief Returns the player mute status.
156 * @return True if player is mute.
161 * @brief Sets the player volume.
163 * @param[in] left The left volume scalar
164 * @param[in] right The right volume scalar
166 void SetVolume( float left, float right );
169 * @brief Returns current volume factor.
171 * @param[out] left The current left volume scalar
172 * @param[out] right The current right volume scalar
174 void GetVolume( float& left, float& right );
177 * @brief Sets video rendering target.
179 * @param[in] target The target for video rendering, window surface or native image source
181 void SetRenderingTarget( Any target );
184 * @brief Sets the position for playback.
187 * @param[in] millisecond The position for playback
189 void SetPlayPosition( int millisecond );
192 * @brief Gets the current position in milliseconds.
195 * @return The current position of playback
197 int GetPlayPosition();
200 * @brief Sets the area of video display.
202 * param[in] area The left-top position and size of the video display area
204 void SetDisplayArea( DisplayArea area );
207 * @brief Sets video display rotation
209 * @param[in] rotation The rotation of display
211 void SetDisplayRotation( Dali::VideoPlayerPlugin::DisplayRotation rotation );
214 * @brief Returns rotation of current video display
216 * @return The rotation of current display
218 Dali::VideoPlayerPlugin::DisplayRotation GetDisplayRotation();
221 * @brief Connect to this signal to be notified when a video playback have finished.
224 * @return A signal object to connect with.
226 Dali::VideoPlayerPlugin::VideoPlayerSignalType& FinishedSignal();
229 * @brief Seeks forward by the specified number of milliseconds.
232 * @param[in] millisecond The position for forward playback
234 void Forward( int millisecond );
237 * @brief Seeks backward by the specified number of milliseconds.
240 * @param[in] millisecond The position for backward playback
242 void Backward( int millisecond );
244 private: // Not intended for application developers
247 * @brief Internal constructor
250 explicit DALI_INTERNAL VideoPlayer( Internal::Adaptor::VideoPlayer* internal );