Example #1
0
 private void loadImage(int index) {
   Log.d(TAG, "load image:" + index);
   if (index < video.getImages().length && index >= 0) {
     File img = video.getImages()[index];
     Bitmap bmp = BitmapFactory.decodeFile(img.getAbsolutePath(), this.bmpOptions);
     if (bmp != null) {
       synchronized (bmpQ) {
         bmpQ.offer(bmp);
       }
     }
   }
 }
Example #2
0
 private void playAudio() {
   if (this.prepareAudio()) {
     int position = index * (int) (1000 / video.getFps());
     this.audioPlayer.seekTo(position);
     this.audioPlayer.start();
   }
 }
Example #3
0
 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()));
 }