Following the deprecation of the
[Google Sign-In](https://android-developers.googleblog.com/2024/09/streamlining-android-authentication-credential-manager-replaces-legacy-apis.html)
API, we are removing the games v1 SDK in 2026. After February 2025, you will be unable to publish
titles that are newly integrated with games v1 SDK, on Google Play. We recommend that you use the
games v2 SDK instead.  

While existing titles with the previous games v1 integrations continue to function for a
couple of years, you are encouraged to
[migrate to v2](https://developer.android.com/games/pgs/android/migrate-to-v2)
starting June 2025.  

This guide is for using the Play Games Services v1 SDK. Video recording
is not supported in the Play Games Services v2 SDK.

The video recording API enables you to easily add video recording to your game
and let users share their videos with friends on YouTube in a few simple
steps. For example, you could add a button off of a battle replay screen that
when pressed would bring up the Play Games video recording experience.

This guide shows you how to implement video recording in games using the
Google Play Games Services. The APIs can be found in the
[`com.google.android.gms.games.video`](https://developers.google.com/android/reference/com/google/android/gms/games/video/package-summary) and
[`com.google.android.gms.games`](https://developers.google.com/android/reference/com/google/android/gms/games/package-summary) packages.

## Before you begin

Before you start to use the video recording API:

- Download and review the
  [code sample](https://github.com/playgameservices/android-basic-samples).

- Familiarize yourself with the recommendations described in the
  [Quality Checklist](https://developer.android.com/games/pgs/v1/quality).

## Get the videos client

To start using the video recording API, your game must first obtain a
[`VideosClient`](https://developers.google.com/android/games_v1/reference/com/google/android/gms/games/VideosClient.html) object. You can do this by calling the
[`Games.getVideosClient()`](https://developers.google.com/android/reference/com/google/android/gms/games/Games.html#getVideosClient(android.app.Activity,%20com.google.android.gms.auth.api.signin.GoogleSignInAccount)) method and passing in the
activity and the [`GoogleSignInAccount`](https://developers.google.com/android/reference/com/google/android/gms/auth/api/signin/GoogleSignInAccount) for the current player. To learn how to
retrieve the player account information, see
[Sign-in in Android Games](https://developer.android.com/games/pgs/v1/android/signin).
| **Note:** The [`VideosClient`](https://developers.google.com/android/games_v1/reference/com/google/android/gms/games/VideosClient.html) class makes use of the Google Play services [`Task`](https://developers.google.com/android/reference/com/google/android/gms/tasks/Task) class to return results asynchronously. To learn more about using tasks to manage threaded work, see the [Tasks API developer guide](https://developers.google.com/android/guides/tasks).

## Video recording API basics

You can use the video recording API to integrate a video recording experience
directly from within your game.

The video recording experience for users includes the following:

- The video recording overlay, which has three buttons:

  1. Start / stop recording
  2. Turn on / off mic
  3. Turn on / off forward facing camera

  | **Note:** Clicking the overlay's forward facing camera display brings up the three aforementioned buttons.
- A developer-provided button to initiate recording, or an alternate recording
  trigger

- A clickable toast that pops up at the end of recording that enables players to
  upload the video to YouTube, or view the video through the Photos app
  (Note: recorded videos are stored under the category `ScreenCasts` in Photos)

## Launch the video recording overlay

To initiate video recording for the currently signed-in player, follow these
steps:

1. Call the [`VideosClient.getCaptureOverlayIntent()`](https://developers.google.com/android/reference/com/google/android/gms/games/VideosClient.html#getCaptureOverlayIntent()) method.
2. If the call is successful, Google Play games services returns a [`Task`](https://developers.google.com/android/reference/com/google/android/gms/tasks/Task) object which asynchronously loads an intent to launch the video recording overlay.
3. Use the intent from the previous step to start an activity.

Here's an example of how to bring up the video recording overlay:  

```transact-sql
private static final int RC_VIDEO_OVERLAY = 9011;

public void showVideoOverlay(View myview) {
  Games.getVideosClient(this, GoogleSignIn.getLastSignedInAccount(this))
      .getCaptureOverlayIntent()
      .addOnSuccessListener(new OnSuccessListener<Intent>() {
        @Override
        public void onSuccess(Intent intent) {
          startActivityForResult(intent, RC_VIDEO_OVERLAY);
        }
      });
}
```

## Tips for using video recording data

The video recording API lets you integrate a video recording experience directly
in your game.

|                                 Tip                                  |                                                                                                 Description                                                                                                 |
|----------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| Make the video recording trigger easily discoverable                 | - Prominently place a recording button off your main menu - Automatically trigger the overlay from a dedicated and clearly labeled recording mode menu option                                               |
| Promote use of the feature in your store listing and inside the game | - Use a screenshot in your store listing that displays the video recording overlay - Promote the video recording feature through in-game promotions - Consider providing in-game rewards for replay sharing |
| Engage your player community with replay competitions                | - Encourage players to record and share game replays with weekly / monthly / yearly replay competitions - Recognize top videos and creators in-game or through social media                                 |