PlayerBottomView.ets 1.26 KB
import { WDPlayerController } from 'wdPlayer/Index';
import { PlayerTitleView } from './PlayerTitleView'
import { PlayerProgressView } from './PlayerProgressView'
import { ContentDetailDTO } from 'wdBean/Index';
import { DisplayDirection } from 'wdConstant/Index';

@Component
export struct PlayerBottomView {
  private playerController?: WDPlayerController;
  @State bottomSafeHeight: number = AppStorage.get<number>('bottomSafeHeight') || 0
  @Consume showComment?: boolean
  @Consume isOpenDetail?: boolean
  @Consume isDragging?: boolean
  @Consume contentDetailData: ContentDetailDTO
  @Consume displayDirection: DisplayDirection
  @Prop index: number = 0
  @Prop currentIndex: number = 0

  aboutToAppear(): void {
  }

  build() {
    Column() {
      PlayerTitleView()
      PlayerProgressView({
        playerController: this.playerController,
        index: this.index,
        currentIndex: this.currentIndex,
      })
    }
    .width('100%')
    .alignItems(HorizontalAlign.Start)
    .position({ x: 0, y: '100%' })
    .markAnchor({ y: '100%' })
    .linearGradient({
      colors: [
        ['rgba(0, 0, 0, 0.0)', 0.0], ['rgba(0, 0, 0, 0.5)', 1.0]
      ]
    })
    .visibility(this.displayDirection === DisplayDirection.VERTICAL ?
    Visibility.Visible : Visibility.None)
  }
}