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


Java MediaDrmCallback类代码示例

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


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

示例1: getRendererBuilder

import com.google.android.exoplayer.drm.MediaDrmCallback; //导入依赖的package包/类
private VideoPlayer.RendererBuilder getRendererBuilder() {
    String userAgent = Util.getUserAgent(getActivity(), "ExoVideoPlayer");
    Uri contentUri = Uri.parse(mSelectedVideo.videoUrl);
    int contentType = Util.inferContentType(contentUri.getLastPathSegment());

    switch (contentType) {
        case Util.TYPE_OTHER: {
            return new ExtractorRendererBuilder(getActivity(), userAgent, contentUri);
        }
        case Util.TYPE_DASH: {
            // Implement your own DRM callback here.
            MediaDrmCallback drmCallback = new WidevineTestMediaDrmCallback(null, null);
            return new DashRendererBuilder(getActivity(), userAgent, contentUri.toString(),
                    drmCallback);
        }
        case Util.TYPE_HLS: {
            return new HlsRendererBuilder(getActivity(), userAgent, contentUri.toString());
        }


        default: {
            throw new IllegalStateException("Unsupported type: " + contentType);
        }
    }
}
 
开发者ID:nejtv,项目名称:androidtv-sample,代码行数:26,代码来源:PlaybackOverlayFragment.java

示例2: createRendererBuilder

import com.google.android.exoplayer.drm.MediaDrmCallback; //导入依赖的package包/类
/**
 * Create a renderer builder which can build the given video.
 * @param ctx The context (ex {@link android.app.Activity} in whicb the video has been created.
 * @param video The video which will be played.
 * @param mediaDrmCallback DRM Callback.
 * @param preferSoftwareDecoder true if softwareDecoder is requred.
 */
public static ExoplayerWrapper.RendererBuilder createRendererBuilder(Context ctx,
                                                                     Video video,
                                                                     MediaDrmCallback mediaDrmCallback,
                                                                     boolean preferSoftwareDecoder) {
  switch (video.getVideoType()) {
    case HLS:
      return new HlsRendererBuilder(ctx, ExoplayerUtil.getUserAgent(ctx),
                                    video.getUrl());
    case DASH:
      return new DashRendererBuilder(ctx, ExoplayerUtil.getUserAgent(ctx),
                                     video.getUrl(),
                                     mediaDrmCallback);
    case MP4:
      return new ExtractorRendererBuilder(ctx, ExoplayerUtil.getUserAgent(ctx), Uri.parse(video.getUrl()), preferSoftwareDecoder);
    case OTHER:
      return new ExtractorRendererBuilder(ctx, ExoplayerUtil.getUserAgent(ctx), Uri.parse(video.getUrl()), preferSoftwareDecoder);
    default:
      return null;
  }
}
 
开发者ID:kaltura,项目名称:player-sdk-native-android,代码行数:28,代码来源:RendererBuilderFactory.java

示例3: DashRendererBuilder

import com.google.android.exoplayer.drm.MediaDrmCallback; //导入依赖的package包/类
public DashRendererBuilder(Context context, String userAgent, String url,
                           MediaDrmCallback drmCallback) {
    this.context = context;
    this.userAgent = userAgent;
    this.url = url;
    this.drmCallback = drmCallback;
}
 
开发者ID:nejtv,项目名称:androidtv-sample,代码行数:8,代码来源:DashRendererBuilder.java

示例4: AsyncRendererBuilder

import com.google.android.exoplayer.drm.MediaDrmCallback; //导入依赖的package包/类
public AsyncRendererBuilder(Context context, String userAgent, String url,
                            MediaDrmCallback drmCallback, DemoPlayer player) {
    this.context = context;
    this.userAgent = userAgent;
    this.drmCallback = drmCallback;
    this.player = player;
    MediaPresentationDescriptionParser parser = new MediaPresentationDescriptionParser();
    manifestDataSource = new DefaultUriDataSource(context, userAgent);
    manifestFetcher = new ManifestFetcher<>(url, manifestDataSource, parser);
}
 
