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


Java ExoPlayerLibraryInfo类代码示例

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


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

示例1: getUserAgent

import com.google.android.exoplayer.ExoPlayerLibraryInfo; //导入依赖的package包/类
/**
 * Returns a user agent string based on the given application name and the library version.
 *
 * @param context A valid context of the calling application.
 * @param applicationName String that will be prefix'ed to the generated user agent.
 * @return A user agent string generated using the applicationName and the library version.
 */
public static String getUserAgent(Context context, String applicationName) {
  String versionName;
  try {
    String packageName = context.getPackageName();
    PackageInfo info = context.getPackageManager().getPackageInfo(packageName, 0);
    versionName = info.versionName;
  } catch (NameNotFoundException e) {
    versionName = "?";
  }
  return applicationName + "/" + versionName + " (Linux;Android " + Build.VERSION.RELEASE
      + ") " + "ExoPlayerLib/" + ExoPlayerLibraryInfo.VERSION;
}
 
开发者ID:XueyanLiu,项目名称:miku,代码行数:20,代码来源:Util.java

示例2: getUserAgent

import com.google.android.exoplayer.ExoPlayerLibraryInfo; //导入依赖的package包/类
public static String getUserAgent(Context context) {
    String versionName;
    try {
        String packageName = context.getPackageName();
        PackageInfo info = context.getPackageManager().getPackageInfo(packageName, 0);
        versionName = info.versionName;
    } catch (PackageManager.NameNotFoundException e) {
        versionName = "?";
    }
    return "SampleTvInput/" + versionName + " (Linux;Android " + Build.VERSION.RELEASE +
            ") " + "ExoPlayerLib/" + ExoPlayerLibraryInfo.VERSION;
}
 
开发者ID:Fleker,项目名称:ChannelSurfer,代码行数:13,代码来源:TvInputPlayer.java

示例3: getUserAgent

import com.google.android.exoplayer.ExoPlayerLibraryInfo; //导入依赖的package包/类
public static String getUserAgent(Context context) {
    String versionName;
    try {
        String packageName = context.getPackageName();
        PackageInfo info = context.getPackageManager().getPackageInfo(packageName, 0);
        versionName = info.versionName;
    } catch (NameNotFoundException e) {
        versionName = "?";
    }
    return "ExoPlayerDemo/" + versionName + " (Linux;Android " + Build.VERSION.RELEASE +
            ") " + "ExoPlayerLib/" + ExoPlayerLibraryInfo.VERSION;
}
 
开发者ID:googlecodelabs,项目名称:android-tv-leanback,代码行数:13,代码来源:MyUtil.java

示例4: getUserAgent

import com.google.android.exoplayer.ExoPlayerLibraryInfo; //导入依赖的package包/类
public static String getUserAgent(Context context) {
  String versionName;
  try {
    String packageName = context.getPackageName();
    PackageInfo info = context.getPackageManager().getPackageInfo(packageName, 0);
    versionName = info.versionName;
  } catch (NameNotFoundException e) {
    versionName = "?";
  }
  return "ExoPlayerDemo/" + versionName + " (Linux;Android " + Build.VERSION.RELEASE +
      ") " + "ExoPlayerLib/" + ExoPlayerLibraryInfo.VERSION;
}
 
开发者ID:Weco,项目名称:android-exoplayer,代码行数:13,代码来源:DemoUtil.java

示例5: getUserAgent

import com.google.android.exoplayer.ExoPlayerLibraryInfo; //导入依赖的package包/类
/**
 * Generate a User-Agent string that should be sent with HTTP requests. A User-Agent string is
 * used to provide information such as the operating system and version to a server when it makes
 * a request. The server can use this information to select the version of the content which is
 * best suited for your system. For instance, a server could use the User-Agent string provided by
 * this app to ensure that it returns a video format that works on Android.
 * @param context The context (ex {@link android.app.Activity} which is calling this method.
 * @return The User-Agent string.
 */
public static String getUserAgent(Context context) {
  String versionName;
  try {
    String packageName = context.getPackageName();
    PackageInfo info = context.getPackageManager().getPackageInfo(packageName, 0);
    versionName = info.versionName;
  } catch (NameNotFoundException e) {
    versionName = "?";
  }
  return "ExoPlayerDemo/" + versionName + " (Linux;Android " + Build.VERSION.RELEASE +
      ") " + "ExoPlayerLib/" + ExoPlayerLibraryInfo.VERSION;
}
 
开发者ID:googleads,项目名称:google-media-framework-android,代码行数:22,代码来源:ExoplayerUtil.java

示例6: beginSection

import com.google.android.exoplayer.ExoPlayerLibraryInfo; //导入依赖的package包/类
/**
 * Writes a trace message to indicate that a given section of code has begun.
 *
 * @see android.os.Trace#beginSection(String)
 */
public static void beginSection(String sectionName) {
  if (ExoPlayerLibraryInfo.TRACE_ENABLED && Util.SDK_INT >= 18) {
    beginSectionV18(sectionName);
  }
}
 
开发者ID:XueyanLiu,项目名称:miku,代码行数:11,代码来源:TraceUtil.java

示例7: endSection

import com.google.android.exoplayer.ExoPlayerLibraryInfo; //导入依赖的package包/类
/**
 * Writes a trace message to indicate that a given section of code has ended.
 *
 * @see android.os.Trace#endSection()
 */
public static void endSection() {
  if (ExoPlayerLibraryInfo.TRACE_ENABLED && Util.SDK_INT >= 18) {
    endSectionV18();
  }
}
 
开发者ID:XueyanLiu,项目名称:miku,代码行数:11,代码来源:TraceUtil.java

示例8: checkMainThread

import com.google.android.exoplayer.ExoPlayerLibraryInfo; //导入依赖的package包/类
/**
 * Ensures that the calling thread is the application's main thread.
 *
 * @throws IllegalStateException If the calling thread is not the application's main thread.
 */
public static void checkMainThread() {
  if (ExoPlayerLibraryInfo.ASSERTIONS_ENABLED && Looper.myLooper() != Looper.getMainLooper()) {
    throw new IllegalStateException("Not in applications main thread");
  }
}
 
开发者ID:XueyanLiu,项目名称:miku,代码行数:11,代码来源:Assertions.java

示例9: checkNotNull

import com.google.android.exoplayer.ExoPlayerLibraryInfo; //导入依赖的package包/类
/**
 * Ensures that an object reference is not null.
 *
 * @param reference An object reference.
 * @return The non-null reference that was validated.
 * @throws NullPointerException If {@code reference} is null.
 */
public static <T> T checkNotNull(T reference) {
  if (ExoPlayerLibraryInfo.ASSERTIONS_ENABLED && reference == null) {
    throw new NullPointerException();
  }
  return reference;
}
 
开发者ID:XueyanLiu,项目名称:miku,代码行数:14,代码来源:Assertions.java

示例10: checkNotEmpty

import com.google.android.exoplayer.ExoPlayerLibraryInfo; //导入依赖的package包/类
/**
 * Ensures that a string passed as an argument to the calling method is not null or 0-length.
 *
 * @param string A string.
 * @return The non-null, non-empty string that was validated.
 * @throws IllegalArgumentException If {@code string} is null or 0-length.
 */
public static String checkNotEmpty(String string) {
  if (ExoPlayerLibraryInfo.ASSERTIONS_ENABLED && TextUtils.isEmpty(string)) {
    throw new IllegalArgumentException();
  }
  return string;
}
 
开发者ID:XueyanLiu,项目名称:miku,代码行数:14,代码来源:Assertions.java


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