Repository navigation
Add snippets for the basic media player app guide - #1116
Closed
edward-williams-stellarelements wants to merge 4 commits into
Closed
edward-williams-stellarelements wants to merge 4 commits into
edward-williams-stellarelements wants to merge 4 commits into
Conversation
The copy inside the exclude was missing the comment the page prints on the tagged copy. Both copies are the same function, so neither should read as the authoritative one.
Addresses Kat's review on #7. - The file moves from misc to the media module Erik added, which also removes the duplicate android_media_playback_app_create_exoplayer tag that existed in both places. - SessionCallbackService is gone. The on_get_session tags now sit around onGetSession inside PlaybackService, which means the exclude that hid it had to go: a region tag opened inside an exclude renders empty. - media3-session and media3-ui move from misc to media with the code.
edward-williams-stellarelements
marked this pull request as ready for review
September 17, 2026 22:53
|
Here is the summary of changes. You are about to add 4 region tags.
This comment is generated by snippet-bot.
|
Author
|
Closing as a duplicate: this work is already covered by #1115, which adds the same playback-app region tags to |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Snippets for the "Create a basic media player app using Media3 ExoPlayer" guide,
https://developer.android.com/media/implement/playback-app, with region tags, in the media module.
Kat reviewed these on our fork, StellarElements#7. The first commit is hers,
preserved from the extraction branch.
Things that are not a straight copy of the page:
The playback_service block publishes five lines the page's block does not show, the onGetSession
override and its comment. Tagging onGetSession where it sits puts it inside the playback_service
region as well, because a region tag opened inside a [START_EXCLUDE] renders as an empty snippet. The
block under "Implementing a MediaSessionService" needs those five lines added to match.
ktlint reindented the connect_ui block, eleven lines, indentation only. The page's block runs 2, 4, 6,
8 and 10 spaces, including a stray "},", and ktlint normalises it to 4-space.
media/build.gradle.kts gains media3-session and media3-ui. Needed to compile, and it matches what the
page tells readers to add under "Getting started" and "Managing playback with a media session".
Not migrated: the Gradle dependency blocks and the Java variants. The two AndroidManifest.xml blocks
are left out as well. The page writes android:name=".PlaybackService" while the class lives in
com.example.media, so a faithful copy would need the qualified name and would stop matching the page.
Separately, since API 34 a mediaPlayback foreground service also needs
FOREGROUND_SERVICE_MEDIA_PLAYBACK, which the block does not request. Both are page corrections and
have been passed on.