Java 类android.media.MediaPlayer.OnErrorListener 实例源码

项目:boohee_v5.6    文件:VideoPlayActivity.java   
private void initVideoData() {
    if (this.mentionIndex >= this.totalMetionCount) {
        lessonFinish();
        return;
    }
    this.currentMention = (Mention) this.mentionList.get(this.mentionIndex);
    this.videoPath = this.videoDownloadHelper.getVideoName(this.ctx, this.currentMention.id);
    this.videoView.setVideoPath(this.videoPath);
    this.videoView.setOnErrorListener(new OnErrorListener() {
        public boolean onError(MediaPlayer mediaPlayer, int i, int i1) {
            VideoPlayActivity.this.onPlayError();
            return true;
        }
    });
    this.videoView.setOnCompletionListener(new OnCompletionListener() {
        public void onCompletion(MediaPlayer mp) {
            if (VideoPlayActivity.this.currentMention.is_times && !VideoPlayActivity.this
                    .isMentionComplete() && VideoPlayActivity.this.isCounting) {
                VideoPlayActivity.this.handler.post(VideoPlayActivity.this.countDownRunnable);
                VideoPlayActivity.this.playCountNum = VideoPlayActivity.this.playCountNum + 1;
            }
            VideoPlayActivity.this.videoView.seekTo(0);
            VideoPlayActivity.this.videoView.start();
        }
    });
}
项目:boohee_v5.6    文件:VideoPlayerManager.java   
public static void initPlayer(VideoView videoView, OnPreparedListener onPreparedListener,
                              OnCompletionListener onCompletionListener, OnErrorListener
                                      onErrorListener) {
    if (onPreparedListener != null) {
        videoView.setOnPreparedListener(onPreparedListener);
    }
    if (onCompletionListener != null) {
        videoView.setOnCompletionListener(onCompletionListener);
    }
    if (onErrorListener != null) {
        videoView.setOnErrorListener(onErrorListener);
    }
}
项目:FMTech    文件:duy.java   
public final void a(MediaPlayer.OnErrorListener paramOnErrorListener)
{
  this.e = paramOnErrorListener;
  if (this.c != null) {
    this.c.setOnErrorListener(this.e);
  }
}
项目:BotLibre    文件:ChatActivity.java   
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;
        }
    });
}
项目:BotLibre    文件:AvatarTestActivity.java   
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;
        }
    });
}
项目:BotLibre    文件:AvatarMediaActivity.java   
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;
        }
    });
}
项目:BotLibre    文件:VideoView.java   
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());
            }
        }
    });
}
项目:BotLibre    文件:ChatActivity.java   
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;
        }
    });
}
项目:BotLibre    文件:ChatActivity.java   
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;
        }
    });
}
项目:BotLibre    文件:WarActivity.java   
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;
        }
    });
}
项目:BotLibre    文件:AvatarTestActivity.java   
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;
        }
    });
}
项目:BotLibre    文件:AvatarMediaActivity.java   
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;
        }
    });
}
项目:BotLibre    文件:GraphicMediaActivity.java   
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;
        }
    });
}
项目:BotLibre    文件:VideoView.java   
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());
            }
        }
    });
}
项目:Project-Libre    文件:ChatActivity.java   
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;
        }
    });
}
项目:Project-Libre    文件:ChatActivity.java   
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;
        }
    });
}
项目:googleads-ima-android    文件:SampleVideoPlayer.java   
private void init() {
    MediaController mediaController = new MediaController(getContext());
    mediaController.setAnchorView(this);

    // Set OnCompletionListener to notify our listeners when the video is completed.
    super.setOnCompletionListener(new OnCompletionListener() {

        @Override
        public void onCompletion(MediaPlayer mediaPlayer) {
            // Reset the MediaPlayer.
            // This prevents a race condition which occasionally results in the media
            // player crashing when switching between videos.
            mediaPlayer.reset();
            mediaPlayer.setDisplay(getHolder());

            for (OnVideoCompletedListener listener : mOnVideoCompletedListeners) {
                listener.onVideoCompleted();
            }
        }
    });

    // Set OnErrorListener to notify our listeners if the video errors.
    super.setOnErrorListener(new OnErrorListener() {

        @Override
        public boolean onError(MediaPlayer mp, int what, int extra) {

            // Returning true signals to MediaPlayer that we handled the error. This will
            // prevent the completion handler from being called.
            return true;
        }
    });
}
项目:googleads-ima-android    文件:SampleVideoPlayer.java   
private void init() {
    MediaController mediaController = new MediaController(getContext());
    mediaController.setAnchorView(this);

    // Set OnCompletionListener to notify our listeners when the video is completed.
    super.setOnCompletionListener(new OnCompletionListener() {

        @Override
        public void onCompletion(MediaPlayer mediaPlayer) {
            // Reset the MediaPlayer.
            // This prevents a race condition which occasionally results in the media
            // player crashing when switching between videos.
            mediaPlayer.reset();
            mediaPlayer.setDisplay(getHolder());

            for (OnVideoCompletedListener listener : mOnVideoCompletedListeners) {
                listener.onVideoCompleted();
            }
        }
    });

    // Set OnErrorListener to notify our listeners if the video errors.
    super.setOnErrorListener(new OnErrorListener() {

        @Override
        public boolean onError(MediaPlayer mp, int what, int extra) {

            // Returning true signals to MediaPlayer that we handled the error. This will
            // prevent the completion handler from being called.
            return true;
        }
    });
}
项目:wabbit-client    文件:AudioClip.java   
private void init(Context ctx, int resId) {
        name = ctx.getResources().getResourceName(resId);

        mPlayer = MediaPlayer.create(ctx, resId);
        // TODO: Quick hack! So that game won't crash if something weird is
        // going on... but find more robust way!
        if (mPlayer != null) {
            mPlayer.setOnErrorListener(new OnErrorListener() {
                @Override
                public boolean onError(MediaPlayer arg0, int arg1, int arg2) {
                    Log.d("AudioClip", "MediaPlayer Error::arg1=" + arg1 + "   arg2=" + arg2);
                    return false;
                }
            });
            mPlayer.setVolume(1000, 1000);

            mPlayer.setOnCompletionListener(new MediaPlayer.OnCompletionListener() {

                public void onCompletion(MediaPlayer mp) {
                    mPlaying = false;
//                  if (mLoop) {
//                      //Log.d("AudioClip","AudioClip loop " + name);
//                      mPlaying = true;
//                      mp.start();
//                  }
                }

            });
        } else {

        }
    }
