本文整理汇总了Java中com.google.android.exoplayer.ExoPlayerLibraryInfo.VERSION属性的典型用法代码示例。如果您正苦于以下问题:Java ExoPlayerLibraryInfo.VERSION属性的具体用法?Java ExoPlayerLibraryInfo.VERSION怎么用?Java ExoPlayerLibraryInfo.VERSION使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类com.google.android.exoplayer.ExoPlayerLibraryInfo
的用法示例。
在下文中一共展示了ExoPlayerLibraryInfo.VERSION属性的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getUserAgent
/**
* 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;
}
示例2: getUserAgent
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;
}
示例3: getUserAgent
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;
}
示例4: getUserAgent
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;
}
示例5: getUserAgent
/**
* 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;
}