1 /* 2 * Copyright (c) 2024 Huawei Device Co., Ltd. 3 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * you may not use this file except in compliance with the License. 5 * You may obtain a copy of the License at 6 * 7 * http://www.apache.org/licenses/LICENSE-2.0 8 * 9 * Unless required by applicable law or agreed to in writing, software 10 * distributed under the License is distributed on an "AS IS" BASIS, 11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 * See the License for the specific language governing permissions and 13 * limitations under the License. 14 */ 15 16 #ifndef FRAMEWORKS_BOOTANIMATION_INCLUDE_BOOT_PLAYER_H 17 #define FRAMEWORKS_BOOTANIMATION_INCLUDE_BOOT_PLAYER_H 18 19 #ifdef PLAYER_FRAMEWORK_ENABLE 20 #include "player.h" 21 #endif 22 #include "transaction/rs_interfaces.h" 23 #include "util.h" 24 25 namespace OHOS { 26 class BootPlayer { 27 public: ~BootPlayer()28 virtual ~BootPlayer() {}; 29 Play()30 virtual void Play() {}; 31 GetResPath(const std::string & type)32 std::string GetResPath(const std::string& type) 33 { 34 if (IsFileExisted(resPath_)) { 35 return FILE_PREFIX + resPath_; 36 } 37 return type == TYPE_VIDEO ? BOOT_VIDEO_PATH : BOOT_SOUND_PATH; 38 } 39 40 Rosen::ScreenId screenId_; 41 std::string resPath_; 42 bool isSoundEnabled_ = false; 43 std::shared_ptr<Media::Player> mediaPlayer_; 44 }; 45 } // namespace OHOS 46 47 #endif // FRAMEWORKS_BOOTANIMATION_INCLUDE_BOOT_PLAYER_H 48