GithubHelp home page GithubHelp logo

uamp's Introduction

Universal Android Music Player Sample

The goal of this sample is to show how to implement an audio media app that works across multiple form factors and provides a consistent user experience on Android phones, tablets, Android Auto, Android Wear, Android TV, Google Cast devices, and with the Google Assistant.

To get started with UAMP please read the full guide.

Screenshot showing UAMP's UI for browsing albums and songs Screenshot showing UAMP's UI for playing a song

Pre-requisites

  • Android Studio 3.x

Getting Started

This sample uses the Gradle build system. To build this project, use the "gradlew build" command or use "Import Project" in Android Studio.

Support

If you've found an error in this sample, please file an issue

Patches are encouraged and may be submitted by forking this project and submitting a pull request through GitHub. Please see CONTRIBUTING.md for more details.

Audio

Music provided by the Free Music Archive.

Recordings provided by the Ambisonic Sound Library.

License

Copyright 2017 Google Inc.

Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you 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.

uamp's People

Contributors

aquilescanta avatar cartland avatar cfva14 avatar cgbatgoogle avatar codingjeremy avatar dturner avatar frankkienl avatar georgcantor avatar keithsmyth avatar khiemdoan avatar mangini avatar marcbaechinger avatar marceltex avatar marchuck avatar markzhai avatar matteodamico avatar mhelder avatar mjhassanpur avatar nageshs avatar nic0lette avatar owahltinez avatar rampara avatar shawngit avatar sigmanzero avatar smishra2 avatar tjohns avatar travis-j-smith avatar trustedtomato avatar wkmcyz avatar yuripopiv avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

uamp's Issues

com.intellij.openapi.project.IndexNotReadyException

