Commit 0ce2ba81 authored by Geoffrey Métais's avatar Geoffrey Métais

TV: Util method to load a media

parent a08f4b1e
......@@ -44,6 +44,17 @@ public class TvUtil {
content.setPadding(hm, vm, hm, vm);
}
public static void playMedia(Activity activity, MediaWrapper media){
if (media.getType() == MediaWrapper.TYPE_AUDIO) {
ArrayList<MediaWrapper> tracks = new ArrayList<>();
tracks.add(media);
Intent intent = new Intent(activity, AudioPlayerActivity.class);
intent.putExtra(AudioPlayerActivity.MEDIA_LIST, tracks);
activity.startActivity(intent);
} else
MediaUtils.openMedia(activity, media);
}
public static void openMedia(Activity activity, Object item , Row row){
if (item instanceof MediaWrapper) {
MediaWrapper mediaWrapper = (MediaWrapper) item;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment