Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
SDK
/
exoplayer
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
f06c79e4
authored
Jan 11, 2022
by
bachinger
Browse files
Options
_('Browse Files')
Download
Plain Diff
Merge pull request #24 from PaulWoitaschek:patch-1
PiperOrigin-RevId: 419827570
parents
3b1b2506
b28f5ca4
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
6 deletions
demos/session/src/main/java/androidx/media3/demo/session/PlaybackService.kt
demos/session/src/main/java/androidx/media3/demo/session/PlaybackService.kt
View file @
f06c79e4
...
...
@@ -87,12 +87,12 @@ class PlaybackService : MediaLibraryService() {
// Only accept query with pattern "play [Title]" or "[Title]"
// Where [Title]: must be exactly matched
// If no media with exact name found, play a random media instead
lateinit
var
mediaTitle
:
String
if
(
query
.
lowercase
().
startsWith
(
"play "
))
{
mediaTitle
=
query
.
subSequence
(
5
,
query
.
length
).
toString
(
)
}
else
{
mediaTitle
=
query
}
val
mediaTitle
=
if
(
query
.
startsWith
(
"play "
,
ignoreCase
=
true
))
{
query
.
drop
(
5
)
}
else
{
query
}
val
item
=
MediaItemTree
.
getItemFromTitle
(
mediaTitle
)
?:
MediaItemTree
.
getRandomItem
()
player
.
setMediaItem
(
item
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment