inherit: "default"; \
color: GALLERY_COLOR_VIDEO_BTN_PRESSED; \
} \
+ desc { "disabled"; \
+ inherit: "pressed"; \
+ } \
} \
rect { "event"; \
norepeat; \
} \
} \
programs { \
+ program { "on_disabled"; \
+ signal: "elm,state,disabled"; \
+ source: "elm";\
+ action: STATE_SET "disabled"; \
+ target: "gallery.icon"; \
+ } \
+ program { "on_enabled"; \
+ signal: "elm,state,enabled"; \
+ source: "elm"; \
+ action: STATE_SET "default"; \
+ target: "gallery.icon"; \
+ } \
program { "on_press"; \
signal: "elm,action,press"; \
source: ""; \
ucl::Result seekToStart();
void createControls();
- void createButton(ucl::ElmStyle style, ucl::EdjePart part,
- const ucl::WidgetEventHandler &handler);
+ ucl::StyledWidgetSRef createButton(ucl::ElmStyle style,
+ ucl::EdjePart part, const ucl::WidgetEventHandler &handler);
bool resetTimer(Ecore_Timer *&timer, double timeout, Ecore_Task_Cb func);
void stopTimer(Ecore_Timer *&timer);
SoundManagerSRef m_soundMgr;
ucl::LayoutSRef m_content;
ucl::WidgetSRef m_image;
+ ucl::StyledWidgetSRef m_volumeMuteBtn;
TouchParserSRef m_touchParser;
player_h m_player;
int m_videoDuration;
WEAK_DELEGATE(VideoPlayerPage::onVolumeBtnClick,
asWeak(*this)));
- createButton(impl::STYLE_VOLUME_MUTE_BTN, impl::PART_VOLUME_MUTE_BTN,
+ m_volumeMuteBtn = createButton(impl::STYLE_VOLUME_MUTE_BTN,
+ impl::PART_VOLUME_MUTE_BTN,
WEAK_DELEGATE(VideoPlayerPage::onVolumeBtnClick,
asWeak(*this)));
asWeak(*this)));
}
- void VideoPlayerPage::createButton(const ElmStyle style,
+ StyledWidgetSRef VideoPlayerPage::createButton(const ElmStyle style,
const EdjePart part, const WidgetEventHandler &handler)
{
const auto btn = makeShared<StyledWidget>(elm_button_add(*m_content));
m_content->setContent(*btn, part);
btn->addEventHandler(BTN_CLICKED, handler);
+
+ return btn;
}
bool VideoPlayerPage::resetTimer(Ecore_Timer *&timer,
if (!m_isControlsVisible) {
m_isControlsVisible = true;
- if (m_soundMgr && m_soundMgr->isMediaDeviceReady()) {
- showVolumeBtn();
- }
+ showVolumeBtn();
if (m_state == State::PLAYING) {
m_content->emit(impl::SHOW_PAUSE_BTN);
void VideoPlayerPage::showVolumeBtn()
{
- if (m_soundMgr->getCurrentMediaVolume() > 0) {
- m_content->emit(impl::SHOW_VOLUME_ON_BTN);
- } else {
+ if (!m_soundMgr || !m_soundMgr->isMediaDeviceReady()) {
m_content->emit(impl::SHOW_VOLUME_MUTE_BTN);
+ disable(*m_volumeMuteBtn);
+ } else {
+ if (m_soundMgr->getCurrentMediaVolume() > 0) {
+ m_content->emit(impl::SHOW_VOLUME_ON_BTN);
+ } else {
+ m_content->emit(impl::SHOW_VOLUME_MUTE_BTN);
+ enable(*m_volumeMuteBtn);
+ }
}
}
void VideoPlayerPage::onMediaDeviceStateChanged()
{
if (m_isControlsVisible) {
- if (m_soundMgr->isMediaDeviceReady()) {
- showVolumeBtn();
- } else {
- m_content->emit(impl::HIDE_VOLUME_BTN);
- }
+ showVolumeBtn();
}
}
void VideoPlayerPage::onMediaVolumeChanged()
{
if (m_isControlsVisible) {
- if (m_soundMgr->isMediaDeviceReady()) {
- showVolumeBtn();
- }
+ showVolumeBtn();
}
}
{
m_isPlaybackCompleted = true;
pausePlayback();
- showControls();
+ requestExit();
}
void VideoPlayerPage::onPlaybackInterrupted(player_interrupted_code_e code)