本文整理汇总了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;
}
示例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;
}
}
}
示例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;
}
}
}
}
示例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;
}
}
}
}