當前位置: 首頁>>代碼示例>>Java>>正文


Java Extensions類代碼示例

本文整理匯總了Java中org.videolan.libvlc.util.Extensions的典型用法代碼示例。如果您正苦於以下問題:Java Extensions類的具體用法?Java Extensions怎麽用?Java Extensions使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


Extensions類屬於org.videolan.libvlc.util包,在下文中一共展示了Extensions類的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: accept

import org.videolan.libvlc.util.Extensions; //導入依賴的package包/類
@Override
public boolean accept(File f) {
    boolean accepted = false;
    if (!f.isHidden()) {
        if (f.isDirectory() && !FOLDER_BLACKLIST.contains(f.getPath().toLowerCase(Locale.ENGLISH))) {
            accepted = true;
        } else {
            String fileName = f.getName().toLowerCase(Locale.ENGLISH);
            int dotIndex = fileName.lastIndexOf(".");
            if (dotIndex != -1) {
                String fileExt = fileName.substring(dotIndex);
                accepted = Extensions.AUDIO.contains(fileExt) ||
                           Extensions.VIDEO.contains(fileExt) ||
                           Extensions.PLAYLIST.contains(fileExt);
            }
        }
    }
    return accepted;
}
 
開發者ID:jiaZengShen,項目名稱:vlc_android_win,代碼行數:20,代碼來源:MediaLibrary.java

示例2: checkSubtitles

import org.videolan.libvlc.util.Extensions; //導入依賴的package包/類
private void checkSubtitles(File itemFile) {
    String extension, filename, videoName = Uri.decode(itemFile.getName()), parentPath = Uri.decode(itemFile.getParent());
    videoName = videoName.substring(0, videoName.lastIndexOf('.'));
    String[] subFolders = {"/Subtitles", "/subtitles", "/Subs", "/subs"};
    String[] files = itemFile.getParentFile().list();
    int filesLength = files == null ? 0 : files.length;
    for (int i = 0 ; i < subFolders.length ; ++i){
        File subFolder = new File(parentPath+subFolders[i]);
        if (!subFolder.exists())
            continue;
        String[] subFiles = subFolder.list();
        int subFilesLength = 0;
        String[] newFiles = new String[0];
        if (subFiles != null) {
            subFilesLength = subFiles.length;
            newFiles = new String[filesLength+subFilesLength];
            System.arraycopy(subFiles, 0, newFiles, 0, subFilesLength);
        }
        if (files != null)
            System.arraycopy(files, 0, newFiles, subFilesLength, filesLength);
        files = newFiles;
        filesLength = files.length;
    }
    for (int i = 0; i<filesLength ; ++i){
        filename = Uri.decode(files[i]);
        int index = filename.lastIndexOf('.');
        if (index <= 0)
            continue;
        extension = filename.substring(index);
        if (!Extensions.SUBTITLES.contains(extension))
            continue;
        if (filename.startsWith(videoName)) {
            mHandler.obtainMessage(SHOW_SUBTITLES).sendToTarget();
            return;
        }
    }
}
 
開發者ID:jiaZengShen,項目名稱:vlc_android_win,代碼行數:38,代碼來源:MediaInfoFragment.java

示例3: init

import org.videolan.libvlc.util.Extensions; //導入依賴的package包/類
private void init(Media media) {
    mType = TYPE_ALL;

    if (media != null) {
        if (media.isParsed()) {
            mLength = media.getDuration();

            for (int i = 0; i < media.getTrackCount(); ++i) {
                final Media.Track track = media.getTrack(i);
                if (track == null)
                    continue;
                if (track.type == Media.Track.Type.Video) {
                    final Media.VideoTrack videoTrack = (VideoTrack) track;
                    mType = TYPE_VIDEO;
                    mWidth = videoTrack.width;
                    mHeight = videoTrack.height;
                } else if (mType == TYPE_ALL && track.type == Media.Track.Type.Audio){
                    mType = TYPE_AUDIO;
                }
            }
        }
        updateMeta(media);
        if (mType == TYPE_ALL && media.getType() == Media.Type.Directory)
            mType = TYPE_DIR;
    }

    if (mType == TYPE_ALL) {
        final String location = mUri.toString();
        int dotIndex = location.lastIndexOf(".");
        if (dotIndex != -1) {
            String fileExt = location.substring(dotIndex).toLowerCase(Locale.ENGLISH);
            if( Extensions.VIDEO.contains(fileExt) ) {
                mType = TYPE_VIDEO;
            } else if (Extensions.AUDIO.contains(fileExt)) {
                mType = TYPE_AUDIO;
            } else if (Extensions.SUBTITLES.contains(fileExt)) {
                mType = TYPE_SUBTITLE;
            } else if (Extensions.PLAYLIST.contains(fileExt)) {
                mType = TYPE_PLAYLIST;
            }
        }
    }
}
 
開發者ID:jiaZengShen,項目名稱:vlc_android_win,代碼行數:44,代碼來源:MediaWrapper.java

示例4: init

import org.videolan.libvlc.util.Extensions; //導入依賴的package包/類
private void init(Media media) {
    mType = TYPE_ALL;

    if (media != null) {
        if (media.isParsed()) {
            mLength = media.getDuration();

            for (int i = 0; i < media.getTrackCount(); ++i) {
                final Media.Track track = media.getTrack(i);
                if (track == null)
                    continue;
                if (track.type == Media.Track.Type.Video) {
                    final Media.VideoTrack videoTrack = (VideoTrack) track;
                    mType = TYPE_VIDEO;
                    mWidth = videoTrack.width;
                    mHeight = videoTrack.height;
                } else if (mType == TYPE_ALL && track.type == Media.Track.Type.Audio){
                    mType = TYPE_AUDIO;
                }
            }
        }
        updateMeta(media);
        if (mType == TYPE_ALL && media.getType() == Media.Type.Directory)
            mType = TYPE_DIR;
    }

    if (mType == TYPE_ALL) {
        final int index = mUri.toString().indexOf('?');
        String location;
        if (index == -1)
            location = mUri.toString();
        else
            location = mUri.toString().substring(0, index);
        int dotIndex = location.lastIndexOf(".");
        if (dotIndex != -1) {
            String fileExt = location.substring(dotIndex).toLowerCase(Locale.ENGLISH);
            if( Extensions.VIDEO.contains(fileExt) ) {
                mType = TYPE_VIDEO;
            } else if (Extensions.AUDIO.contains(fileExt)) {
                mType = TYPE_AUDIO;
            } else if (Extensions.SUBTITLES.contains(fileExt)) {
                mType = TYPE_SUBTITLE;
            } else if (Extensions.PLAYLIST.contains(fileExt)) {
                mType = TYPE_PLAYLIST;
            }
        }
    }
}
 
開發者ID:hanhailong,項目名稱:VCL-Android,代碼行數:49,代碼來源:MediaWrapper.java


注:本文中的org.videolan.libvlc.util.Extensions類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。