Adding Video Recording to Your Android Game

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.

Note: Android support for the Video recording API is provided through the Google Play services SDK. To learn more about using Google Play services in your apps, see the Overview.

This guide shows you how to use the Video Recording API in an Android application.

Before you begin

Before you start to use the Video Recording API:

Once the player is signed in and the GoogleApiClient is connected, your game can start using the Video Recording API.

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
  • 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)

Using the Video Recording

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

  1. Create a GoogleApiClient object and configure it to use the Games API and SCOPE.

  2. Call the Games.Videos.getCaptureOverlayIntent(...) method. If the call is made successfully, it returns an Intent.

  3. Pass the returned Intent as a parameter to startActivityForResult(...) to bring up the overlay.

The following code snippet shows how you might bring up the video capture overlay:

public void showVideoOverlay(View myview) {
    Intent intent = Games.Videos.getCaptureOverlayIntent(this.getApiClient());
    startActivityForResult(intent, 777);
}

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

Enviar comentarios sobre…

Play Games Services for Android
Play Games Services for Android