Example usage for com.google.gwt.dom.client VideoElement play

List of usage examples for com.google.gwt.dom.client VideoElement play

Introduction

In this page you can find the example usage for com.google.gwt.dom.client VideoElement play.

Prototype

public final native void play() ;

Source Link

Document

Causes playback of the resource to be started or resumed.

Usage

From source file:gwt.material.design.addins.client.ui.MaterialCameraCapture.java

License:Apache License

/**
 * <p>//  w w w  .  ja  va  2  s . co m
 * Starts the video stream from the camera. This is called when the component is loaded.
 * Use {@link CameraCaptureHandler}s to be notified when the stream actually starts or if
 * an error occurs.
 * </p>
 * <p>
 * At this point the user is requested by the browser to allow the application to use the camera.
 * If the user doesn't allow it, an error is notified to the {@link CameraCaptureHandler}s.
 * </p>
 */
public void play() {
    if (!isSupported()) {
        onCameraCaptureError("MaterialCameraCapture is not supported in this browser.");
        return;
    }
    VideoElement el = getElement().cast();
    if (el.getSrc() == null) {
        nativePlay(getElement());
    } else {
        el.play();
    }
}