当前位置: 首页>>代码示例>>Java>>正文


Java Video类代码示例

本文整理汇总了Java中io.vov.vitamio.provider.MediaStore.Video的典型用法代码示例。如果您正苦于以下问题:Java Video类的具体用法?Java Video怎么用?Java Video使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


Video类属于io.vov.vitamio.provider.MediaStore包,在下文中一共展示了Video类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: toValues

import io.vov.vitamio.provider.MediaStore.Video; //导入依赖的package包/类
private ContentValues toValues() {
  ContentValues map = new ContentValues();

  map.put(MediaStore.MediaColumns.DATA, mPath);
  map.put(MediaStore.MediaColumns.DATE_MODIFIED, mLastModified);
  map.put(MediaStore.MediaColumns.SIZE, mFileSize);
  map.put(MediaStore.MediaColumns.MIME_TYPE, mMimeType);
  map.put(MediaStore.MediaColumns.TITLE, mTitle);

  if (MediaFile.isVideoFileType(mFileType)) {
    map.put(Video.Media.DURATION, mDuration);
    map.put(Video.Media.LANGUAGE, mLanguage);
    map.put(Video.Media.ALBUM, mAlbum);
    map.put(Video.Media.ARTIST, mArtist);
    map.put(Video.Media.WIDTH, mWidth);
    map.put(Video.Media.HEIGHT, mHeight);
  }

  return map;
}
 
开发者ID:coding-dream,项目名称:TPlayer,代码行数:21,代码来源:MediaScanner.java

示例2: toValues

import io.vov.vitamio.provider.MediaStore.Video; //导入依赖的package包/类
private ContentValues toValues() {
    ContentValues map = new ContentValues();

    map.put(MediaStore.MediaColumns.DATA, mPath);
    map.put(MediaStore.MediaColumns.DATE_MODIFIED, mLastModified);
    map.put(MediaStore.MediaColumns.SIZE, mFileSize);
    map.put(MediaStore.MediaColumns.MIME_TYPE, mMimeType);
    map.put(MediaStore.MediaColumns.TITLE, mTitle);

    if (MediaFile.isVideoFileType(mFileType)) {
        map.put(Video.Media.DURATION, mDuration);
        map.put(Video.Media.LANGUAGE, mLanguage);
        map.put(Video.Media.ALBUM, mAlbum);
        map.put(Video.Media.ARTIST, mArtist);
        map.put(Video.Media.WIDTH, mWidth);
        map.put(Video.Media.HEIGHT, mHeight);
    }

    return map;
}
 
开发者ID:WangZhiYao,项目名称:VideoDemo,代码行数:21,代码来源:MediaScanner.java

示例3: addNoMediaFolder

import io.vov.vitamio.provider.MediaStore.Video; //导入依赖的package包/类
public void addNoMediaFolder(String path) {
  ContentValues values = new ContentValues();
  values.put(MediaStore.MediaColumns.DATA, "");
  String[] pathSpec = new String[]{path + '%'};
  try {
    mProvider.update(Video.Media.CONTENT_URI, values, MediaStore.MediaColumns.DATA + " LIKE ?", pathSpec);
  } catch (RemoteException e) {
    throw new RuntimeException();
  }
}
 
开发者ID:coding-dream,项目名称:TPlayer,代码行数:11,代码来源:MediaScanner.java

示例4: addNoMediaFolder

import io.vov.vitamio.provider.MediaStore.Video; //导入依赖的package包/类
public void addNoMediaFolder(String path) {
    ContentValues values = new ContentValues();
    values.put(MediaStore.MediaColumns.DATA, "");
    String[] pathSpec = new String[]{path + '%'};
    try {
        mProvider.update(Video.Media.CONTENT_URI, values, MediaStore.MediaColumns.DATA + " LIKE ?", pathSpec);
    } catch (RemoteException e) {
        throw new RuntimeException();
    }
}
 
开发者ID:WangZhiYao,项目名称:VideoDemo,代码行数:11,代码来源:MediaScanner.java

示例5: randomAccessFilePath

