Java Code Examples for com.google.android.exoplayer.util.Util#getUserAgent()

The following examples show how to use com.google.android.exoplayer.util.Util#getUserAgent() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: IjkExoMediaPlayer.java    From ShareBox with Apache License 2.0 6 votes vote down vote up
private RendererBuilder getRendererBuilder() {
    Uri contentUri = Uri.parse(mDataSource);
    String userAgent = Util.getUserAgent(mAppContext, "IjkExoMediaPlayer");
    int contentType = inferContentType(contentUri);
    switch (contentType) {
        case Util.TYPE_SS:
            return new SmoothStreamingRendererBuilder(mAppContext, userAgent, contentUri.toString(),
                    new SmoothStreamingTestMediaDrmCallback());
     /*   case Util.TYPE_DASH:
            return new DashRendererBuilder(mAppContext , userAgent, contentUri.toString(),
                    new WidevineTestMediaDrmCallback(contentId, provider));*/
        case Util.TYPE_HLS:
            return new HlsRendererBuilder(mAppContext, userAgent, contentUri.toString());
        case Util.TYPE_OTHER:
        default:
            return new ExtractorRendererBuilder(mAppContext, userAgent, contentUri);
    }
}
 
Example 2
Source File: VideoPlayerActivity.java    From droidkaigi2016 with Apache License 2.0 6 votes vote down vote up
private DemoPlayer.RendererBuilder getRendererBuilder() {
    String userAgent = Util.getUserAgent(this, "ExoPlayerDemo");
    switch (contentType) {
        case Util.TYPE_DASH:
            return new DashRendererBuilder(this, userAgent, contentUri.toString());
        default:
            throw new IllegalStateException("Unsupported type: " + contentType);
    }
}
 
Example 3
Source File: ExVidPlayerImp.java    From ExVidPlayer with Apache License 2.0 5 votes vote down vote up
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));
  }
}
 
Example 4
Source File: VideoPlayerActivity.java    From droidkaigi2016 with Apache License 2.0 5 votes vote down vote up
private DemoPlayer.RendererBuilder getRendererBuilder() {
    String userAgent = Util.getUserAgent(this, "ExoPlayerDemo");
    switch (contentType) {
        case Util.TYPE_DASH:
            return new DashRendererBuilder(this, userAgent, contentUri.toString());
        default:
            throw new IllegalStateException("Unsupported type: " + contentType);
    }
}
 
Example 5
Source File: IjkExoMediaPlayer.java    From AndroidTvDemo with Apache License 2.0 4 votes vote down vote up
private String getUserAgent() {
    return Util.getUserAgent(mAppContext, "IjkExoMediaPlayer");
}
 
Example 6
Source File: IjkExoMediaPlayer.java    From talk-android with MIT License 4 votes vote down vote up
private String getUserAgent() {
    return Util.getUserAgent(mAppContext, "IjkExoMediaPlayer");
}
 
Example 7
Source File: IjkExoMediaPlayer.java    From WliveTV with Apache License 2.0 4 votes vote down vote up
private String getUserAgent() {
    return Util.getUserAgent(mAppContext, "IjkExoMediaPlayer");
}
 
Example 8
Source File: PlayerActivity.java    From Android-Example-HLS-ExoPlayer with Apache License 2.0 4 votes vote down vote up
private DemoPlayer.RendererBuilder getRendererBuilder() {
    String userAgent = Util.getUserAgent(this, "ExoPlayerDemo");
    return new HlsRendererBuilder(this, userAgent, contentUri.toString());
}
 
Example 9
Source File: VideoPlayerActivity.java    From iview-android-tv with MIT License 4 votes vote down vote up
private VideoPlayer.RendererBuilder getRendererBuilder() {
    String userAgent = Util.getUserAgent(this, getString(R.string.app_name));
    return new HlsRendererBuilder(this, userAgent, contentUri.toString(), audioCapabilities);
}