mirror of
https://github.com/Julow/Unexpected-Keyboard.git
synced 2024-11-28 18:23:16 +01:00
launcher: Remove intro video when not supported
Previously, this would trigger an error popup and make the activity unresponsive.
This commit is contained in:
parent
c524caa6f1
commit
409362ddb4
@ -48,7 +48,7 @@ public class LauncherActivity extends Activity
|
||||
imm.showInputMethodPicker();
|
||||
}
|
||||
|
||||
static void setup_intro_video(VideoView v)
|
||||
static void setup_intro_video(final VideoView v)
|
||||
{
|
||||
if (VERSION.SDK_INT >= 26)
|
||||
v.setAudioFocusRequest(AudioManager.AUDIOFOCUS_NONE);
|
||||
@ -57,10 +57,21 @@ public class LauncherActivity extends Activity
|
||||
v.setOnPreparedListener(new MediaPlayer.OnPreparedListener()
|
||||
{
|
||||
@Override
|
||||
public void onPrepared(MediaPlayer mp) {
|
||||
public void onPrepared(MediaPlayer mp)
|
||||
{
|
||||
mp.setLooping(true);
|
||||
}
|
||||
});
|
||||
v.setOnErrorListener(new MediaPlayer.OnErrorListener()
|
||||
{
|
||||
@Override
|
||||
public boolean onError(MediaPlayer mp, int what, int extra)
|
||||
{
|
||||
v.stopPlayback();
|
||||
v.setVisibility(View.GONE);
|
||||
return true;
|
||||
}
|
||||
});
|
||||
v.start();
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user