{"record":{"id":"c04d58fdc01e2f96","repo":"google/ExoPlayer","slug":"missing-implementation-to-handle-command-set-playl","errorCode":null,"errorMessage":"Missing implementation to handle COMMAND_SET_PLAYLIST_METADATA","messagePattern":"Missing implementation to handle COMMAND_SET_PLAYLIST_METADATA","errorType":"exception","errorClass":"IllegalStateException","httpStatus":null,"severity":"error","filePath":"library/common/src/main/java/com/google/android/exoplayer2/SimpleBasePlayer.java","lineNumber":3038,"sourceCode":"  @ForOverride\n  protected ListenableFuture<?> handleSetTrackSelectionParameters(\n      TrackSelectionParameters trackSelectionParameters) {\n    throw new IllegalStateException(\n        \"Missing implementation to handle COMMAND_SET_TRACK_SELECTION_PARAMETERS\");\n  }\n\n  /**\n   * Handles calls to {@link Player#setPlaylistMetadata}.\n   *\n   * <p>Will only be called if {@link Player#COMMAND_SET_PLAYLIST_METADATA} is available.\n   *\n   * @param playlistMetadata The requested {@linkplain MediaMetadata playlist metadata}.\n   * @return A {@link ListenableFuture} indicating the completion of all immediate {@link State}\n   *     changes caused by this call.\n   */\n  @ForOverride\n  protected ListenableFuture<?> handleSetPlaylistMetadata(MediaMetadata playlistMetadata) {\n    throw new IllegalStateException(\n        \"Missing implementation to handle COMMAND_SET_PLAYLIST_METADATA\");\n  }\n\n  /**\n   * Handles calls to {@link Player#setVolume}.\n   *\n   * <p>Will only be called if {@link Player#COMMAND_SET_VOLUME} is available.\n   *\n   * @param volume The requested audio volume, with 0 being silence and 1 being unity gain (signal\n   *     unchanged).\n   * @return A {@link ListenableFuture} indicating the completion of all immediate {@link State}\n   *     changes caused by this call.\n   */\n  @ForOverride\n  protected ListenableFuture<?> handleSetVolume(@FloatRange(from = 0, to = 1.0) float volume) {\n    throw new IllegalStateException(\"Missing implementation to handle COMMAND_SET_VOLUME\");\n  }\n","sourceCodeStart":3020,"sourceCodeEnd":3056,"githubUrl":"https://github.com/google/ExoPlayer/blob/dd430f7053a1a3958deea3ead6a0565150c06bfc/library/common/src/main/java/com/google/android/exoplayer2/SimpleBasePlayer.java#L3020-L3056","documentation":"Default handler for Player.setPlaylistMetadata(...) in SimpleBasePlayer: throws IllegalStateException because COMMAND_SET_PLAYLIST_METADATA is advertised but the subclass did not override handleSetPlaylistMetadata(MediaMetadata).","triggerScenarios":"player.setPlaylistMetadata(mediaMetadata) — e.g. a library app updating the playlist title shown by a MediaController — against a SimpleBasePlayer subclass whose State includes the command without an override.","commonSituations":"Custom queue implementations exposed through MediaSession; UI or controller code updating playlist metadata on players that never implemented it.","solutions":["Override handleSetPlaylistMetadata(MediaMetadata playlistMetadata) and store it in the State: state.buildUpon().setPlaylistMetadata(metadata).build().","Or exclude COMMAND_SET_PLAYLIST_METADATA from availableCommands if playlist metadata is owned solely by the app.","Notify connected controllers through the returned state-update future so UI stays consistent."],"exampleFix":"// before\n// no override; controller updates playlist title -> throws\n\n// after\n@Override\nprotected ListenableFuture<?> handleSetPlaylistMetadata(MediaMetadata playlistMetadata) {\n  return updateStateAndNotify(\n      state.buildUpon().setPlaylistMetadata(playlistMetadata).build());\n}","handlingStrategy":"validation","validationCode":"if (!supportsPlaylistMetadataEdit) commands.remove(Player.COMMAND_SET_PLAYLIST_METADATA);","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Implement handleSetPlaylistMetadata() or exclude COMMAND_SET_PLAYLIST_METADATA.","Propagate metadata updates through updateStateAndNotify so controllers stay in sync.","Audit availableCommands versus implemented handlers each time you add a command."],"tags":["simplebaseplayer","custom-player","playlist-metadata","media3","contract"],"backgroundTag":null,"analyzedSha":"dd430f7053a1a3958deea3ead6a0565150c06bfc","analyzedAt":"2026-08-14T12:22:02.982Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}