remove check of media type
This commit is contained in:
parent
3e610c85b9
commit
3fa210c414
|
@ -668,19 +668,17 @@ public class LocalPSMP extends PlaybackServiceMediaPlayer {
|
||||||
*/
|
*/
|
||||||
private void setVolumeSync(float volumeLeft, float volumeRight) {
|
private void setVolumeSync(float volumeLeft, float volumeRight) {
|
||||||
playerLock.lock();
|
playerLock.lock();
|
||||||
if (media != null && EnumSet.of(MediaType.AUDIO, MediaType.VIDEO).contains(media.getMediaType())) {
|
Playable playable = getPlayable();
|
||||||
Playable playable = getPlayable();
|
if (playable instanceof FeedMedia) {
|
||||||
if (playable instanceof FeedMedia) {
|
FeedMedia feedMedia = (FeedMedia) playable;
|
||||||
FeedMedia feedMedia = (FeedMedia) playable;
|
FeedPreferences preferences = feedMedia.getItem().getFeed().getPreferences();
|
||||||
FeedPreferences preferences = feedMedia.getItem().getFeed().getPreferences();
|
VolumeAdaptionSetting volumeAdaptionSetting = preferences.getVolumeAdaptionSetting();
|
||||||
VolumeAdaptionSetting volumeAdaptionSetting = preferences.getVolumeAdaptionSetting();
|
float adaptionFactor = volumeAdaptionSetting.getAdaptionFactor();
|
||||||
float adaptionFactor = volumeAdaptionSetting.getAdaptionFactor();
|
volumeLeft *= adaptionFactor;
|
||||||
volumeLeft *= adaptionFactor;
|
volumeRight *= adaptionFactor;
|
||||||
volumeRight *= adaptionFactor;
|
|
||||||
}
|
|
||||||
mediaPlayer.setVolume(volumeLeft, volumeRight);
|
|
||||||
Log.d(TAG, "Media player volume was set to " + volumeLeft + " " + volumeRight);
|
|
||||||
}
|
}
|
||||||
|
mediaPlayer.setVolume(volumeLeft, volumeRight);
|
||||||
|
Log.d(TAG, "Media player volume was set to " + volumeLeft + " " + volumeRight);
|
||||||
playerLock.unlock();
|
playerLock.unlock();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue