Example usage for com.vaadin.ui Flash setWidth

List of usage examples for com.vaadin.ui Flash setWidth

Introduction

In this page you can find the example usage for com.vaadin.ui Flash setWidth.

Prototype

@Override
    public void setWidth(String width) 

Source Link

Usage

From source file:edu.nps.moves.mmowgli.modules.cards.HowToPlayCardsPopup.java

License:Open Source License

@HibernateSessionThreadLocalConstructor
public HowToPlayCardsPopup() {
    super(null);//w  w w.j a  va2s  . c o m
    super.initGui();

    setModal(true);
    setListener(this);

    setTitleString("How to Play");
    Media m = getMedia();
    Component comp = new Label("Not found");

    if (m.getType() == Media.MediaType.VIDEO) {
        /*
         * Quicktime qt = new Quicktime(null,res); qt.setWidth("94%"); qt.setHeight("340px"); //"100%"); qt.setScale(Scale.Aspect); qt.setAutoplay(true); comp =
         * qt;
         */
    } else if (m.getType() == Media.MediaType.YOUTUBE) {

        try {
            Flash ytp = new Flash();
            ytp.setSource(new ExternalResource("https://www.youtube.com/v/" + m.getUrl()));
            ytp.setParameter("allowFullScreen", "true");
            ytp.setParameter("showRelated", "false");
            ytp.setWidth(CALLTOACTION_VIDEO_W);
            ytp.setHeight(CALLTOACTION_VIDEO_H);
            comp = ytp;
        } catch (Exception ex) {
            System.err.println("Exception instantiating YouTubPlayer: " + ex.getClass().getSimpleName() + ": "
                    + ex.getLocalizedMessage());
        }
    }
    contentVLayout.addComponent(comp);
    contentVLayout.setComponentAlignment(comp, Alignment.MIDDLE_CENTER);
}