Let AudioAttributes supercede in API 26 and above
This commit is contained in:
parent
a35e627432
commit
700419c477
1 changed files with 4 additions and 1 deletions
|
@ -178,7 +178,10 @@ public class MediaCommandPlayerImpl extends AbstractPrologCommandPlayer implemen
|
|||
.setContentType(AudioAttributes.CONTENT_TYPE_SPEECH)
|
||||
.build());
|
||||
}
|
||||
if (Build.VERSION.SDK_INT < 26) {
|
||||
// Deprecated in API Level 26, use above AudioAtrributes instead
|
||||
mediaPlayer.setAudioStreamType(streamType);
|
||||
}
|
||||
mediaPlayer.setDataSource(file.getAbsolutePath());
|
||||
mediaPlayer.prepare();
|
||||
mediaPlayer.setOnCompletionListener(this);
|
||||
|
|
Loading…
Reference in a new issue