private void playAudio() { if (this.prepareAudio()) { int position = index * (int) (1000 / video.getFps()); this.audioPlayer.seekTo(position); this.audioPlayer.start(); } }
private void initPlayer() { TimerTask imageLoadTask = new ImageLoadTask(); TimerTask playTask = new PlayTask(); this.playTimer = new Timer("Video player", true); this.playTimer.schedule(imageLoadTask, 0, 1); this.playTimer.scheduleAtFixedRate(playTask, 0, (long) (1000 / video.getFps())); }