import io.vov.vitamio.provider.MediaStore.Video; //导入依赖的package包/类
private String randomAccessFilePath(int version) {
  String directoryName = Environment.getExternalStorageDirectory().toString() + "/" + Video.Thumbnails.THUMBNAILS_DIRECTORY;
  return directoryName + "/.thumbdata" + version + "-" + mUri.hashCode();
}
 
开发者ID:coding-dream,项目名称:TPlayer,代码行数:5,代码来源:MiniThumbFile.java

示例6: prescan

import io.vov.vitamio.provider.MediaStore.Video; //导入依赖的package包/类
private void prescan(String filePath) throws RemoteException {
  mProvider = mContext.getContentResolver().acquireContentProviderClient(MediaStore.AUTHORITY);
  Cursor c = null;
  String where = null;
  String[] selectionArgs = null;

  if (mFileCache == null)
    mFileCache = new HashMap<String, FileCacheEntry>();
  else
    mFileCache.clear();

  try {
    if (filePath != null) {
      where = Video.Media.DATA + "=?";
      selectionArgs = new String[]{filePath};
    }

    c = mProvider.query(Video.Media.CONTENT_URI, VIDEO_PROJECTION, where, selectionArgs, null);
    if (c != null) {
      try {
        while (c.moveToNext()) {
          long rowId = c.getLong(ID_VIDEO_COLUMN_INDEX);
          String path = c.getString(PATH_VIDEO_COLUMN_INDEX);
          long lastModified = c.getLong(DATE_MODIFIED_VIDEO_COLUMN_INDEX);
          if (path.startsWith("/")) {
            File tempFile = new File(path);
            if (!TextUtils.isEmpty(filePath) && !tempFile.exists()) {
              mProvider.delete(Video.Media.CONTENT_URI, where, selectionArgs);
              return;
            }
            path = FileUtils.getCanonical(tempFile);
            String key = mCaseInsensitivePaths ? path.toLowerCase() : path;
            mFileCache.put(key, new FileCacheEntry(Video.Media.CONTENT_URI, rowId, path, lastModified));
          }
        }
      } finally {
        c.close();
        c = null;
      }
    }
  } finally {
    if (c != null) {
      c.close();
    }
  }
}
 
开发者ID:coding-dream,项目名称:TPlayer,代码行数:47,代码来源:MediaScanner.java

示例7: endFile

import io.vov.vitamio.provider.MediaStore.Video; //导入依赖的package包/类
private Uri endFile(FileCacheEntry entry) throws RemoteException {
  Uri tableUri;
  boolean isVideo = MediaFile.isVideoFileType(mFileType) && mWidth > 0 && mHeight > 0;
  if (isVideo) {
    tableUri = Video.Media.CONTENT_URI;
  } else {
    return null;
  }
  entry.mTableUri = tableUri;

  ContentValues values = toValues();
  String title = values.getAsString(MediaStore.MediaColumns.TITLE);
  if (TextUtils.isEmpty(title)) {
    title = values.getAsString(MediaStore.MediaColumns.DATA);
    int lastSlash = title.lastIndexOf('/');
    if (lastSlash >= 0) {
      lastSlash++;
      if (lastSlash < title.length())
        title = title.substring(lastSlash);
    }
    int lastDot = title.lastIndexOf('.');
    if (lastDot > 0)
      title = title.substring(0, lastDot);
    values.put(MediaStore.MediaColumns.TITLE, title);
  }

  long rowId = entry.mRowId;

  Uri result = null;
  if (rowId == 0) {
    result = mProvider.insert(tableUri, values);
    if (result != null) {
      rowId = ContentUris.parseId(result);
      entry.mRowId = rowId;
    }
  } else {
    result = ContentUris.withAppendedId(tableUri, rowId);
    mProvider.update(result, values, null, null);
  }

  return result;
}
 
开发者ID:coding-dream,项目名称:TPlayer,代码行数:43,代码来源:MediaScanner.java


注:本文中的io.vov.vitamio.provider.MediaStore.Video类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。