Skip to content
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

AlbumArt is not Loading In Notification. #35

Open
djahmednawaz opened this issue Nov 21, 2014 · 4 comments
Open

AlbumArt is not Loading In Notification. #35

djahmednawaz opened this issue Nov 21, 2014 · 4 comments

Comments

@djahmednawaz
Copy link

Following is the object of my song which I am playing.

    song = new Song() {
        @Override
        public String getTitle() {
            return "Song Name Test";
        }

        @Override
        public String getArtist() {
            return "Artist Name Test";
        }

        @Override
        public String getAlbumTitle() {
            return "Album Name Test";
        }

        @Override
        public Uri getAlbumArt() {
            return Uri.parse("http://m.taazi.com/uploads/thumbs/album_cover.jpg");
        }

        @Override
        public Uri getUri() {
            return Uri.parse("http://sound21.mp3slash.net/indian/killdil/%5BSongs.PK%5D%2008%20-%20Kill%20Dil%20-%20Nakhriley.mp3");
        }

        @Override
        public Bundle getExtra() {
            return null;
        }
    };

In notification AlbumArt is not being loaded.
following is the screenshot.
device-2014-11-21-172246

@djahmednawaz
Copy link
Author

I changed code in "setImageViewUri" funtion TouchableNotificationPlugin.java as following.

protected void setImageViewUri(final int id, final Uri contentUri) {
    if (mNotificationView != null && contentUri != null) {
        //mNotificationView.setImageViewUri(id, contentUri);
        Handler uiHandler = new Handler(Looper.getMainLooper());
        uiHandler.post(new Runnable(){
            @Override
            public void run() {
                Picasso.with(getContext()).load(contentUri.toString())
                        .into(mNotificationView, id, NOTIFICATION_NU, getNotification());
            }
        });
    }
}

I am using Picasso for loading images. Add following in playerhater build file.

dependencies {
    compile 'com.squareup.picasso:picasso:2.3.2'
}

@danvass
Copy link

danvass commented Sep 30, 2015

@chrisrhoden Could we add this fix into the lib please?

@cqr
Copy link
Owner

cqr commented Sep 30, 2015

Sure, with a couple changes.

First, I'd rather avoid the dependency on the external library.

Second, I'd want to make sure this doesn't break content:// and android-resource:// URIs.

If you can fix #1 and answer #2, send a pull request and I'll get it merged and released once you sign a contributor agreement.

@cqr cqr reopened this Sep 30, 2015
@Anawaz
Copy link

Anawaz commented Sep 30, 2015

@chrisrhoden good to see you on project back. :)

rockykitamura added a commit to rockykitamura/cordova-plugin-playerhater that referenced this issue Jan 29, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants