Skip to content

Instantly share code, notes, and snippets.

@ForceTower
Last active July 31, 2020 11:39
Show Gist options
  • Save ForceTower/c5a9df48c4455ee748b08fc297281947 to your computer and use it in GitHub Desktop.
Save ForceTower/c5a9df48c4455ee748b08fc297281947 to your computer and use it in GitHub Desktop.
package io.flutter.plugins.videoplayer;
import com.google.android.exoplayer2.upstream.DataSource;
import com.google.android.exoplayer2.upstream.crypto.AesCipherDataSource;
public class AESCipherDataSourceFactory implements DataSource.Factory {
private final DataSource source;
private final String secret;
public AESCipherDataSourceFactory(DataSource source, String secret) {
this.source = source;
this.secret = secret;
}
@Override
public DataSource createDataSource() {
return new AesCipherDataSource(secret.getBytes(), this.source);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment