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