Please change caller according to com.intellij.openapi.project.IndexNotReadyException documentation Indexing started at: java.lang.Throwable at com.intellij.openapi.project.DumbServiceImpl.scheduleCacheUpdate(DumbServiceImpl.java:160) at com.intellij.openapi.project.DumbServiceImpl.queueTask(DumbServiceImpl.java:85) at com.intellij.openapi.roots.impl.ProjectRootManagerComponent.doSynchronizeRoots(ProjectRootManagerComponent.java:300) at com.intellij.openapi.roots.impl.ProjectRootManagerImpl.fireRootsChanged(ProjectRootManagerImpl.java:421) at com.intellij.openapi.roots.impl.ProjectRootManagerImpl.access$100(ProjectRootManagerImpl.java:57) at com.intellij.openapi.roots.impl.ProjectRootManagerImpl$BatchSession.fireChange(ProjectRootManagerImpl.java:114) at com.intellij.openapi.roots.impl.ProjectRootManagerImpl$BatchSession.rootsChanged(ProjectRootManagerImpl.java:127) at com.intellij.openapi.roots.impl.ProjectRootManagerImpl.makeRootsChange(ProjectRootManagerImpl.java:359) at com.intellij.openapi.module.impl.ModuleManagerImpl.commitModel(ModuleManagerImpl.java:951) at com.intellij.openapi.module.impl.ModuleManagerImpl.access$1800(ModuleManagerImpl.java:73) at com.intellij.openapi.module.impl.ModuleManagerImpl$ModuleModelImpl.commitWithRunnable(ModuleManagerImpl.java:857) at com.intellij.openapi.module.impl.ModuleManagerImpl$ModuleModelImpl.access$1600(ModuleManagerImpl.java:619) at com.intellij.openapi.module.impl.ModuleManagerImpl.commitModelWithRunnable(ModuleManagerImpl.java:610) at com.intellij.openapi.roots.impl.ModifiableModelCommitter.multiCommit(ModifiableModelCommitter.java:48) at com.intellij.openapi.roots.impl.ModifiableModelCommitter.multiCommit(ModifiableModelCommitter.java:37) at com.intellij.openapi.roots.impl.ModuleRootManagerImpl.commitModel(ModuleRootManagerImpl.java:178) at com.intellij.openapi.roots.impl.RootModelImpl.commit(RootModelImpl.java:338) at com.intellij.openapi.roots.ModuleRootModificationUtil$8.run(ModuleRootModificationUtil.java:167) at com.intellij.openapi.application.impl.ApplicationImpl.runWriteAction(ApplicationImpl.java:1002) at com.intellij.openapi.roots.ModuleRootModificationUtil$10.run(ModuleRootModificationUtil.java:208) at com.intellij.openapi.application.impl.ApplicationImpl.invokeAndWait(ApplicationImpl.java:716) at com.intellij.openapi.roots.ModuleRootModificationUtil.doWriteAction(ModuleRootModificationUtil.java:205) at com.intellij.openapi.roots.ModuleRootModificationUtil.updateModel(ModuleRootModificationUtil.java:164) at com.intellij.openapi.roots.ModuleRootModificationUtil.setModuleSdk(ModuleRootModificationUtil.java:123) at org.jetbrains.android.sdk.AndroidSdkUtils.tryToSetAndroidPlatform(AndroidSdkUtils.java:469) at org.jetbrains.android.sdk.AndroidSdkUtils.setupPlatform(AndroidSdkUtils.java:485) at org.jetbrains.android.sdk.AndroidSdkUtils.setupAndroidPlatformIfNecessary(AndroidSdkUtils.java:675) at org.jetbrains.android.facet.AndroidFrameworkDetector.doImportSdkAndFacetConfiguration(AndroidFrameworkDetector.java:107) at org.jetbrains.android.facet.AndroidFrameworkDetector$1$1.run(AndroidFrameworkDetector.java:97) at com.intellij.openapi.project.DumbServiceImpl.runWhenSmart(DumbServiceImpl.java:150) at org.jetbrains.android.facet.AndroidFrameworkDetector$1.run(AndroidFrameworkDetector.java:94) at com.intellij.ide.startup.impl.StartupManagerImpl.runActivity(StartupManagerImpl.java:342) at com.intellij.ide.startup.impl.StartupManagerImpl.access$700(StartupManagerImpl.java:58) at com.intellij.ide.startup.impl.StartupManagerImpl$3.run(StartupManagerImpl.java:165) at com.intellij.openapi.project.DumbServiceImpl.runWhenSmart(DumbServiceImpl.java:150) at com.intellij.ide.startup.impl.StartupManagerImpl.queueSmartModeActivity(StartupManagerImpl.java:162) at com.intellij.ide.startup.impl.StartupManagerImpl.access$1000(StartupManagerImpl.java:58) at com.intellij.ide.startup.impl.StartupManagerImpl$4.run(StartupManagerImpl.java:196) at com.intellij.openapi.project.DumbServiceImpl.updateFinished(DumbServiceImpl.java:318) at com.intellij.openapi.project.DumbServiceImpl.access$1100(DumbServiceImpl.java:52) at com.intellij.openapi.project.DumbServiceImpl$10.run(DumbServiceImpl.java:503) at com.intellij.openapi.application.impl.LaterInvocator$1.run(LaterInvocator.java:158) at com.intellij.openapi.application.impl.LaterInvocator$FlushQueue.runNextEvent(LaterInvocator.java:337) at com.intellij.openapi.application.impl.LaterInvocator$FlushQueue.run(LaterInvocator.java:321) at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:311) at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:744) at java.awt.EventQueue.access$400(EventQueue.java:97) at java.awt.EventQueue$3.run(EventQueue.java:697) at java.awt.EventQueue$3.run(EventQueue.java:691) at java.security.AccessController.doPrivileged(Native Method) at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:75) at java.awt.EventQueue.dispatchEvent(EventQueue.java:714) at com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.java:861) at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:649) at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:380) at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:201) at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116) at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105) at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101) at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93) at java.awt.EventDispatchThread.run(EventDispatchThread.java:82) -----------------------------

ic_by_genre is not displayed

I think there is an issue with displaying the ic_by_genre icon
In the MusicService.java I applied to following changes to display the icon:

 .setIconUri(Uri.parse("android.resource://" +
                                    getPackageName() + "/" + R.drawable.ic_by_genre))

instead of the original:

.setIconUri(Uri.parse("android.resource://" +
                                "com.example.android.uamp/drawable/ic_by_genre"))

but still does not show the ic_by_genre icon
is this a bug ?

Searchview not working

I added a searchview item to main.xml (menu). And inflated it from MusicPlayerActivity from onCreateOptions. The icon is there but the text view won't show up.

Thanks!

Retrieve media item source

I want to allow users download songs. I put a "Download" in the list view that displays the songs. So, when clicking on "Download" I have to retrieve the song URL.

I tried:

MediaMetadata track = mMusicProvider.getMusic(MediaIDHelper.extractMusicIDFromMediaID(item.getDescription().getMediaId()));
String source = track.getString(MusicProvider.CUSTOM_METADATA_TRACK_SOURCE);

but got a NullPointerException on the second line.

Inconsistent state of genre Map

