Skip to content

Instantly share code, notes, and snippets.

@mkaflowski
Last active March 22, 2018 14:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mkaflowski/053c015d6aa2f04f496d46ff660a9bde to your computer and use it in GitHub Desktop.
Save mkaflowski/053c015d6aa2f04f496d46ff660a9bde to your computer and use it in GitHub Desktop.
String videoUrl = "https://github.com/mediaelement/mediaelement-files/blob/master/big_buck_bunny.mp4?raw=true";
MediaMetadata movieMetadata = new MediaMetadata(MediaMetadata.MEDIA_TYPE_MOVIE);
movieMetadata.putString(MediaMetadata.KEY_TITLE, "Test Stream");
movieMetadata.putString(MediaMetadata.KEY_ALBUM_ARTIST, "Test Artist");
movieMetadata.addImage(new WebImage(Uri.parse("https://github.com/mkaflowski/HybridMediaPlayer/blob/master/images/cover.jpg?raw=true")));
MediaInfo mediaInfo = new MediaInfo.Builder(videoUrl)
.setStreamType(MediaInfo.STREAM_TYPE_BUFFERED)
.setContentType(MimeTypes.VIDEO_UNKNOWN)
.setMetadata(movieMetadata).build();
//array of media sources
final MediaQueueItem[] mediaItems = {new MediaQueueItem.Builder(mediaInfo).build()};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment