@Override public String generateOutput(boolean textOnly) { if (textOnly) return ""; VideoElement ve = (VideoElement) videoElement.cloneNode(false); for (int i = 0; i < videoElement.getChildCount(); i++) { Node curNode = videoElement.getChild(i); if (curNode.getNodeType() != Node.ELEMENT_NODE) continue; Element el = Element.as(curNode); // Only take "source" and "track" children. if ("SOURCE".equals(el.getTagName()) || "TRACK".equals(el.getTagName())) { ve.appendChild(el.cloneNode(false)); } } if (!ve.getPoster().isEmpty()) { ve.setPoster(ve.getPoster()); } DomUtil.makeAllSrcAttributesAbsolute(ve); DomUtil.stripIds(ve); return ve.getString(); }
@Override public VideoElementWrapper get() { String playerId = Document.get().createUniqueId(); VideoElement videoElem = Document.get().createVideoElement(); videoElem.setId(playerId); videoElem.addClassName(CLASS_NAME); return new VideoElementWrapper(videoElem); }
public static Video createIfSupported() { com.google.gwt.media.client.Video media = com.google.gwt.media.client.Video.createIfSupported(); Video video = null; if (media != null) { video = new Video((VideoElement) media.getMediaElement()); } return video; }
public static native PictureWidgetDriver create(VideoElement video, CanvasElement canvas, Element image) /*-{ return { video: video, canvas: canvas, image: image, streaming: false }; }-*/;
public VideoElementWrapper(VideoElement videoElement) { this.videoElement = videoElement; }
protected Video(VideoElement element) { super(element); }
public final native void texImage2D(int target, int level, int internalformat, int format, int type, VideoElement video) /*-{ this.texImage2D(target, level, internalformat, format, type, video); }-*/;
public final native void texSubImage2D(int target, int level, int xoffset, int yoffset, int format, int type, VideoElement video) /*-{ this.texSubImage2D(target, level, xoffset, yoffset, format, type, video); }-*/;
public final native void texImage2D (int target, int level, int internalformat, int format, int type, VideoElement video) /*-{ this.texImage2D(target, level, internalformat, format, type, video); }-*/;
public final native void texSubImage2D (int target, int level, int xoffset, int yoffset, int format, int type, VideoElement video) /*-{ this.texSubImage2D(target, level, xoffset, yoffset, format, type, video); }-*/;