In the MusicService, after the bitmap is fetched, the MediaMetadata track is assigned to another newly created MediaMetadata instance, and then the MusicProvider method, updateMusic, is called with this new instance.

In this method, the metadata of the MutableMediaMetadata track, in the mMusicListById map, is updated to the new instance. So, if the genre hasn't been changed, and therefore, the genre map not updated, it's still pointing to the old instance of the MediaMetadata track.

MusicService.java

...

AlbumArtCache.getInstance().fetch(albumUri, new AlbumArtCache.FetchListener() {
    @Override
    public void onFetched(String artUrl, Bitmap bitmap, Bitmap icon) {
        MediaSession.QueueItem queueItem = mPlayingQueue.get(mCurrentIndexOnQueue);
        MediaMetadata track = mMusicProvider.getMusic(trackId);
        track = new MediaMetadata.Builder(track)

            // set high resolution bitmap in METADATA_KEY_ALBUM_ART. This is used, for
            // example, on the lockscreen background when the media session is active.
            .putBitmap(MediaMetadata.METADATA_KEY_ALBUM_ART, bitmap)

            // set small version of the album art in the DISPLAY_ICON. This is used on
            // the MediaDescription and thus it should be small to be serialized if
            // necessary..
            .putBitmap(MediaMetadata.METADATA_KEY_DISPLAY_ICON, icon)

            .build();

        mMusicProvider.updateMusic(trackId, track);

        // If we are still playing the same music
        String currentPlayingId = MediaIDHelper.extractMusicIDFromMediaID(
            queueItem.getDescription().getMediaId());
        if (trackId.equals(currentPlayingId)) {
            mSession.setMetadata(track);
        }
    }
});
...

MusicProvider.java

...
public synchronized void updateMusic(String musicId, MediaMetadata metadata) {
    MutableMediaMetadata track = mMusicListById.get(musicId);
    if (track == null) {
        return;
    }

    String oldGenre = track.metadata.getString(MediaMetadata.METADATA_KEY_GENRE);
    String newGenre = metadata.getString(MediaMetadata.METADATA_KEY_GENRE);

    track.metadata = metadata;

    // if genre has changed, we need to rebuild the list by genre
    if (!oldGenre.equals(newGenre)) {
        buildListsByGenre();
    }
}
...

UniversalMusicPlayer

When i Run this app in android studio the following error comes:

Error:A problem occurred configuring project ':mobile'.

Could not resolve all dependencies for configuration ':mobile:_debugCompile'.
Could not resolve com.github.amlcurran.showcaseview:library:5.0.0.
Required by:
android-UniversalMusicPlayer-master:mobile:unspecified
> Could not resolve com.github.amlcurran.showcaseview:library:5.0.0.
> Could not get resource 'https://jcenter.bintray.com/com/github/amlcurran/showcaseview/library/5.0.0/library-5.0.0.pom'.
> Could not GET 'https://jcenter.bintray.com/com/github/amlcurran/showcaseview/library/5.0.0/library-5.0.0.pom'.
> jcenter.bintray.com

Please Provide a solution as soon as possible.............

Not getting Thumb with Genres

I am using UMP example provided by you, I have not made any change in my code, even I have not tried anything out of the box, I just imported your project into my work-space and checked it on my device, and found that I am not getting Thumb with Genres (Songs by genre) and List of Genres...

Whereas I supposed to get Thumb from our JSON, here is what I have tried (but no success) -
holder.mImageView.setImageBitmap(description.getIconBitmap());

Add Button in the MainActivity

How do I add a button to do something in the first screen that opens, or for that matter, anywhere in the MediaBrowserFragment?

Thanks!

Is nulling of references realy necessary?

I just had a discussion with a collegue about manually nulling callbacks to prevent memory leaks.

He referred to this project where excacly that is done here.

@Override
public void onDetach() {
    super.onDetach();
    mMediaFragmentListener = null;
}

Is this necessary?

Touches go through Navigation Drawer

Steps to reproduce:

  1. Open the app;
  2. Open the Navigation Drawer;
  3. Tap on the blue image at top;

You'll notice that you've actually selected an item of the ListView below the drawer.

screenshot_2015-03-12-19-00-25

Direct to Genre List

How can i start the project directly form the genre list neither from the genre top view. I want the app to start from list inside genre.

Icon Fonts

First, thanks for the code sample. Always love these.

My "Issue" is that I'd like to see more of a movement from google in leveraging SVG or Icon Fonts. It strikes me as really wasteful to have 15 images for a play button when a single, crazy small, SVG would do.

