List of usage examples for com.google.gwt.dom.client VideoElement getSrc
public final native String getSrc() ;
From source file:gwt.material.design.addins.client.ui.MaterialCameraCapture.java
License:Apache License
@Override protected void onLoad() { VideoElement el = getElement().cast(); if (el.getSrc() == null || el.isPaused()) { play();//from w w w .ja v a2 s . c om } }
From source file:gwt.material.design.addins.client.ui.MaterialCameraCapture.java
License:Apache License
/** * <p>//from ww w . ja v a2s . c om * 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(); } }