我正在使用Fresco库播放webp动画,并且我想同时使用android MediaPlayer播放声音,但是声音无法播放,我尝试在新的Thread nut中播放声音,但效果不佳:>
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();
}
我该怎么办?