开发者ID:nejtv,项目名称:androidtv-sample,代码行数:11,代码来源:DashRendererBuilder.java

示例5: SmoothStreamingRendererBuilder

import com.google.android.exoplayer.drm.MediaDrmCallback; //导入依赖的package包/类
public SmoothStreamingRendererBuilder(Context context, String userAgent, String url,
        MediaDrmCallback drmCallback) {
    this.context = context;
    this.userAgent = userAgent;
    this.url = Util.toLowerInvariant(url).endsWith("/manifest") ? url : url + "/Manifest";
    this.drmCallback = drmCallback;
}
 
开发者ID:nejtv,项目名称:androidtv-sample,代码行数:8,代码来源:SmoothStreamingRendererBuilder.java

示例6: AsyncRendererBuilder

import com.google.android.exoplayer.drm.MediaDrmCallback; //导入依赖的package包/类
public AsyncRendererBuilder(Context context, String userAgent, String url,
        MediaDrmCallback drmCallback, DemoPlayer player) {
    this.context = context;
    this.userAgent = userAgent;
    this.drmCallback = drmCallback;
    this.player = player;
    SmoothStreamingManifestParser parser = new SmoothStreamingManifestParser();
    manifestFetcher = new ManifestFetcher<>(url, new DefaultHttpDataSource(userAgent, null),
            parser);
}
 
开发者ID:nejtv,项目名称:androidtv-sample,代码行数:11,代码来源:SmoothStreamingRendererBuilder.java

示例7: AsyncRendererBuilder

import com.google.android.exoplayer.drm.MediaDrmCallback; //导入依赖的package包/类
public AsyncRendererBuilder(Context context, String userAgent, String url,
                            MediaDrmCallback drmCallback, VideoPlayer player) {
    this.context = context;
    this.userAgent = userAgent;
    this.drmCallback = drmCallback;
    this.player = player;
    MediaPresentationDescriptionParser parser = new MediaPresentationDescriptionParser();
    manifestDataSource = new DefaultUriDataSource(context, userAgent);
    manifestFetcher = new ManifestFetcher<>(url, manifestDataSource, parser);
}
 
开发者ID:nejtv,项目名称:androidtv-sample,代码行数:11,代码来源:DashRendererBuilder.java

示例8: DashRendererBuilder

import com.google.android.exoplayer.drm.MediaDrmCallback; //导入依赖的package包/类
public DashRendererBuilder(Context context, String userAgent, String url,
    MediaDrmCallback drmCallback) {
  this.context = context;
  this.userAgent = userAgent;
  this.url = url;
  this.drmCallback = drmCallback;
}
 
开发者ID:Dreamxiaoxuan,项目名称:AndroidTvDemo,代码行数:8,代码来源:DashRendererBuilder.java

示例9: AsyncRendererBuilder

import com.google.android.exoplayer.drm.MediaDrmCallback; //导入依赖的package包/类
public AsyncRendererBuilder(Context context, String userAgent, String url,
    MediaDrmCallback drmCallback, DemoPlayer player) {
  this.context = context;
  this.userAgent = userAgent;
  this.drmCallback = drmCallback;
  this.player = player;
  MediaPresentationDescriptionParser parser = new MediaPresentationDescriptionParser();
  manifestDataSource = new DefaultUriDataSource(context, userAgent);
  manifestFetcher = new ManifestFetcher<>(url, manifestDataSource, parser);
}
 
开发者ID:Dreamxiaoxuan,项目名称:AndroidTvDemo,代码行数:11,代码来源:DashRendererBuilder.java

示例10: SmoothStreamingRendererBuilder

import com.google.android.exoplayer.drm.MediaDrmCallback; //导入依赖的package包/类
public SmoothStreamingRendererBuilder(Context context, String userAgent, String url,
    MediaDrmCallback drmCallback) {
  this.context = context;
  this.userAgent = userAgent;
  this.url = Util.toLowerInvariant(url).endsWith("/manifest") ? url : url + "/Manifest";
  this.drmCallback = drmCallback;
}
 
