#include "msg_center.h"
#include "securec.h"
#include "DialBinParser.h"
+#include "custom_runtime.h"
+#include "MainModel.h"
#include "ModelDialDataFactory.h"
#include "common/low_power_manager.h"
#include "main/include/PullUpDownView.h"
return period_;
}
- void DialViewGroup::UpdateViewsByPeriodicUpdateData()
- {
- ListNode<DialDataType> *node = periodicUpdateTypes_.Head();
- while (node != periodicUpdateTypes_.End())
- {
- DialDataType type = node->data_;
- auto iter = dataTypeMap_.find(static_cast<int16_t>(type));
- if (iter != dataTypeMap_.end())
- {
- ProcessData(type, iter->second);
- }
- node = node->next_;
- }
- if (LowPowerManager::GetInstance()->IsLiteSurfaceInRootView())
- {
- Invalidate();
- }
- }
void DialViewGroup::OnDialFloatDataUpdate(DialDataType type, float data)
{
kaleidoscope_->StopRotateAnimator();
kaleidoscope_->ClearFocus();
}
+ }
+void DialViewGroup::StopDial() {
+ if (MainModel::GetInstance().getVideostate() != false) {
+ return;
+ }
+ MainModel::GetInstance().setVideostate(true);
+ if (video_ != nullptr) {
+ if (!video_->IsStopped()) {
+ video_->StopPlay();
+ }
+ g_video = nullptr;
+ } else if (kaleidoscope_ != nullptr) {
+ kaleidoscope_->StopRotateAnimator();
+ kaleidoscope_->ClearFocus();
+ }
+}
+void DialViewGroup::StartDial() {
+ if (MainModel::GetInstance().getVideostate() != true) {
+ return;
+ }
+ MainModel::GetInstance().setVideostate(false);
+ if (video_ != nullptr) {
+ if (video_->IsPaused()) {
+ video_->ResumePlay();
+ } else if (!video_->IsPlayed()) {
+ video_->StartPlay();
+ }
+ g_video = video_;
+ } else if (kaleidoscope_ != nullptr) {
+ kaleidoscope_->RequestFocus();
+ kaleidoscope_->StartRotateAnimator();
+ }
}
MediaVideoPlay* DialViewGroup::GetVideoPlay()
{
}
return nullptr;
}
+//更新数据
+void DialViewGroup::UpdateViewsByPeriodicUpdateData() {
+ ListNode<DialDataType> *node = periodicUpdateTypes_.Head();
+ while (node != periodicUpdateTypes_.End()) {
+ DialDataType type = node->data_;
+ auto iter = dataTypeMap_.find(static_cast<int16_t>(type));
+ if (iter != dataTypeMap_.end()) {
+ ProcessData(type, iter->second);
+ }
+ node = node->next_;
+ }
+ if (LowPowerManager::GetInstance()->IsLiteSurfaceInRootView()) {
+ Invalidate();
+ }
+ // ota进行视频暂停
+ if (uapi_dev_runtime_get_transmitting_status() == 1) {
+ //暂停视频
+ StopDial();
+ } else {
+ //获取视频
+ StartDial();
+ }
+}
}
\ No newline at end of file