コード例 #1
0
  @Override
  public void onPrepared(MediaPlayer mp) {
    mediaPlayer.start();
    mediacontroller.setMediaPlayer(this);
    mediacontroller.setAnchorView(findViewById(R.id.surfaceView));

    mediacontroller.show();
  }
コード例 #2
0
 @Override
 public void start() {
   mediaPlayer.start();
   // plugin.CountPlay(getApplicationContext());
   /*if (plugin.ElapsedTime() != 0) {
       PlaysText.setText("Plays: "+ plugin.CountPlay());
       TimeElapsedText.setText("Time elapsed: "+ plugin.ElapsedTime() + "ms");
   }*/
 }
コード例 #3
0
  @Override
  public void surfaceCreated(SurfaceHolder holder) {
    // prepare for playback
    try {
      mediaPlayer = new CustomMediaPlayer();
      mediaPlayer.setDisplay(vidHolder);
      mediaPlayer.setDataSource(videoURL);
      mediaPlayer.prepare();
      mediaPlayer.setOnPreparedListener(this);
      mediaPlayer.setAudioStreamType(AudioManager.STREAM_MUSIC);
      mediacontroller = new MediaController(this);

      plugin = new MyPlugin(getApplication(), mediaPlayer);

    } catch (Exception e) {
      e.printStackTrace();
    }
  }
コード例 #4
0
 @Override
 public boolean isPlaying() {
   return mediaPlayer.isPlaying();
 }
コード例 #5
0
 @Override
 public void seekTo(int pos) {
   mediaPlayer.seekTo(pos);
 }
コード例 #6
0
 @Override
 public int getCurrentPosition() {
   return mediaPlayer.getCurrentPosition();
 }
コード例 #7
0
 @Override
 public int getDuration() {
   return mediaPlayer.getDuration();
 }
コード例 #8
0
 @Override
 public void pause() {
   mediaPlayer.pause();
   // PausesText.setText("Pauses: " + plugin.CountPause());
   // plugin.CountPause(getApplicationContext());
 }