Skip to content

Instantly share code, notes, and snippets.

@isaidamier
Last active September 8, 2017 23:30
Show Gist options
  • Save isaidamier/d44b49fa9f38edd0c74d209eb9089126 to your computer and use it in GitHub Desktop.
Save isaidamier/d44b49fa9f38edd0c74d209eb9089126 to your computer and use it in GitHub Desktop.
DataSource.Factory dataSourceFactory = new DefaultDataSourceFactory(
this,
Util.getUserAgent(this, APP_NAME),
(DefaultBandwidthMeter) bandwidthMeter);//note the type casting
ExtractorsFactory extractorsFactory = new DefaultExtractorsFactory();
//normally we would have this in string.xml or such instead of hardcoding
String waterUrl="https://storage.googleapis.com/android-tv/Sample%20videos/" +
"Google%2B/Google%2B_%20Instant%20Upload.mp4"
MediaSource videoSource = new ExtractorMediaSource(
Uri.parse(waterUrl),
dataSourceFactory,
extractorsFactory,
null, null
);
player.prepare(videoSource);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment