Example usage for com.google.gwt.media.client Video setSrc

List of usage examples for com.google.gwt.media.client Video setSrc

Introduction

In this page you can find the example usage for com.google.gwt.media.client Video setSrc.

Prototype

public void setSrc(String url) 

Source Link

Document

Sets the source URL for the media.

Usage

From source file:org.jbpm.form.builder.ng.model.client.form.items.VideoFormItem.java

License:Apache License

private void populate(Video video) {
    if (video != null) {
        if (this.cssClassName != null) {
            video.setStyleName(this.cssClassName);
        }//from   ww  w. j  av a 2  s  .c om
        if (this.getHeight() != null) {
            video.setHeight(this.getHeight());
        }
        if (this.getWidth() != null) {
            video.setWidth(this.getWidth());
        }
        if (this.videoUrl != null && !"".equals(this.videoUrl)) {
            video.setSrc(this.videoUrl);
        }
        if (this.dataType != null) {
            video.getElement().setPropertyObject("type", this.dataType);
        }
        video.setControls(true);
    }
}

From source file:org.jbpm.form.builder.ng.model.client.form.items.VideoFormItem.java

License:Apache License

@Override
public Widget cloneDisplay(Map<String, Object> formData) {
    Video v = Video.createIfSupported();
    if (v == null) {
        return new Label(notSupported.getText());
    }/* w w w .j ava2 s .  c om*/
    populate(v);
    Object input = getInputValue(formData);
    if (v != null && input != null) {
        String url = input.toString();
        v.setSrc(url);
        if (url.endsWith(".ogv")) {
            v.getElement().setPropertyString("type", "video/ogg");
        } else if (url.endsWith(".mpeg") || url.endsWith(".mpg")) {
            v.getElement().setPropertyString("type", "video/mpeg");
        } else if (url.endsWith(".avi")) {
            v.getElement().setPropertyString("type", "video/avi");
        }
    }
    super.populateActions(v.getElement());
    return v;
}