android.media.MediaPlayer.OnErrorListener Java Examples

The following examples show how to use android.media.MediaPlayer.OnErrorListener. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: WarActivity.java    From BotLibre with Eclipse Public License 1.0 5 votes vote down vote up
public void resetVideoErrorListener2() {
	video2View.setOnErrorListener(new OnErrorListener() {
		@Override
		public boolean onError(MediaPlayer mp, int what, int extra) {
			Log.wtf("Video error", "what:" + what + " extra:" + extra);
			videoError = true;
			return true;
		}
	});
}
 
Example #2
Source File: ChatActivity.java    From BotLibre with Eclipse Public License 1.0 5 votes vote down vote up
public void resetVideoErrorListener() {
	videoView.setOnErrorListener(new OnErrorListener() {
		@Override
		public boolean onError(MediaPlayer mp, int what, int extra) {
			Log.wtf("Video error", "what:" + what + " extra:" + extra);
			videoError = true;
			return true;
		}
	});
}
 
Example #3
Source File: AvatarTestActivity.java    From BotLibre with Eclipse Public License 1.0 5 votes vote down vote up
public void resetVideoErrorListener() {
	videoView.setOnErrorListener(new OnErrorListener() {
		@Override
		public boolean onError(MediaPlayer mp, int what, int extra) {
			Log.wtf("Video error", "what:" + what + " extra:" + extra);
			videoError = true;
			return true;
		}
	});
}
 
Example #4
Source File: AvatarMediaActivity.java    From BotLibre with Eclipse Public License 1.0 5 votes vote down vote up
public void resetVideoErrorListener() {
	videoView.setOnErrorListener(new OnErrorListener() {
		@Override
		public boolean onError(MediaPlayer mp, int what, int extra) {
			Log.wtf("Video error", "what:" + what + " extra:" + extra);
			videoError = true;
			return true;
		}
	});
}
 
Example #5
Source File: VideoView.java    From BotLibre with Eclipse Public License 1.0 5 votes vote down vote up
public void setOnErrorListener(OnErrorListener listener) {
	System.out.println("OnErrorList...");
	Platform.runLater(new Runnable() {
		@Override
		public void run() {
			try {
				if (mediaPlayer != null) {
					mediaPlayer.stop();
				}
			} catch (Exception e) {
				System.out.println("SetOnErrorListener\nError Player Video: " + e.toString());
			}
		}
	});
}
 
Example #6
Source File: ChatActivity.java    From BotLibre with Eclipse Public License 1.0 5 votes vote down vote up
public void resetVideoErrorListener() {
	videoView.setOnErrorListener(new OnErrorListener() {
		@Override
		public boolean onError(MediaPlayer mp, int what, int extra) {
			Log.wtf("Video error", "what:" + what + " extra:" + extra);
			videoError = true;
			return true;
		}
	});
}
 
Example #7
Source File: ChatActivity.java    From BotLibre with Eclipse Public License 1.0 5 votes vote down vote up
public void resetVideoErrorListener() {
	videoView.setOnErrorListener(new OnErrorListener() {
		@Override
		public boolean onError(MediaPlayer mp, int what, int extra) {
			Log.wtf("Video error", "what:" + what + " extra:" + extra);
			videoError = true;
			return true;
		}
	});
}
 
Example #8
Source File: WarActivity.java    From BotLibre with Eclipse Public License 1.0 5 votes vote down vote up
public void resetVideoErrorListener2() {
	video2View.setOnErrorListener(new OnErrorListener() {
		@Override
		public boolean onError(MediaPlayer mp, int what, int extra) {
			Log.wtf("Video error", "what:" + what + " extra:" + extra);
			videoError = true;
			return true;
		}
	});
}
 
Example #9
Source File: AvatarTestActivity.java    From BotLibre with Eclipse Public License 1.0 5 votes vote down vote up
public void resetVideoErrorListener() {
	videoView.setOnErrorListener(new OnErrorListener() {
		@Override
		public boolean onError(MediaPlayer mp, int what, int extra) {
			Log.wtf("Video error", "what:" + what + " extra:" + extra);
			videoError = true;
			return true;
		}
	});
}
 
Example #10
Source File: AvatarMediaActivity.java    From BotLibre with Eclipse Public License 1.0 5 votes vote down vote up
public void resetVideoErrorListener() {
	videoView.setOnErrorListener(new OnErrorListener() {
		@Override
		public boolean onError(MediaPlayer mp, int what, int extra) {
			Log.wtf("Video error", "what:" + what + " extra:" + extra);
			videoError = true;
			return true;
		}
	});
}
 
