180922886Sopenharmony_ci/*
280922886Sopenharmony_ci * Copyright (c) 2024 Huawei Device Co., Ltd.
380922886Sopenharmony_ci * Licensed under the Apache License, Version 2.0 (the "License");
480922886Sopenharmony_ci * you may not use this file except in compliance with the License.
580922886Sopenharmony_ci * You may obtain a copy of the License at
680922886Sopenharmony_ci *
780922886Sopenharmony_ci *     http://www.apache.org/licenses/LICENSE-2.0
880922886Sopenharmony_ci *
980922886Sopenharmony_ci * Unless required by applicable law or agreed to in writing, software
1080922886Sopenharmony_ci * distributed under the License is distributed on an "AS IS" BASIS,
1180922886Sopenharmony_ci * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1280922886Sopenharmony_ci * See the License for the specific language governing permissions and
1380922886Sopenharmony_ci * limitations under the License.
1480922886Sopenharmony_ci */
1580922886Sopenharmony_ci
1680922886Sopenharmony_ciconst TAG = 'avcastpicker_component ';
1780922886Sopenharmony_ci
1880922886Sopenharmony_ci@Component
1980922886Sopenharmony_ciexport struct AVCastPicker {
2080922886Sopenharmony_ci
2180922886Sopenharmony_ci  /**
2280922886Sopenharmony_ci   * Custom builder from application
2380922886Sopenharmony_ci   */
2480922886Sopenharmony_ci  @BuilderParam customPicker: (() => void)
2580922886Sopenharmony_ci
2680922886Sopenharmony_ci  build() {
2780922886Sopenharmony_ci    Column() {
2880922886Sopenharmony_ci      if (this.customPicker === undefined) {
2980922886Sopenharmony_ci        this.buildDefaultPicker();
3080922886Sopenharmony_ci      } else {
3180922886Sopenharmony_ci        this.buildCustomPicker();
3280922886Sopenharmony_ci      }
3380922886Sopenharmony_ci    }
3480922886Sopenharmony_ci    .size({width: '100%', height: '100%'})
3580922886Sopenharmony_ci  }
3680922886Sopenharmony_ci
3780922886Sopenharmony_ci  @Builder
3880922886Sopenharmony_ci  private buildDefaultPicker() {
3980922886Sopenharmony_ci    Column() {
4080922886Sopenharmony_ci      Button() {
4180922886Sopenharmony_ci        Image($r('sys.media.ohos_ic_public_cast_stream'))
4280922886Sopenharmony_ci        .size({width: '100%', height: '100%'})
4380922886Sopenharmony_ci        .draggable(false)
4480922886Sopenharmony_ci      }
4580922886Sopenharmony_ci      .type(ButtonType.Circle)
4680922886Sopenharmony_ci      .backgroundColor('#00000000')
4780922886Sopenharmony_ci      .size({width: '100%', height: '100%'})
4880922886Sopenharmony_ci    }
4980922886Sopenharmony_ci    .size({width: '100%', height: '100%'})
5080922886Sopenharmony_ci  }
5180922886Sopenharmony_ci
5280922886Sopenharmony_ci  @Builder
5380922886Sopenharmony_ci  private buildCustomPicker() {
5480922886Sopenharmony_ci    Column() {
5580922886Sopenharmony_ci      Button() {
5680922886Sopenharmony_ci        this.customPicker();
5780922886Sopenharmony_ci      }
5880922886Sopenharmony_ci      .type(ButtonType.Circle)
5980922886Sopenharmony_ci      .backgroundColor('#00000000')
6080922886Sopenharmony_ci      .size({width: '100%', height: '100%'})
6180922886Sopenharmony_ci    }
6280922886Sopenharmony_ci    .size({width: '100%', height: '100%'})
6380922886Sopenharmony_ci  }
6480922886Sopenharmony_ci}