本文整理了Java中com.google.android.exoplayer.util.Util.getUserAgent()
方法的一些代码示例,展示了Util.getUserAgent()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Util.getUserAgent()
方法的具体详情如下:
包路径:com.google.android.exoplayer.util.Util
类名称:Util
方法名:getUserAgent
[英]Returns a user agent string based on the given application name and the library version.
[中]基于给定的应用程序名称和库版本返回用户代理字符串。
代码示例来源:origin: Dreamxiaoxuan/AndroidTvDemo
private String getUserAgent() {
return Util.getUserAgent(mAppContext, "IjkExoMediaPlayer");
}
代码示例来源:origin: wanliyang1990/WliveTV
private String getUserAgent() {
return Util.getUserAgent(mAppContext, "IjkExoMediaPlayer");
}
代码示例来源:origin: Dawish/ijkplayer-android-demo
private String getUserAgent() {
return Util.getUserAgent(mAppContext, "IjkExoMediaPlayer");
}
代码示例来源:origin: Dawish/BriskTVLauncher
private String getUserAgent() {
return Util.getUserAgent(mAppContext, "IjkExoMediaPlayer");
}
代码示例来源:origin: karanvs/ExVidPlayer
private RendererBuilder getHpLibRendererBuilder() {
String userAgent = Util.getUserAgent(activity, "HpLib");
switch (video_type.get(currentTrackIndex)) {
case "hls":
return new HlsRendererBuilder(activity, userAgent, video_url.get(currentTrackIndex));
case "others":
return new ExtractorRendererBuilder(activity, userAgent,
Uri.parse(video_url.get(currentTrackIndex)));
default:
throw new IllegalStateException("Unsupported type: " + video_url.get(currentTrackIndex));
}
}
代码示例来源:origin: bitmovin/bitcodin-android-demo
private DemoPlayer.RendererBuilder getRendererBuilder() {
String userAgent = Util.getUserAgent(this, "ExoPlayerDemo");
switch (this.contentType) {
case TYPE_DASH:
return new com.bitmovin.bitcodin.Player.DashRendererBuilder(
this,
userAgent,
this.contentUri.toString(),
new WidevineTestMediaDrmCallback()
);
case TYPE_HLS:
return new com.bitmovin.bitcodin.Player.HlsRendererBuilder(
this,
userAgent,
this.contentUri.toString()
);
default:
throw new IllegalStateException("Unsupported type: " + this.contentType);
}
}
代码示例来源:origin: fire3/sailorcast
private RendererBuilder getRendererBuilder() {
String userAgent = Util.getUserAgent(this, "ExoPlayerDemo");
switch (contentType) {
case Util.TYPE_SS:
return new SmoothStreamingRendererBuilder(this, userAgent, contentUri.toString(),
new SmoothStreamingTestMediaDrmCallback());
case Util.TYPE_DASH:
return new DashRendererBuilder(this, userAgent, contentUri.toString(),
new WidevineTestMediaDrmCallback(contentId, provider));
case Util.TYPE_HLS:
return new HlsRendererBuilder(this, userAgent, contentUri.toString());
case Util.TYPE_OTHER:
return new ExtractorRendererBuilder(this, userAgent, contentUri);
default:
throw new IllegalStateException("Unsupported type: " + contentType);
}
}
代码示例来源:origin: googlesamples/androidtv-sample-inputs
String userAgent = Util.getUserAgent(context, "ExoVideoPlayer");
代码示例来源:origin: anyaudio/anyaudio-android-app
String userAgent = Util.getUserAgent(context, "AnyAudio");
DataSource dataSource = new DefaultUriDataSource(context, null, userAgent);
代码示例来源:origin: anyaudio/anyaudio-android-app
anyPlayer = ExoPlayer.Factory.newInstance(1);
Allocator allocator = new DefaultAllocator(BUFFER_SEGMENT_SIZE);
String userAgent = Util.getUserAgent(this, "AnyAudio");
DataSource dataSource = new DefaultUriDataSource(this, null, userAgent);
内容来源于网络,如有侵权,请联系作者删除!