play audio by default when ringer mode is normal
This commit is contained in:
parent
346ad297f6
commit
5f5278f0ed
|
@ -24,6 +24,7 @@ import android.content.Context;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.graphics.Bitmap;
|
import android.graphics.Bitmap;
|
||||||
import android.graphics.BitmapFactory;
|
import android.graphics.BitmapFactory;
|
||||||
|
import android.media.AudioManager;
|
||||||
import android.media.MediaPlayer;
|
import android.media.MediaPlayer;
|
||||||
import android.net.Uri;
|
import android.net.Uri;
|
||||||
import android.os.Build;
|
import android.os.Build;
|
||||||
|
@ -1047,6 +1048,12 @@ public final class MediaViewerActivity extends BaseActivity implements IExtended
|
||||||
if (handler == null) {
|
if (handler == null) {
|
||||||
handler = new Handler(getActivity().getMainLooper());
|
handler = new Handler(getActivity().getMainLooper());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
AudioManager am = (AudioManager) getContext().getSystemService(Context.AUDIO_SERVICE);
|
||||||
|
|
||||||
|
// Play audio by default if ringer mode on
|
||||||
|
mPlayAudio = am.getRingerMode() == AudioManager.RINGER_MODE_NORMAL;
|
||||||
|
|
||||||
mVideoProgressRunnable = new VideoPlayProgressRunnable(handler, mVideoViewProgress,
|
mVideoProgressRunnable = new VideoPlayProgressRunnable(handler, mVideoViewProgress,
|
||||||
mDurationLabel, mPositionLabel, mVideoView);
|
mDurationLabel, mPositionLabel, mVideoView);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue