All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.github.mmm.ui.tvm.widget.media.TvmVideoPlayer Maven / Gradle / Ivy

There is a newer version: 0.9.10
Show newest version
/* Copyright (c) The m-m-m Team, Licensed under the Apache License, Version 2.0
 * http://www.apache.org/licenses/LICENSE-2.0 */
package io.github.mmm.ui.tvm.widget.media;

import org.teavm.jso.dom.html.HTMLVideoElement;

import io.github.mmm.ui.api.widget.img.UiAbstractImage;
import io.github.mmm.ui.api.widget.img.UiImage;
import io.github.mmm.ui.api.widget.media.UiVideoPlayer;

/**
 * Implementation of {@link UiVideoPlayer} using TeaVM.
 *
 * @since 1.0.0
 */
public class TvmVideoPlayer extends TvmMediaWidget implements UiVideoPlayer {

  private UiAbstractImage image;

  /**
   * The constructor.
   */
  public TvmVideoPlayer() {

    super(newVideo());
  }

  @Override
  public UiAbstractImage getImage() {

    return this.image;
  }

  @Override
  public void setImage(UiAbstractImage image) {

    if (image instanceof UiImage) {
      this.widget.setPoster(((UiImage) image).getUrl());
    } else {
      // handle UiIcon?
      this.widget.setPoster("");
    }
    this.image = image;
  }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy