Try to search your question here, if you can't find : Ask Any Question Now ?

use fresco and MediaPlayer at the same time

HomeCategory: stackoverflowuse fresco and MediaPlayer at the same time
Avatarsourav asked 4 months ago

i am using Fresco library to play an webp animation and i want to play a sound at the same time using android MediaPlayer but,the sound does not play, i tried playing sound in new Thread nut it did not work:

Uri uri = new Uri.Builder()
                        .scheme(UriUtil.LOCAL_RESOURCE_SCHEME)
                        .path(String.valueOf(R.drawable.onestaranimation))
                        .build();


                DraweeController controller =
                Fresco.newDraweeControllerBuilder()
                        .setUri(uri)
                        .setAutoPlayAnimations(true)
                        .build();
                missionEndAnimationOneStar.setVisibility(View.VISIBLE);
                missionEndAnimationOneStar.setController(controller);
                playSound(R.raw.onestarsound);


    private void playSound(int sound){

            MediaPlayer mp = MediaPlayer.create(getApplicationContext(), sound);
            mp.start();
        }

what can i do?

1 Answers
Best Answer
AvatarMannu answered 4 months ago
Your Answer

20 + 7 =

Popular Tags

WP Facebook Auto Publish Powered By : XYZScripts.com