Networking on Main Thread

Hi,

while looking through this very nice example, I found that it's performing networking on the Main Thread in MusicProvider#fetchJSONFromUrl.
Are you sure that's recommended best practice? Especially in a sample app provided by Google?

Just my $0.02
;)

Issues with stopped Service and destroyed MediaSession

Hi while playing around with the code I ran into the problem of having multiple services "playing" music at the same time:
I'm extending Service instead of MediaBrowserService to be compatible with lower APIs. This causes the service not to be bound which causes it to be destroyed whenever there is no activity like active playback.

When the UI receives a button press after the service was destroyed and calls controller.getTransportControls().play(); one of the callbacks of the inner MediaSessionCallback of the "dead" service will be called:

private final class MediaSessionCallback extends MediaSession.Callback {
        @Override
        public void onPlayFromMediaId(String mediaId, Bundle extras) {
           //[...]
            if (mPlayingQueue != null && !mPlayingQueue.isEmpty()) {
                handlePlayRequest();
            }
        }
}

The handlePlayRequest() method will check if the service is started or re-start it if necessary and this is where the problems begin:

 private void handlePlayRequest() {
        if (!mServiceStarted) {
            //this will trigger onCreate() asnychronously
            startService(new Intent(getApplicationContext(), MusicService.class));
            mServiceStarted = true;
        }

        if (!mSession.isActive()) {
            mSession.setActive(true);
        }

        if (QueueHelper.isIndexPlayable(mCurrentIndexOnQueue, mPlayingQueue)) {
            updateMetadata();
            mPlayback.play(mPlayingQueue.get(mCurrentIndexOnQueue));
        }
    }

If mServiceStarted=false, a new service will be created, onCreate() is called and everything gets re-instantiated. However startService() will immediately return and play a track on the old instance of mPlayback just before onCreate() gets called. We have now a leaked playback instance without AudioFocus and a new fresh instance which has the AudioFocus. When a song is selected for playback it will call the new playback instance in the new service. However, if the playback is paused, the old (Frankenstein) playback will get AudioFocus and resume playback of the old song.
Of course, this all can be avoided by keeping the service alive as long as possible, but I'm not satisfied with this solution. Another problem I see is that for example in the MediaNotificationManager the updateSessionToken() should handle the case where a session gets destroyed. But MediaSession.Token freshToken = mService.getSessionToken(); will never return a fresh token since there is a lot of time between Session.onDestroy() and Session.onCreate()-> new Session() ....

I would really appreciate advice on how to handle a stopped/destroyed MusicService/MediaSessions without these funky effects.

Update project description to include Android TV

You updated the README but not the project description.

This sample shows how to implement an audio media app that works across multiple form factors and provide a consistent user experience on Android phones, tablets, Android Auto, Android Wear**, Android TV** and Google Cast devices.

Thanks for share this great sample.

MediaDetailsFragment missing

The layout file media_details_activity.xml refers to a fragment com.example.android.uamp.ui.tv.MediaDetailsFragment that isn't present in the source code.

SD Card

Hi
Your app is amazing, nice work
But I am trying read the songs from sd card.
Can you help me?
thank's

Issues

  1. I can currently set the icon for media items by checking if they are playable or not.
    How can I set a thumbnail on the browsable items like Genre lists, by taking an album art at random from its child.

  2. How can I differentiate between browsable and media items? So I can set a grid layout for browsable items and a list for media items

  3. The play by voice search worked for the first time only. Subsequent times it searches the web.

  4. How to add a button for random playlist generation using the random function on QueueHelper

VoiceSearch not working

So far, the voice search is only working with one Artist (Play <artists_name>). Any other Play query doesn't work. How to fix that?

Audio does not buffer enough before starting playback

Using a Nexus 5X (Android 6.0.1) the audio quite often stutters at the beginning of a song. Logcat produces a sequence of 701 (MEDIA_INFO_BUFFERING_START) and 702 (MEDIA_INFO_BUFFERING_END) state messages from the MediaPlayer class, indicating that the internal buffer is being emptied and filled again. The problem does not occur using an HTC One running Android 5.02.

Could this be an issue deeper in the MediaPlayer class? It seems similar to this https://code.google.com/p/android/issues/detail?id=196122

Issue regarding load music

