com.google.android.exoplayer.util.Util.getUserAgent()方法的使用及代码示例

x33g5p2x  于2022-02-01 转载在 其他  
字(3.2k)|赞(0)|评价(0)|浏览(224)

本文整理了Java中com.google.android.exoplayer.util.Util.getUserAgent()方法的一些代码示例,展示了Util.getUserAgent()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Util.getUserAgent()方法的具体详情如下:
包路径:com.google.android.exoplayer.util.Util
类名称:Util
方法名:getUserAgent

Util.getUserAgent介绍

[英]Returns a user agent string based on the given application name and the library version.
[中]基于给定的应用程序名称和库版本返回用户代理字符串。

代码示例

代码示例来源:origin: Dreamxiaoxuan/AndroidTvDemo

  1. private String getUserAgent() {
  2. return Util.getUserAgent(mAppContext, "IjkExoMediaPlayer");
  3. }

代码示例来源:origin: wanliyang1990/WliveTV

  1. private String getUserAgent() {
  2. return Util.getUserAgent(mAppContext, "IjkExoMediaPlayer");
  3. }

代码示例来源:origin: Dawish/ijkplayer-android-demo

  1. private String getUserAgent() {
  2. return Util.getUserAgent(mAppContext, "IjkExoMediaPlayer");
  3. }

代码示例来源:origin: Dawish/BriskTVLauncher

  1. private String getUserAgent() {
  2. return Util.getUserAgent(mAppContext, "IjkExoMediaPlayer");
  3. }

代码示例来源:origin: karanvs/ExVidPlayer

  1. private RendererBuilder getHpLibRendererBuilder() {
  2. String userAgent = Util.getUserAgent(activity, "HpLib");
  3. switch (video_type.get(currentTrackIndex)) {
  4. case "hls":
  5. return new HlsRendererBuilder(activity, userAgent, video_url.get(currentTrackIndex));
  6. case "others":
  7. return new ExtractorRendererBuilder(activity, userAgent,
  8. Uri.parse(video_url.get(currentTrackIndex)));
  9. default:
  10. throw new IllegalStateException("Unsupported type: " + video_url.get(currentTrackIndex));
  11. }
  12. }

代码示例来源:origin: bitmovin/bitcodin-android-demo

  1. private DemoPlayer.RendererBuilder getRendererBuilder() {
  2. String userAgent = Util.getUserAgent(this, "ExoPlayerDemo");
  3. switch (this.contentType) {
  4. case TYPE_DASH:
  5. return new com.bitmovin.bitcodin.Player.DashRendererBuilder(
  6. this,
  7. userAgent,
  8. this.contentUri.toString(),
  9. new WidevineTestMediaDrmCallback()
  10. );
  11. case TYPE_HLS:
  12. return new com.bitmovin.bitcodin.Player.HlsRendererBuilder(
  13. this,
  14. userAgent,
  15. this.contentUri.toString()
  16. );
  17. default:
  18. throw new IllegalStateException("Unsupported type: " + this.contentType);
  19. }
  20. }

代码示例来源:origin: fire3/sailorcast

  1. private RendererBuilder getRendererBuilder() {
  2. String userAgent = Util.getUserAgent(this, "ExoPlayerDemo");
  3. switch (contentType) {
  4. case Util.TYPE_SS:
  5. return new SmoothStreamingRendererBuilder(this, userAgent, contentUri.toString(),
  6. new SmoothStreamingTestMediaDrmCallback());
  7. case Util.TYPE_DASH:
  8. return new DashRendererBuilder(this, userAgent, contentUri.toString(),
  9. new WidevineTestMediaDrmCallback(contentId, provider));
  10. case Util.TYPE_HLS:
  11. return new HlsRendererBuilder(this, userAgent, contentUri.toString());
  12. case Util.TYPE_OTHER:
  13. return new ExtractorRendererBuilder(this, userAgent, contentUri);
  14. default:
  15. throw new IllegalStateException("Unsupported type: " + contentType);
  16. }
  17. }

代码示例来源:origin: googlesamples/androidtv-sample-inputs

  1. String userAgent = Util.getUserAgent(context, "ExoVideoPlayer");

代码示例来源:origin: anyaudio/anyaudio-android-app

  1. String userAgent = Util.getUserAgent(context, "AnyAudio");
  2. DataSource dataSource = new DefaultUriDataSource(context, null, userAgent);

代码示例来源:origin: anyaudio/anyaudio-android-app

  1. anyPlayer = ExoPlayer.Factory.newInstance(1);
  2. Allocator allocator = new DefaultAllocator(BUFFER_SEGMENT_SIZE);
  3. String userAgent = Util.getUserAgent(this, "AnyAudio");
  4. DataSource dataSource = new DefaultUriDataSource(this, null, userAgent);

相关文章