import Dom from '../../libs/dom'
import Widget from '../widget'

class Video extends Widget {
  constructor(layer, screen) {
    super(layer, screen)
    let contanier = Dom.createElement('div', 'video-container comp', this.el)
    this.video = Dom.createElement('video', '', contanier)
  }

  setPaint() {
    this.setListener()
    let newPaint = this._mergePaint()
    this.video.src = newPaint.src
    this.video.autoplay = newPaint.autoplay
    this.video.controls = newPaint.controls
    this.video.loop = newPaint.loop
    this.video.muted = newPaint.muted
  }
}

export default Video