java.lang.RuntimeException: Unable to create service com.example.android.uamp.MusicService: java.lang.NullPointerException: Attempt to invoke virtual method 'void com.google.android.libraries.cast.companionlibrary.cast.VideoCastManager.addVideoCastConsumer(com.google.android.libraries.cast.companionlibrary.cast.callbacks.VideoCastConsumer)' on a null object reference

Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'void com.google.android.libraries.cast.companionlibrary.cast.VideoCastManager.addVideoCastConsumer(com.google.android.libraries.cast.companionlibrary.cast.callbacks.VideoCastConsumer)' on a null object reference

Importing in Eclipse

When i try to import the project in eclipse i got no error but all on a sudden when it starts to run it crashes.
log cat says:
03-28 21:19:01.048: E/AndroidRuntime(12663): FATAL EXCEPTION: main
03-28 21:19:01.048: E/AndroidRuntime(12663): java.lang.NoClassDefFoundError: com.example.android.uamp.ui.BaseActivity$1
03-28 21:19:01.048: E/AndroidRuntime(12663): at com.example.android.uamp.ui.BaseActivity.(BaseActivity.java:163)
03-28 21:19:01.048: E/AndroidRuntime(12663): at com.example.android.uamp.ui.MusicPlayerActivity.(MusicPlayerActivity.java:34)
03-28 21:19:01.048: E/AndroidRuntime(12663): at java.lang.Class.newInstanceImpl(Native Method)
03-28 21:19:01.048: E/AndroidRuntime(12663): at java.lang.Class.newInstance(Class.java:1319)
03-28 21:19:01.048: E/AndroidRuntime(12663): at android.app.Instrumentation.newActivity(Instrumentation.java:1053)
03-28 21:19:01.048: E/AndroidRuntime(12663): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1986)
03-28 21:19:01.048: E/AndroidRuntime(12663): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2096)
03-28 21:19:01.048: E/AndroidRuntime(12663): at android.app.ActivityThread.access$600(ActivityThread.java:138)
03-28 21:19:01.048: E/AndroidRuntime(12663): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1207)
03-28 21:19:01.048: E/AndroidRuntime(12663): at android.os.Handler.dispatchMessage(Handler.java:99)
03-28 21:19:01.048: E/AndroidRuntime(12663): at android.os.Looper.loop(Looper.java:213)
03-28 21:19:01.048: E/AndroidRuntime(12663): at android.app.ActivityThread.main(ActivityThread.java:4787)
03-28 21:19:01.048: E/AndroidRuntime(12663): at java.lang.reflect.Method.invokeNative(Native Method)
03-28 21:19:01.048: E/AndroidRuntime(12663): at java.lang.reflect.Method.invoke(Method.java:511)
03-28 21:19:01.048: E/AndroidRuntime(12663): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:789)
03-28 21:19:01.048: E/AndroidRuntime(12663): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:556)
03-28 21:19:01.048: E/AndroidRuntime(12663): at dalvik.system.NativeStart.main(Native Method)

Can't build with sdk 23, missing pom dependencies on jcenter.bintray.com

Here's the full message, after I've updated the gradle.build in the mobile/ folder:

:~/git/android-UniversalMusicPlayer$ ./gradlew build.gradle 

FAILURE: Build failed with an exception.

* What went wrong:
A problem occurred configuring project ':mobile'.
> Could not resolve all dependencies for configuration ':mobile:_debugCompile'.
   > Could not resolve com.google.android.gms:play-services-cast:7.5.0.
     Required by:
         android-UniversalMusicPlayer:mobile:unspecified
      > Could not GET 'https://jcenter.bintray.com/com/google/android/gms/play-services-cast/7.5.0/play-services-cast-7.5.0.pom'.
         > jcenter.bintray.com: unknown error
   > Could not resolve com.google.android.support:wearable:1.2.0.
     Required by:
         android-UniversalMusicPlayer:mobile:unspecified
      > Could not GET 'https://jcenter.bintray.com/com/google/android/support/wearable/1.2.0/wearable-1.2.0.pom'.
         > jcenter.bintray.com
   > Could not resolve com.android.support:support-v4:22.2.0.
     Required by:
         android-UniversalMusicPlayer:mobile:unspecified
      > Could not GET 'https://jcenter.bintray.com/com/android/support/support-v4/22.2.0/support-v4-22.2.0.pom'.
         > jcenter.bintray.com
   > Could not resolve com.android.support:appcompat-v7:22.2.0.
     Required by:
         android-UniversalMusicPlayer:mobile:unspecified
      > Could not GET 'https://jcenter.bintray.com/com/android/support/appcompat-v7/22.2.0/appcompat-v7-22.2.0.pom'.
         > jcenter.bintray.com
   > Could not resolve com.android.support:cardview-v7:22.2.0.
     Required by:
         android-UniversalMusicPlayer:mobile:unspecified
      > Could not GET 'https://jcenter.bintray.com/com/android/support/cardview-v7/22.2.0/cardview-v7-22.2.0.pom'.
         > jcenter.bintray.com
   > Could not resolve com.android.support:mediarouter-v7:22.2.0.
     Required by:
         android-UniversalMusicPlayer:mobile:unspecified
      > Could not GET 'https://jcenter.bintray.com/com/android/support/mediarouter-v7/22.2.0/mediarouter-v7-22.2.0.pom'.
         > jcenter.bintray.com
   > Could not resolve com.android.support:leanback-v17:22.2.0.
     Required by:
         android-UniversalMusicPlayer:mobile:unspecified
      > Could not GET 'https://jcenter.bintray.com/com/android/support/leanback-v17/22.2.0/leanback-v17-22.2.0.pom'.
         > jcenter.bintray.com

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