项目:letv    文件:VideoViewH264m3u8.java   
public void setOnErrorListener(OnErrorListener l) {
    this.mOnErrorListener = l;
}
项目:letv    文件:VideoViewH264LeMobile.java   
public void setOnErrorListener(OnErrorListener l) {
    this.mOnErrorListener = l;
}
项目:letv    文件:VideoViewH264m3u8Hw.java   
public void setOnErrorListener(OnErrorListener l) {
    this.mOnErrorListener = l;
}
项目:letv    文件:VideoViewH264m3u8HwLeMobile.java   
public void setOnErrorListener(OnErrorListener l) {
    this.mOnErrorListener = l;
}
项目:letv    文件:VideoViewH264mp4.java   
public void setOnErrorListener(OnErrorListener l) {
    this.mOnErrorListener = l;
}
项目:letv    文件:VideoViewTV.java   
public void setOnErrorListener(OnErrorListener l) {
    this.mOnErrorListener = l;
}
项目:letv    文件:VideoViewH264m3u8_4D.java   
public void setOnErrorListener(OnErrorListener l) {
    this.mOnErrorListener = l;
}
项目:letv    文件:VideoViewH264LeMobile_4D.java   
public void setOnErrorListener(OnErrorListener l) {
    this.mOnErrorListener = l;
}
项目:letv    文件:VideoViewH264mp4_4D.java   
public void setOnErrorListener(OnErrorListener l) {
    this.mOnErrorListener = l;
}
项目:letv    文件:VideoViewH264m3u8Hw_4D.java   
public void setOnErrorListener(OnErrorListener l) {
    this.mOnErrorListener = l;
}
项目:letv    文件:FFMpegPlayer.java   
public void setOnErrorListener(OnErrorListener listener) {
    this.mOnErrorListener = listener;
}
项目:boohee_v5.6    文件:PureVideoView.java   
public void setOnErrorListener(OnErrorListener l) {
    this.mOnErrorListener = l;
}
项目:vlc-example-streamplayer    文件:VideoView.java   
public void setOnErrorListener(OnErrorListener l) {
}
项目:libvlc-sdk-android    文件:VideoView.java   
public void setOnErrorListener(OnErrorListener l) {
}
项目:popcorn-android    文件:VideoView.java   
public void setOnErrorListener(OnErrorListener l) {
}
项目:Android-VLC-Sample    文件:VideoView.java   
public void setOnErrorListener(OnErrorListener l) {
}
项目:LunVlc    文件:VideoView.java   
public void setOnErrorListener(OnErrorListener l) {
}
项目:LunVlc    文件:VideoView.java   
public void setOnErrorListener(OnErrorListener l) {
}
项目:vlc_android_win    文件:VideoView.java   
public void setOnErrorListener(OnErrorListener l) {
}
项目:VCL-Android    文件:VideoView.java   
public void setOnErrorListener(OnErrorListener l) {
}
项目:vlc-android    文件:VideoView.java   
public void setOnErrorListener(OnErrorListener l) {
}