开发者ID:Dreamxiaoxuan,项目名称:AndroidTvDemo,代码行数:8,代码来源:SmoothStreamingRendererBuilder.java

示例11: AsyncRendererBuilder

import com.google.android.exoplayer.drm.MediaDrmCallback; //导入依赖的package包/类
public AsyncRendererBuilder(Context context, String userAgent, String url,
    MediaDrmCallback drmCallback, DemoPlayer player) {
  this.context = context;
  this.userAgent = userAgent;
  this.drmCallback = drmCallback;
  this.player = player;
  SmoothStreamingManifestParser parser = new SmoothStreamingManifestParser();
  manifestFetcher = new ManifestFetcher<>(url, new DefaultHttpDataSource(userAgent, null),
      parser);
}
 
开发者ID:Dreamxiaoxuan,项目名称:AndroidTvDemo,代码行数:11,代码来源:SmoothStreamingRendererBuilder.java

示例12: AsyncRendererBuilder

import com.google.android.exoplayer.drm.MediaDrmCallback; //导入依赖的package包/类
public AsyncRendererBuilder(Context context, String userAgent, String url,
                            MediaDrmCallback drmCallback, DemoPlayer player) {
  this.context = context;
  this.userAgent = userAgent;
  this.drmCallback = drmCallback;
  this.player = player;
  MediaPresentationDescriptionParser parser = new MediaPresentationDescriptionParser();
  manifestDataSource = new DefaultUriDataSource(context, userAgent);
  manifestFetcher = new ManifestFetcher<>(url, manifestDataSource, parser);
}
 
开发者ID:LGDeveloper,项目名称:FriendsCameraSDK-android,代码行数:11,代码来源:DashRendererBuilder.java

示例13: AsyncRendererBuilder

import com.google.android.exoplayer.drm.MediaDrmCallback; //导入依赖的package包/类
public AsyncRendererBuilder(Context context, String userAgent, String url,
                            MediaDrmCallback drmCallback, DemoPlayer player) {
  this.context = context;
  this.userAgent = userAgent;
  this.drmCallback = drmCallback;
  this.player = player;
  SmoothStreamingManifestParser parser = new SmoothStreamingManifestParser();
  manifestFetcher = new ManifestFetcher<>(url, new DefaultHttpDataSource(userAgent, null),
      parser);
}
 
开发者ID:LGDeveloper,项目名称:FriendsCameraSDK-android,代码行数:11,代码来源:SmoothStreamingRendererBuilder.java

示例14: DashRendererBuilder

import com.google.android.exoplayer.drm.MediaDrmCallback; //导入依赖的package包/类
public DashRendererBuilder(Context context, String userAgent, String url,
                           MediaDrmCallback drmCallback, AudioCapabilities audioCapabilities) {
  this.context = context;
  this.userAgent = userAgent;
  this.url = url;
  this.drmCallback = drmCallback;
  this.audioCapabilities = audioCapabilities;
}
 
开发者ID:XueyanLiu,项目名称:miku,代码行数:9,代码来源:DashRendererBuilder.java

示例15: AsyncRendererBuilder

import com.google.android.exoplayer.drm.MediaDrmCallback; //导入依赖的package包/类
public AsyncRendererBuilder(Context context, String userAgent, String url,
                            MediaDrmCallback drmCallback, AudioCapabilities audioCapabilities, MediaPlayer player) {
  this.context = context;
  this.userAgent = userAgent;
  this.drmCallback = drmCallback;
  this.audioCapabilities = audioCapabilities;
  this.player = player;
  MediaPresentationDescriptionParser parser = new MediaPresentationDescriptionParser();
  manifestDataSource = new DefaultUriDataSource(context, userAgent);
  manifestFetcher = new ManifestFetcher<>(url, manifestDataSource, parser);
}
 
开发者ID:XueyanLiu,项目名称:miku,代码行数:12,代码来源:DashRendererBuilder.java


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