Example #11
Source File: GraphicMediaActivity.java    From BotLibre with Eclipse Public License 1.0 5 votes vote down vote up
public void resetVideoErrorListener() {
	videoView.setOnErrorListener(new OnErrorListener() {
		@Override
		public boolean onError(MediaPlayer mp, int what, int extra) {
			Log.wtf("Video error", "what:" + what + " extra:" + extra);
			videoError = true;
			return true;
		}
	});
}
 
Example #12
Source File: ChatActivity.java    From BotLibre with Eclipse Public License 1.0 5 votes vote down vote up
public void resetVideoErrorListener() {
	videoView.setOnErrorListener(new OnErrorListener() {
		@Override
		public boolean onError(MediaPlayer mp, int what, int extra) {
			Log.wtf("Video error", "what:" + what + " extra:" + extra);
			videoError = true;
			return true;
		}
	});
}
 
Example #13
Source File: AvatarTestActivity.java    From BotLibre with Eclipse Public License 1.0 5 votes vote down vote up
public void resetVideoErrorListener() {
	videoView.setOnErrorListener(new OnErrorListener() {
		@Override
		public boolean onError(MediaPlayer mp, int what, int extra) {
			Log.wtf("Video error", "what:" + what + " extra:" + extra);
			videoError = true;
			return true;
		}
	});
}
 
Example #14
Source File: AvatarMediaActivity.java    From BotLibre with Eclipse Public License 1.0 5 votes vote down vote up
public void resetVideoErrorListener() {
	videoView.setOnErrorListener(new OnErrorListener() {
		@Override
		public boolean onError(MediaPlayer mp, int what, int extra) {
			Log.wtf("Video error", "what:" + what + " extra:" + extra);
			videoError = true;
			return true;
		}
	});
}
 
Example #15
Source File: GraphicMediaActivity.java    From BotLibre with Eclipse Public License 1.0 5 votes vote down vote up
public void resetVideoErrorListener() {
	videoView.setOnErrorListener(new OnErrorListener() {
		@Override
		public boolean onError(MediaPlayer mp, int what, int extra) {
			Log.wtf("Video error", "what:" + what + " extra:" + extra);
			videoError = true;
			return true;
		}
	});
}
 
Example #16
Source File: ChatActivity.java    From BotLibre with Eclipse Public License 1.0 5 votes vote down vote up
public void resetVideoErrorListener() {
	videoView.setOnErrorListener(new OnErrorListener() {
		@Override
		public boolean onError(MediaPlayer mp, int what, int extra) {
			Log.wtf("Video error", "what:" + what + " extra:" + extra);
			videoError = true;
			return true;
		}
	});
}
 
Example #17
Source File: WarActivity.java    From BotLibre with Eclipse Public License 1.0 5 votes vote down vote up
public void resetVideoErrorListener2() {
	video2View.setOnErrorListener(new OnErrorListener() {
		@Override
		public boolean onError(MediaPlayer mp, int what, int extra) {
			Log.wtf("Video error", "what:" + what + " extra:" + extra);
			videoError = true;
			return true;
		}
	});
}
 
Example #18
Source File: AvatarTestActivity.java    From BotLibre with Eclipse Public License 1.0 5 votes vote down vote up
public void resetVideoErrorListener() {
	videoView.setOnErrorListener(new OnErrorListener() {
		@Override
		public boolean onError(MediaPlayer mp, int what, int extra) {
			Log.wtf("Video error", "what:" + what + " extra:" + extra);
			videoError = true;
			return true;
		}
	});
}
 
Example #19
Source File: AvatarMediaActivity.java    From BotLibre with Eclipse Public License 1.0 5 votes vote down vote up
public void resetVideoErrorListener() {
	videoView.setOnErrorListener(new OnErrorListener() {
		@Override
		public boolean onError(MediaPlayer mp, int what, int extra) {
			Log.wtf("Video error", "what:" + what + " extra:" + extra);
			videoError = true;
			return true;
		}
	});
}
 
Example #20
Source File: GraphicMediaActivity.java    From BotLibre with Eclipse Public License 1.0 5 votes vote down vote up
public void resetVideoErrorListener() {
	videoView.setOnErrorListener(new OnErrorListener() {
		@Override
		public boolean onError(MediaPlayer mp, int what, int extra) {
			Log.wtf("Video error", "what:" + what + " extra:" + extra);
			videoError = true;
			return true;
		}
	});
}
 
Example #21
Source File: VideoView.java    From BotLibre with Eclipse Public License 1.0 5 votes vote down vote up
public void setOnErrorListener(OnErrorListener listener) {
	System.out.println("OnErrorList...");
	Platform.runLater(new Runnable() {
		@Override
		public void run() {
			try {
				if (mediaPlayer != null) {
					mediaPlayer.stop();
				}
			} catch (Exception e) {
				System.out.println("SetOnErrorListener\nError Player Video: " + e.toString());
			}
		}
	});
}
 
