congrats Icon
New! Announcing our next generation AI code completions
Read here
Tabnine Logo
SessionId.asBytes
Code IndexAdd Tabnine to your IDE (free)

How to use
asBytes
method
in
com.novoda.noplayer.internal.exoplayer.drm.SessionId

Best Java code snippets using com.novoda.noplayer.internal.exoplayer.drm.SessionId.asBytes (Showing top 6 results out of 315)

origin: novoda/no-player

  @Override
  public void releaseSession(DrmSession<FrameworkMediaCrypto> drmSession) {
    FrameworkDrmSession frameworkDrmSession = (FrameworkDrmSession) drmSession;
    SessionId sessionId = frameworkDrmSession.getSessionId();
    mediaDrm.closeSession(sessionId.asBytes());
  }
}
origin: novoda/no-player

@SuppressWarnings("PMD.AvoidCatchingGenericException") // We are forced to catch Exception as ResourceBusyException is minSdk 19
@TargetApi(Build.VERSION_CODES.JELLY_BEAN_MR2)
@Override
public DrmSession<FrameworkMediaCrypto> acquireSession(Looper playbackLooper, DrmInitData drmInitData) {
  DrmSession<FrameworkMediaCrypto> drmSession;
  try {
    SessionId sessionId = SessionId.of(mediaDrm.openSession());
    FrameworkMediaCrypto mediaCrypto = mediaDrm.createMediaCrypto(sessionId.asBytes());
    mediaDrm.restoreKeys(sessionId.asBytes(), keySetIdToRestore.asBytes());
    drmSession = new LocalDrmSession(mediaCrypto, keySetIdToRestore, sessionId);
  } catch (Exception exception) {
    drmSession = new InvalidDrmSession(new DrmSession.DrmSessionException(exception));
    notifyErrorListener(drmSession);
  }
  return drmSession;
}
origin: novoda/no-player

  @Test
  public void givenAcquiredSession_whenReleasingSession_thenClosesCurrentSession() {
    DrmSession<FrameworkMediaCrypto> drmSession = new LocalDrmSession(frameworkMediaCrypto, KEY_SET_ID_TO_RESTORE, SESSION_ID);

    localDrmSessionManager.releaseSession(drmSession);

    verify(mediaDrm).closeSession(SESSION_ID.asBytes());
  }
}
origin: novoda/no-player

@Test
public void givenValidMediaDrm_whenAcquiringSession_thenRestoresKeys() throws MediaCryptoException {
  given(mediaDrm.createMediaCrypto(SESSION_ID.asBytes())).willReturn(frameworkMediaCrypto);
  localDrmSessionManager.acquireSession(IGNORED_LOOPER, IGNORED_DRM_DATA);
  verify(mediaDrm).restoreKeys(SESSION_ID.asBytes(), KEY_SET_ID_TO_RESTORE.asBytes());
}
origin: novoda/no-player

@Before
public void setUp() throws MediaDrmException, MediaCryptoException {
  frameworkMediaCrypto = FrameworkMediaCryptoFixture.aFrameworkMediaCrypto().build();
  given(mediaDrm.openSession()).willReturn(SESSION_ID.asBytes());
  localDrmSessionManager = new LocalDrmSessionManager(
      KEY_SET_ID_TO_RESTORE,
      mediaDrm,
      DRM_SCHEME,
      handler,
      eventListener
  );
}
origin: novoda/no-player

@Test
public void givenValidMediaDrm_whenAcquiringSession_thenReturnsLocalDrmSession() throws MediaCryptoException {
  given(mediaDrm.createMediaCrypto(SESSION_ID.asBytes())).willReturn(frameworkMediaCrypto);
  DrmSession<FrameworkMediaCrypto> drmSession = localDrmSessionManager.acquireSession(IGNORED_LOOPER, IGNORED_DRM_DATA);
  LocalDrmSession localDrmSession = new LocalDrmSession(frameworkMediaCrypto, KEY_SET_ID_TO_RESTORE, SESSION_ID);
  assertThat(drmSession).isEqualTo(localDrmSession);
}
com.novoda.noplayer.internal.exoplayer.drmSessionIdasBytes

Popular methods of SessionId

  • <init>
  • absent
  • equals
  • hashCode
  • of

Popular in Java

  • Running tasks concurrently on multiple threads
  • runOnUiThread (Activity)
  • setRequestProperty (URLConnection)
  • findViewById (Activity)
  • PrintStream (java.io)
    Fake signature of an existing Java class.
  • Iterator (java.util)
    An iterator over a sequence of objects, such as a collection.If a collection has been changed since
  • SortedMap (java.util)
    A map that has its keys ordered. The sorting is according to either the natural ordering of its keys
  • Timer (java.util)
    Timers schedule one-shot or recurring TimerTask for execution. Prefer java.util.concurrent.Scheduled
  • UUID (java.util)
    UUID is an immutable representation of a 128-bit universally unique identifier (UUID). There are mul
  • Location (org.springframework.beans.factory.parsing)
    Class that models an arbitrary location in a Resource.Typically used to track the location of proble
  • Top 17 Free Sublime Text Plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyStudentsTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now