-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for Android Auto #9592
Open
haggaie
wants to merge
31
commits into
TeamNewPipe:dev
Choose a base branch
from
haggaie:android-auto
base: dev
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+1,242
−274
Open
Changes from 1 commit
Commits
Show all changes
31 commits
Select commit
Hold shift + click to select a range
1471957
Keep MediaSessionCompat and MediaSessionConnector in a separate class
haggaie 31d7bfa
Simple playback status and controls in Android Auto
haggaie 90efadb
Manifest and metadata for Android Auto
haggaie 6822362
player: seek to new index when given a new playqueue with a different…
haggaie 485635a
Media browser interface to show playlists on Android Auto
haggaie c1d24ad
StreamHistoryEntry: convert to StreamInfoItem
haggaie 97a0e30
MediaBrowser: expose search history
haggaie 4f8cca7
Pass media browser error as ErrorInfo
haggaie b3226f7
Improve code formatting, annotate more fields and methods
AudricV a526319
Add icons to root media items
AudricV 511b014
Add uploader name of streams as subtitle of MediaItems
AudricV 148b050
Update media browsers when the list of local playlist changes
haggaie 2a01f37
android auto: fix navigation tab colors and cut text
haggaie 6871c96
PlaylistMetadataEntry: add interface method to get the thumbnail Url
haggaie b795f4d
RemotePlaylistManager: add helper method to get a playlist by its uid
haggaie e9536c1
media browser: expose remote playlists together with local playlists
haggaie 6cc811f
media browser: support searching
haggaie 8fc659c
media browser: clean up Uri.parse() null checks
haggaie 715e829
LocalItem/PlaylistLocalItem: convert to Kotlin
snaik20 83c7114
PlayerService: convert to Kotlin (mechanical)
Profpatsch aa750d0
MediaBrowserConnector: convert to Kotlin (mechanical)
Profpatsch 0594b65
MediaBrowserConnector: convert to Kotlin (minimal compilation fixes)
Profpatsch 8584f03
MediaBrowserConnector: simplify index, remove unstable warning
haggaie ae2003a
media browser: rename remote -> isRemote
haggaie 718ff0f
media browser: pass media ID to parsing error exceptions
haggaie f974bf1
Addressed review comments
snaik20 c0d229a
Addressed review comments
snaik20 92e7feb
PlayerService: return appropriate IBinder depending on the action
haggaie 85b00f5
MediaBrowserConnector: separate context from playerService
Profpatsch 10458b9
MediaBrowserConnector: move init to top & simplify
Profpatsch df29bea
MediaBrowserConnector: simplify database methods
Profpatsch File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
This file contains 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
32 changes: 32 additions & 0 deletions
32
app/src/main/java/org/schabi/newpipe/player/mediabrowser/MediaBrowserConnector.java
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
package org.schabi.newpipe.player.mediabrowser; | ||
|
||
import android.support.v4.media.session.MediaSessionCompat; | ||
|
||
import androidx.annotation.NonNull; | ||
|
||
import com.google.android.exoplayer2.ext.mediasession.MediaSessionConnector; | ||
|
||
import org.schabi.newpipe.player.PlayerService; | ||
|
||
public class MediaBrowserConnector { | ||
private static final String TAG = MediaBrowserConnector.class.getSimpleName(); | ||
|
||
private final PlayerService playerService; | ||
private final @NonNull MediaSessionConnector sessionConnector; | ||
private final @NonNull MediaSessionCompat mediaSession; | ||
|
||
public MediaBrowserConnector(@NonNull final PlayerService playerService) { | ||
this.playerService = playerService; | ||
mediaSession = new MediaSessionCompat(playerService, TAG); | ||
sessionConnector = new MediaSessionConnector(mediaSession); | ||
sessionConnector.setMetadataDeduplicationEnabled(true); | ||
} | ||
|
||
public @NonNull MediaSessionConnector getSessionConnector() { | ||
return sessionConnector; | ||
} | ||
|
||
public void release() { | ||
mediaSession.release(); | ||
} | ||
} |
This file contains 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
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it is ill-advised to move the player initialization from
onCreate
toonStartCommand
, as this is a major change to the lifecycle.