Example #22
Source File: SampleVideoPlayer.java    From googleads-ima-android with Apache License 2.0 4 votes vote down vote up
@Override
public void setOnErrorListener(OnErrorListener listener) {
  // The OnErrorListener can only be implemented by SampleVideoPlayer.
  throw new UnsupportedOperationException();
}
 
Example #23
Source File: NotificationKlaxon.java    From boilr with GNU General Public License v3.0 4 votes vote down vote up
public static void start(final Context context, Alarm alarm) {
	AndroidNotifier notifier = (AndroidNotifier) alarm.getNotifier();
	// Make sure we are stop before starting
	stop(context);
	SharedPreferences sharedPrefs = PreferenceManager.getDefaultSharedPreferences(context);
	String alertSound = notifier.getAlertSound();
	Uri alertSoundUri = null;
			
	if(alertSound != null)
		alertSoundUri = Uri.parse(alertSound);
	else
		alertSoundUri = Uri.parse(sharedPrefs.getString(SettingsFragment.PREF_KEY_DEFAULT_ALERT_SOUND, ""));		
	
	
	if(!(Uri.EMPTY).equals(alertSoundUri)) { // Silent or None was selected
		sMediaPlayer = new MediaPlayer();
		sMediaPlayer.setOnErrorListener(new OnErrorListener() {
			@Override
			public boolean onError(MediaPlayer mp, int what, int extra) {
				Log.e("Error occurred while playing audio. Stopping NotificationKlaxon.");
				NotificationKlaxon.stop(context);
				return true;
			}
		});

		Integer alertType = notifier.getAlertType();
		if(alertType == null) {
			alertType = Integer.parseInt(sharedPrefs.getString(SettingsFragment.PREF_KEY_DEFAULT_ALERT_TYPE, ""));
		}
		try {
			sMediaPlayer.setDataSource(context, alertSoundUri);
			startAlarm(context, sMediaPlayer, alertType);
		} catch(Exception ex) {
			Log.d("NotificationKlaxon using the fallback ringtone.");
			// The alarmNoise may be on the sd card which could be busy right
			// now. Use the fallback ringtone.
			try {
				// Must reset the media player to clear the error state.
				sMediaPlayer.reset();
				alertSoundUri = RingtoneManager.getDefaultUri(RingtoneManager.TYPE_ALARM);
				sMediaPlayer.setDataSource(context, alertSoundUri);
				startAlarm(context, sMediaPlayer, alertType);
			} catch(Exception ex2) {
				// At this point we just don't play anything.
				Log.e("NotificationKlaxon failed to play fallback ringtone.", ex2);
			}
		}
	}

	Boolean vibrate = notifier.isVibrate();
	if(vibrate == null)
		vibrate = sharedPrefs.getBoolean(SettingsFragment.PREF_KEY_VIBRATE_DEFAULT, true);
	if(vibrate) {
		Vibrator vibrator = (Vibrator) context.getSystemService(Context.VIBRATOR_SERVICE);
		vibrator.vibrate(sVibratePattern, 0);
	}

	sStarted = true;
}
 
Example #24
Source File: VideoViewH264mp4_4D.java    From letv with Apache License 2.0 4 votes vote down vote up
public void setOnErrorListener(OnErrorListener l) {
    this.mOnErrorListener = l;
}
 
Example #25
Source File: VideoView.java    From libvlc-android-sdk with GNU Lesser General Public License v2.1 4 votes vote down vote up
public void setOnErrorListener(OnErrorListener l) {
}
 
Example #26
Source File: VideoViewH264m3u8.java    From letv with Apache License 2.0 4 votes vote down vote up
public void setOnErrorListener(OnErrorListener l) {
    this.mOnErrorListener = l;
}
 
Example #27
Source File: VideoViewH264LeMobile.java    From letv with Apache License 2.0 4 votes vote down vote up
public void setOnErrorListener(OnErrorListener l) {
    this.mOnErrorListener = l;
}
 
Example #28
Source File: VideoViewH264m3u8Hw.java    From letv with Apache License 2.0 4 votes vote down vote up
public void setOnErrorListener(OnErrorListener l) {
    this.mOnErrorListener = l;
}
 
Example #29
Source File: VideoViewH264m3u8HwLeMobile.java    From letv with Apache License 2.0 4 votes vote down vote up
public void setOnErrorListener(OnErrorListener l) {
    this.mOnErrorListener = l;
}
 
Example #30
Source File: VideoViewH264mp4.java    From letv with Apache License 2.0 4 votes vote down vote up
public void setOnErrorListener(OnErrorListener l) {
    this.mOnErrorListener = l;
}