VideosClient

public class VideosClient extends GoogleApi<Games.GamesOptions>

A client to interact with videos.

Nested Class Summary

interface VideosClient.OnCaptureOverlayStateListener Listener that will notify about key user interactions with the overlay, such as starting/stopping capture or dismissing the overlay. 

Constant Summary

int CAPTURE_OVERLAY_STATE_CAPTURE_STARTED State used to indicate that the user has initiated capture via the capture overlay.
int CAPTURE_OVERLAY_STATE_CAPTURE_STOPPED State used to indicate that the user has stopped capturing via the capture overlay.
int CAPTURE_OVERLAY_STATE_DISMISSED State used to indicate that the user has dismissed the capture overlay and it is no longer visible.
int CAPTURE_OVERLAY_STATE_SHOWN State used to indicate that the capture overlay is drawn on the screen and visible to the user.

Public Method Summary

Task<VideoCapabilities>
getCaptureCapabilities()
Returns a Task which asynchronously fetches the VideoCapabilities of the service, whether the mic or front-facing camera are supported, if the service can write to external storage, and what capture modes and quality levels are available.
Task<Intent>
getCaptureOverlayIntent()
Returns a Task which asynchronously loads an Intent to launch the capture overlay.
Task<CaptureState>
getCaptureState()
Returns a Task which asynchronously fetches the current CaptureState of the capture service.
Task<Boolean>
isCaptureAvailable(int captureMode)
Returns a Task which asynchronously fetches whether the capture service is already in use.
Task<Boolean>
isCaptureSupported()
Returns a Task which asynchronously checks whether the device supports capture.
Task<Void>
registerOnCaptureOverlayStateChangedListener(VideosClient.OnCaptureOverlayStateListener listener)
Returns a Task which asynchronously registers a VideosClient.OnCaptureOverlayStateListener to listen for changes to the overlay state launched by getCaptureOverlayIntent().
Task<Boolean>
unregisterOnCaptureOverlayStateChangedListener(VideosClient.OnCaptureOverlayStateListener listener)
Returns a Task which asynchronously unregisters this client's overlay state update listener, if any, and loads the result.

Inherited Method Summary

Constants

public static final int CAPTURE_OVERLAY_STATE_CAPTURE_STARTED

State used to indicate that the user has initiated capture via the capture overlay.

Constant Value: 2

public static final int CAPTURE_OVERLAY_STATE_CAPTURE_STOPPED

State used to indicate that the user has stopped capturing via the capture overlay.

Constant Value: 3

public static final int CAPTURE_OVERLAY_STATE_DISMISSED

State used to indicate that the user has dismissed the capture overlay and it is no longer visible.

Constant Value: 4

public static final int CAPTURE_OVERLAY_STATE_SHOWN

State used to indicate that the capture overlay is drawn on the screen and visible to the user.

Constant Value: 1

Public Methods

public Task<VideoCapabilities> getCaptureCapabilities ()

Returns a Task which asynchronously fetches the VideoCapabilities of the service, whether the mic or front-facing camera are supported, if the service can write to external storage, and what capture modes and quality levels are available.

Required Scopes: SCOPE_GAMES_LITE

public Task<Intent> getCaptureOverlayIntent ()

Returns a Task which asynchronously loads an Intent to launch the capture overlay. This will automatically handle any necessary resolution intents.

The returned Task can fail with a RemoteException.

Required Scopes: SCOPE_GAMES_LITE

public Task<CaptureState> getCaptureState ()

Returns a Task which asynchronously fetches the current CaptureState of the capture service. This will inform about whether the capture overlay is visible, if the overlay is actively being used to capture, and a much more. See CaptureState for more details.

Required Scopes: SCOPE_GAMES_LITE

public Task<Boolean> isCaptureAvailable (int captureMode)

Returns a Task which asynchronously fetches whether the capture service is already in use. Use this call to check if a start capture API call will return VIDEO_ALREADY_CAPTURING. If the Task result is true, then it's safe to start capturing. If it's already in use then the result is false.

Do not use this call to check if capture is supported, instead use isCaptureSupported() or getCaptureCapabilities().

Required Scopes: SCOPE_GAMES_LITE

Parameters
captureMode The mode to check availability of. Valid choices are CAPTURE_MODE_FILE and CAPTURE_MODE_STREAM.

public Task<Boolean> isCaptureSupported ()

Returns a Task which asynchronously checks whether the device supports capture. If the Task result is true then capture is supported.

Required Scopes: SCOPE_GAMES_LITE

public Task<Void> registerOnCaptureOverlayStateChangedListener (VideosClient.OnCaptureOverlayStateListener listener)

Returns a Task which asynchronously registers a VideosClient.OnCaptureOverlayStateListener to listen for changes to the overlay state launched by getCaptureOverlayIntent().

Note that only one overlay state listener may be active at a time. Calling this method while another overlay state listener was previously registered will replace the original listener with the new one.

Required Scopes: SCOPE_GAMES_LITE

Parameters
listener The listener that is called when the overlay state changes.

public Task<Boolean> unregisterOnCaptureOverlayStateChangedListener (VideosClient.OnCaptureOverlayStateListener listener)

Returns a Task which asynchronously unregisters this client's overlay state update listener, if any, and loads the result. The result will be true if the callback was unregistered and false if this callback wasn't registered previously or is already unregistered.

Required Scopes: SCOPE_GAMES_LITE