<br />

This section covers the integration between the Playable and the [YouTube
Playables SDK](https://developers.google.com/youtube/gaming/playables/reference/sdk).

> [!IMPORTANT]
> **Important:** Translated requirements are provided for reference only. Refer to the [English versions of requirements](https://developers.google.com/youtube/gaming/playables/certification/requirements?hl=en) for definitive guidance.

## 1 Load Playables SDK

- Game **MUST** load the [YouTube Playables SDK](https://developers.google.com/youtube/gaming/playables/reference/sdk) before any of the game code.

## 2 Game ready notification

- Game **MUST** call [`firstFrameReady`](https://developers.google.com/youtube/gaming/playables/reference/sdk#firstframeready) either when the game is rendering a loading screen or splash screen that explicitly communicates to the user that the loading process is underway.
- Game **MUST** call [`gameReady`](https://developers.google.com/youtube/gaming/playables/reference/sdk#gameready) and **MUST** only call [`gameReady`](https://developers.google.com/youtube/gaming/playables/reference/sdk#gameready) when the game is ready for user interaction (example: main menu or game is ready to play).
- Game **MUST NOT** call [`gameReady`](https://developers.google.com/youtube/gaming/playables/reference/sdk#gameready) while there are still non-interactable elements being displayed to the user (example: splash screens or loading screens).

YouTube does not remove the "loading spinner" until this API is called.

## 3 User scores

- Game **MAY** use [`sendScore`](https://developers.google.com/youtube/gaming/playables/reference/sdk#sendscore) to send the user's score.
- If the game uses [`sendScore`](https://developers.google.com/youtube/gaming/playables/reference/sdk#sendscore) to send scores, the game **MUST** adhere to the [`sendScore`](https://developers.google.com/youtube/gaming/playables/reference/sdk#sendscore) specification and **MUST** ensure that the best score sent matches the best score in the game save, if one exists.

## 4 Cloud saves

- Game **MUST** call [`saveData`](https://developers.google.com/youtube/gaming/playables/reference/sdk#savedata) to save progress when users have made material game progress (for example, a level change) where the game mechanics lead the user to believe that their progress is saved. Games that are intentionally designed to start over in each session are exempt from this requirement.
- Game **MUST NOT** use any other mechanism to save user progress. This feature enables players to resume the game at a later point.
- Game **MUST** await [`loadData`](https://developers.google.com/youtube/gaming/playables/reference/sdk#loaddata) before calling [`saveData`](https://developers.google.com/youtube/gaming/playables/reference/sdk#savedata). If [`saveData`](https://developers.google.com/youtube/gaming/playables/reference/sdk#savedata) is called before [`loadData`](https://developers.google.com/youtube/gaming/playables/reference/sdk#loaddata) completes successfully, the request will be rejected. This prevents the game from overwriting any previously saved data.
- Game **MUST** be able to use cloud save data from previous versions of the game without errors or crashes.
- Game **SHOULD** use the cloud save data to maintain user progress across all game versions where the user would expect their data to be used.
- Games **SHOULD** automatically save user progress at important game milestones to prevent data loss. A final flush save is performed when a user exits the game but is best effort and can only save up to [64 KiB in content
  length](https://fetch.spec.whatwg.org/#http-network-or-cache-fetch:%7E:text=If%20the%20sum%20of%20contentLength%20and%20inflightKeepaliveBytes%20is%20greater%20than%2064%20kibibytes%2C%20then%20return%20a%20network%20error.).

## 5 Mute toggle

- Game **MUST** respect system audio setting and mute button.
- Game **MUST** respect the YouTube audio setting and mute button by using [`isAudioEnabled`](https://developers.google.com/youtube/gaming/playables/reference/sdk#isaudioenabled) and [`onAudioEnabledChange`](https://developers.google.com/youtube/gaming/playables/reference/sdk#onaudioenabledchange).
- Game **MUST** respect the volume control on the device.
- Game sound **MUST NOT** play unexpectedly.
- When YouTube mute is set, audio **MUST NOT** be output and game audio controls **MUST NOT** affect audio output.
- When YouTube mute is not set, game audio controls **MAY** affect audio output.
- Game **SHOULD NOT** show an overall mute button within the game itself; allow users to rely on the YouTube-level features for this.
- Game **MAY** have separate granular audio controls in the game, such as for music and sound effects, but they **MUST** follow all other audio control requirements.

![Different audio settings for background, sfx,
dialogs](https://developers.google.com/static/youtube/gaming/playables/certification/images/audio_settings.png)

## 6 Pause and resume

The Playables SDK provides callbacks for cross-platform pause and
resume capabilities.

- Game **MUST** pause all execution after [`onPause`](https://developers.google.com/youtube/gaming/playables/reference/sdk#onpause) is called and **MUST** resume execution only when [`onResume`](https://developers.google.com/youtube/gaming/playables/reference/sdk#onresume) is called. Execution includes all Playable capabilities, such as game loop, music, interactions, network calls, and rendering.
- Game **MUST NOT** use the web [Page Visibility API](https://developer.mozilla.org/en-US/docs/Web/API/Page_Visibility_API) or similar web APIs and **MUST** only use Playables SDK [`onPause`](https://developers.google.com/youtube/gaming/playables/reference/sdk#onpause) and [`onResume`](https://developers.google.com/youtube/gaming/playables/reference/sdk#onresume).
- Game **SHOULD** save user progress when [`onPause`](https://developers.google.com/youtube/gaming/playables/reference/sdk#onpause) occurs.