/*
- * Copyright (c) 2016 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
*
*/
-// CLASS HEADER
-#include "toolkit-video-player.h"
-
-// EXTERNAL INCLUDES
+#include <dali/devel-api/adaptor-framework/video-player.h>
#include <dali/public-api/object/any.h>
+#include <dali/public-api/object/base-object.h>
+#include <toolkit-application.h>
namespace Dali
{
public:
VideoPlayer()
+ : mUrl(),
+ mVolumeLeft( 0.0f ),
+ mVolumeRight( 0.0f ),
+ mFinishedSignal(),
+ mMuted( false ),
+ mLooping( false),
+ mPlayPosition( 0 ),
+ mDisplyMode( Dali::VideoPlayerPlugin::DisplayMode::DST_ROI )
{
- mMuted = false;
- mLooping = false;
}
void SetMuted( bool muted )
return mLooping;
}
+ void Stop()
+ {
+ if( !mFinishedSignal.Empty() )
+ {
+ mFinishedSignal.Emit();
+ }
+ }
+
+ int GetPlayPosition()
+ {
+ return mPlayPosition;
+ }
+
+ void SetPlayPosition( int pos )
+ {
+ mPlayPosition = pos;
+ }
+
+ Dali::VideoPlayerPlugin::DisplayMode::Type GetDisplayMode() const
+ {
+ return mDisplyMode;
+ }
+
+ void SetDisplayMode( Dali::VideoPlayerPlugin::DisplayMode::Type mode )
+ {
+ mDisplyMode = mode;
+ }
+
+ Any GetMediaPlayer()
+ {
+ return NULL;
+ }
+
+
public:
std::string mUrl;
bool mMuted;
bool mLooping;
+ int mPlayPosition;
+ Dali::VideoPlayerPlugin::DisplayMode::Type mDisplyMode;
};
inline VideoPlayer& GetImplementation( Dali::VideoPlayer& player )
void VideoPlayer::Stop()
{
+ Internal::Adaptor::GetImplementation( *this ).Stop();
}
void VideoPlayer::SetMute( bool mute )
void VideoPlayer::SetPlayPosition( int millisecond )
{
+ Internal::Adaptor::GetImplementation( *this ).SetPlayPosition( millisecond );
}
int VideoPlayer::GetPlayPosition()
{
- return 0;
+ return Internal::Adaptor::GetImplementation( *this ).GetPlayPosition();
}
void VideoPlayer::SetDisplayArea( DisplayArea area )
{
}
+bool VideoPlayer::IsVideoTextureSupported()
+{
+ return ToolkitApplication::DECODED_IMAGES_SUPPORTED;
+}
+
+void VideoPlayer::SetCodecType( Dali::VideoPlayerPlugin::CodecType type )
+{
+}
+
+Dali::VideoPlayerPlugin::CodecType VideoPlayer::GetCodecType() const
+{
+ return Dali::VideoPlayerPlugin::CodecType::DEFAULT;
+}
+
+void VideoPlayer::SetDisplayMode( Dali::VideoPlayerPlugin::DisplayMode::Type mode )
+{
+ Internal::Adaptor::GetImplementation( *this ).SetDisplayMode( mode );
+}
+
+Dali::VideoPlayerPlugin::DisplayMode::Type VideoPlayer::GetDisplayMode() const
+{
+ return Internal::Adaptor::GetImplementation( *this ).GetDisplayMode();
+}
+
+Any VideoPlayer::GetMediaPlayer()
+{
+ return Internal::Adaptor::GetImplementation( *this ).GetMediaPlayer();
+}
+
} // namespace Dali;