/*
 * 云存储广告图片
 * EZOpenSDK
 *
 * Created by junecheng on 2024/5/31.
 * Copyright (c) 2024年 Ezviz. All rights reserved.
 */
@Component
export default struct PlaybackAdvertView {
  onAdvertImageClick?: () => void

  build() {
    Image($r('app.media.cloud_ad'))
      .id('cloud_ad')
      .alignRules({
        top: { 'anchor': 'bottomview_toolbar', align: VerticalAlign.Bottom },
        left: { 'anchor': '__container__', align: HorizontalAlign.Start },
        right: { 'anchor': '__container__', align: HorizontalAlign.End }
      })
      .height(90)
      .objectFit(ImageFit.Fill)
      .onClick(() => {
        if (this.onAdvertImageClick) {
          this.onAdvertImageClick()
        }
      })
  }
}