/** * Sets {@link PlayerBuilder} to build a {@link NoPlayer} which supports Widevine modular download DRM. * * @param downloadedModularDrm Implementation of {@link DownloadedModularDrm}. * @return {@link PlayerBuilder} * @see NoPlayer */ public PlayerBuilder withWidevineModularDownloadDrm(DownloadedModularDrm downloadedModularDrm) { return withDrm(DrmType.WIDEVINE_MODULAR_DOWNLOAD, downloadedModularDrm); }
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); NoPlayerLog.setLoggingEnabled(true); setContentView(R.layout.activity_main); PlayerView playerView = findViewById(R.id.player_view); View videoSelectionButton = findViewById(R.id.button_video_selection); View audioSelectionButton = findViewById(R.id.button_audio_selection); View subtitleSelectionButton = findViewById(R.id.button_subtitle_selection); ControllerView controllerView = findViewById(R.id.controller_view); videoSelectionButton.setOnClickListener(showVideoSelectionDialog); audioSelectionButton.setOnClickListener(showAudioSelectionDialog); subtitleSelectionButton.setOnClickListener(showSubtitleSelectionDialog); DataPostingModularDrm drmHandler = new DataPostingModularDrm(EXAMPLE_MODULAR_LICENSE_SERVER_PROXY); player = new PlayerBuilder() .withWidevineModularStreamingDrm(drmHandler) .withDowngradedSecureDecoder() .build(this); demoPresenter = new DemoPresenter(controllerView, player, player.getListeners(), playerView); dialogCreator = new DialogCreator(this, player); player.getListeners().addDroppedVideoFrames(new NoPlayer.DroppedVideoFramesListener() { @Override public void onDroppedVideoFrames(int droppedFrames, long elapsedMsSinceLastDroppedFrames) { Log.v(getClass().toString(), "dropped frames: " + droppedFrames + " since: " + elapsedMsSinceLastDroppedFrames + "ms"); } }); }
/** * Sets {@link PlayerBuilder} to build a {@link NoPlayer} which supports Widevine classic DRM. * * @return {@link PlayerBuilder} * @see NoPlayer */ public PlayerBuilder withWidevineClassicDrm() { return withDrm(DrmType.WIDEVINE_CLASSIC, DrmHandler.NO_DRM); }
/** * Sets {@link PlayerBuilder} to build a {@link NoPlayer} which supports Widevine modular streaming DRM. * * @param streamingModularDrm Implementation of {@link StreamingModularDrm}. * @return {@link PlayerBuilder} * @see NoPlayer */ public PlayerBuilder withWidevineModularStreamingDrm(StreamingModularDrm streamingModularDrm) { return withDrm(DrmType.WIDEVINE_MODULAR_STREAM, streamingModularDrm); }