예제 #1
0
  public MediaDirsTest() throws Exception {
    MediaPlayerFactory mediaPlayerFactory = new MediaPlayerFactory();

    MediaDiscoverer videoMediaDiscoverer = mediaPlayerFactory.newMediaDiscoverer("video_dir");
    Thread.sleep(500); // FIXME not acceptable
    MediaList videoFileList = videoMediaDiscoverer.getMediaList();
    //        videoFileList.addMediaListEventListener(this);
    List<MediaListItem> videoFiles = videoFileList.items();
    System.out.println("Video Files:");
    dumpItems(videoFiles, 1);

    System.out.println();

    MediaDiscoverer audioMediaDiscoverer = mediaPlayerFactory.newMediaDiscoverer("audio_dir");
    Thread.sleep(500); // FIXME not acceptable
    MediaList audioFileList = audioMediaDiscoverer.getMediaList();
    //        audioFileList.addMediaListEventListener(this);
    List<MediaListItem> audioFiles = audioFileList.items();
    System.out.println("Audio Files:");
    dumpItems(audioFiles, 1);

    System.out.println();

    MediaDiscoverer pictureMediaDiscoverer = mediaPlayerFactory.newMediaDiscoverer("picture_dir");
    Thread.sleep(500); // FIXME not acceptable
    MediaList pictureFileList = pictureMediaDiscoverer.getMediaList();
    //        pictureFileList.addMediaListEventListener(this);
    List<MediaListItem> pictureFiles = pictureFileList.items();
    System.out.println("Picture Files:");
    dumpItems(pictureFiles, 1);

    System.out.println("DONE!");

    //        Thread.currentThread().join();
    //        System.exit(0);
  }
 @Override
 protected final void onBeforeRelease() {
   onBeforeReleaseComponent();
   mediaListPlayer.release();
   mediaList.release();
 }
예제 #3
0
 @Override
 public void mediaListItemDeleted(MediaList mediaList, libvlc_media_t mediaInstance, int index) {
   System.out.println("ITEM DELETED: " + index + " -> " + mediaList.items());
 }