/** * Gets the intrinsic height of video within the element. * * To get the element height, use {@link VideoElement#getOffsetHeight()} * * @return the height, in pixels */ public int getVideoHeight() { return getVideoElement().getVideoHeight(); }
/** * Gets the instrinsic width of the video within the element. * * To get the element width, use {@link VideoElement#getOffsetWidth()} * * @return the width, in pixels */ public int getVideoWidth() { return getVideoElement().getVideoWidth(); }
/** * Returns a poster URL. * * @return a URL containing a poster image * * @see #setPoster(String) */ public String getPoster() { return getVideoElement().getPoster(); }
/** * Native call to capture the frame of the video stream. */ protected String nativeCaptureToDataURL(CanvasElement canvas, Element element, String mimeType) { VideoElement videoElement = (VideoElement) element; int width = videoElement.getVideoWidth(); int height = videoElement.getVideoHeight(); if (Double.isNaN(width) || Double.isNaN(height)) { width = videoElement.getClientWidth(); height = videoElement.getClientHeight(); } canvas.setWidth(width); canvas.setHeight(height); Context2d context = canvas.getContext2d(); context.drawImage(videoElement, 0, 0, width, height); return canvas.toDataUrl(mimeType); }
@Override public VideoBuilder poster(String url) { assertCanAddAttribute().setPoster(url); return this; }
@Override public VideoBuilder height(int height) { assertCanAddAttribute().setHeight(height); return this; }
@Override public VideoBuilder width(int width) { assertCanAddAttribute().setWidth(width); return this; } }
/** * Sets the poster URL. * * @param url the poster image URL * @see #getPoster */ public void setPoster(String url) { getVideoElement().setPoster(url); } }
@Override public VideoBuilder height(int height) { assertCanAddAttribute().setHeight(height); return this; }
@Override public VideoBuilder width(int width) { assertCanAddAttribute().setWidth(width); return this; } }
/** * Sets the poster URL. * * @param url the poster image URL * @see #getPoster */ public void setPoster(String url) { getVideoElement().setPoster(url); } }
/** * Gets the intrinsic height of video within the element. * * To get the element height, use {@link VideoElement#getOffsetHeight()} * * @return the height, in pixels */ public int getVideoHeight() { return getVideoElement().getVideoHeight(); }
/** * Gets the instrinsic width of the video within the element. * * To get the element width, use {@link VideoElement#getOffsetWidth()} * * @return the width, in pixels */ public int getVideoWidth() { return getVideoElement().getVideoWidth(); }
@Override public VideoBuilder height(int height) { assertCanAddAttribute().setHeight(height); return this; }
@Override public VideoBuilder width(int width) { assertCanAddAttribute().setWidth(width); return this; } }
/** * Returns a poster URL. * * @return a URL containing a poster image * * @see #setPoster(String) */ public String getPoster() { return getVideoElement().getPoster(); }
/** * Sets the poster URL. * * @param url the poster image URL * @see #getPoster */ public void setPoster(String url) { getVideoElement().setPoster(url); } }
/** * Gets the intrinsic height of video within the element. * * To get the element height, use {@link VideoElement#getOffsetHeight()} * * @return the height, in pixels */ public int getVideoHeight() { return getVideoElement().getVideoHeight(); }
/** * Gets the instrinsic width of the video within the element. * * To get the element width, use {@link VideoElement#getOffsetWidth()} * * @return the width, in pixels */ public int getVideoWidth() { return getVideoElement().getVideoWidth(); }
/** * Returns a poster URL. * * @return a URL containing a poster image * * @see #setPoster(String) */ public String getPoster() { return getVideoElement().getPoster(); }