Java Code Examples for com.google.android.exoplayer2.SimpleExoPlayer#setVideoSurface()

The following examples show how to use com.google.android.exoplayer2.SimpleExoPlayer#setVideoSurface() . 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: GLES20WallpaperRenderer.java    From alynx-live-wallpaper with Apache License 2.0 5 votes vote down vote up
@Override
void setSourcePlayer(@NonNull final SimpleExoPlayer exoPlayer) {
    // Re-create SurfaceTexture when getting a new player.
    // Because maybe a new video is loaded.
    createSurfaceTexture();
    exoPlayer.setVideoSurface(new Surface(surfaceTexture));
}
 
Example 2
Source File: GLES30WallpaperRenderer.java    From alynx-live-wallpaper with Apache License 2.0 5 votes vote down vote up
@Override
void setSourcePlayer(@NonNull final SimpleExoPlayer exoPlayer) {
    // Re-create SurfaceTexture when getting a new player.
    // Because maybe a new video is loaded.
    createSurfaceTexture();
    exoPlayer.setVideoSurface(new Surface(surfaceTexture));
}
 
Example 3
Source File: ExoHostedTest.java    From ExoPlayer-Offline with Apache License 2.0 5 votes vote down vote up
@SuppressWarnings("unused")
protected SimpleExoPlayer buildExoPlayer(HostActivity host, Surface surface,
    MappingTrackSelector trackSelector,
    DrmSessionManager<FrameworkMediaCrypto> drmSessionManager) {
  SimpleExoPlayer player = ExoPlayerFactory.newSimpleInstance(host, trackSelector,
      new DefaultLoadControl(), drmSessionManager, SimpleExoPlayer.EXTENSION_RENDERER_MODE_OFF,
      0);
  player.setVideoSurface(surface);
  return player;
}
 
Example 4
Source File: DashTest.java    From ExoPlayer-Offline with Apache License 2.0 5 votes vote down vote up
@Override
protected SimpleExoPlayer buildExoPlayer(HostActivity host, Surface surface,
    MappingTrackSelector trackSelector,
    DrmSessionManager<FrameworkMediaCrypto> drmSessionManager) {
  SimpleExoPlayer player = new DebugSimpleExoPlayer(host, trackSelector,
      new DefaultLoadControl(), drmSessionManager);
  player.setVideoSurface(surface);
  return player;
}