BUILD FAILED

Request: MediaPlayer Proxy or Cache

While I believe this may not fit entirely with the purpose of UniversalMusicPlayer - I do believe it fits within the aspects of a streaming Media Player.
The few samples available online on how to approach a proxy implementations date back to the NPR app but it hasn't aged well.

So, as titled, I am requesting for UniversalMediaPlayer to be enhanced with a proxy service for the media player to use as a cache.

make it podcast like app?

I want to create an audio book which the app plays songs from my server
so every week I can upload a new podcast on server and it can be played in the app

I am not sure how to make the app so it can get the songs from my serer
really appreciate any help
thanks

How use it

Hello,

how i can load it on my android studio and make a apk?

Queue Items

How to display a list of current queue items?

Issues

  1. I can currently set the icon for media items by checking if they are playable or not.
    How can I set a thumbnail on the browsable items like Genre lists, by taking an album art at random from its child

  2. The play by voice search worked for the first time only. Subsequent times it searches the web.

  3. How to add a button for random playlist generation using the random function on QueueHelper

Request

Hi,
Mi name is Nicolas. Im doing my project degree for System engineer.
I want to integrate the music player in my project but only the music player itself and not the nav drawer with the search. I want to open a mp3 and use the music player only.
It is posible to have a hand on this? because the whole musicplayer project has a lot of clases and i dont know where to start, i dont know the things i need to take out etc.
If any of you could help me it could be great.

Cheers!!!

Missing tests

There are no tests in src/test nor src/androidTest

Add album cover in the MediaItemViewHolder

  • I know most questions not related to the bug dont get any answer here, but the problem with asking questions about ump in Stackoverflow is that not many people take time to go over the project to answer a question - you guys know everything and really appreciate if help me with this.

I want to access album cover in the MediaItemViewHolder.java instead of the play icons. I followed this pattern from PlaybackControlsFragment.java and added this:

String artUrl = description.getIconUri().toString();
Bitmap art = description.getIconBitmap();
AlbumArtCache cache = AlbumArtCache.getInstance();
 if (art == null) {
   art = cache.getIconImage(artUrl);
}
if (art != null) {
   holder.mImageView.setImageBitmap(art);
}

and added this to the cases

holder.mImageView.setImageBitmap(art);

it correctly shows the album art, however, the image is blank until I click the item. Then the album cover is loaded and displayed. I think it has something to do with AlbumArtCache.

Is it possible to display the album covers without waiting for the user to click on an item?

note: I have asked this question in stackoverflow too

"Playback stream current position (Stop casting)" question

Hi,
can someone explain in which part or parts of the code the current position of the playback is updated? Because when change the playback (from remote to local), playback (CastPlayback) is not connected and returns the last known position, that is, the position that was received in the change from local playback to remote (assuming no pause action has been taken during remote playback)

I've revised the source code a lot but I don't understand why when the user stops casting, mPlayback.getCurrentStreamPosition() in switchToPlayback method, CastManager is connected. If method has been executed onDisconnected(), should not returns that CastManager is disconnected?

Thanks in advance.

Can i play .m3u?

Hi. I'd like this player and i have some questions:

  1. How can i play stream music from .m3u file ? Is it possible?
  2. If it possible to play .mp3 file from url ?

Downwards compatibility to Android 4.4 at least

It would be great to see this project being compatible with at least KitKat or even Ice Cream Sandwich. I took a lot of inspiration from the Google I/O app's source code and I am happy to see a new demo app like this. But fact is: today, we still need compatibility at least for an Android 4.x version, too!
Thanks!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.