Name: android-media-controller
Owner: Google Samples
Description: null
Created: 2017-06-22 19:17:37.0
Updated: 2018-05-23 15:16:47.0
Pushed: 2018-03-29 20:52:18.0
Homepage: null
Size: 8008
Language: Java
GitHub Committers
User | Most Recent Commit | # Commits |
---|
Other Committers
User | Most Recent Commit | # Commits |
---|
Create a simple MediaController that connects to a MediaBrowserService in order to test inter-app media controls.
This app works with the Universal Android Music Player sample, or any other app that implements the media APIs. https://github.com/googlesamples/android-UniversalMusicPlayer
`PREPARE
and ``
PLAY``` buttons updates based on changes to
the media player state via onPlaybackStateChanged and onMetadataChanged and
includes the current player state reported via PlaybackStateCompat.getState().`back
` to return to the list of media apps.It's also possible to launch the app via ADB and the Activity manager (am).
Usage: `adb shell am start mediacontroller://<package name>?[search|id|uri=<value>]
`
For example, to set up to play “Awakening” by Silent Partner in UAMP, the following command could be used:
rnatively, it's possible to use extras to pass parameters, which is recommended when passing
meters that include URI-like components:
a names:
ckage name : ```com.example.android.mediacontroller.PACKAGE_NAME```
arch term : ```com.example.android.mediacontroller.SEARCH```
dia ID : ```com.example.android.mediacontroller.MEDIA_ID```
I : ```com.example.android.mediacontroller.URI```
her example with UAMP is to perform a search with the term "jazz?" one would use:
This app allows for testing how media apps respond to audio focus changes.
The app allows requesting and abandoning the following types of audio focus:
For more information on audio focus please see Managing Audio Focus.
This tool displays the supported actions as reported by the MediaSession in the call to MediaSessionCompat.setPlaybackState() as a list of prepare and play actions on the main screen. For actions that are not declared as supported, it also colors the buttons red on the controller screen.
See the screenshots below for examples.
Copyright 2017 Google Inc. All rights reserved.
Licensed under the Apache License, Version 2.0 (the “License”); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an “AS IS” BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.