Example usage for android.media MediaDescription getMediaUri

List of usage examples for android.media MediaDescription getMediaUri

Introduction

In this page you can find the example usage for android.media MediaDescription getMediaUri.

Prototype

public @Nullable Uri getMediaUri() 

Source Link

Document

Returns a Uri representing this content or null.

Usage

From source file:org.opensilk.video.data.MediaDescriptionUtil.java

public static Uri getMediaUri(MediaDescription description) {
    if (VersionUtils.hasApi23()) {
        return description.getMediaUri();
    } else {/*from w ww . ja v  a  2 s .com*/
        MediaMetaExtras metaExtras = MediaMetaExtras.from(description);
        return metaExtras.getMediaUri();
    }
}

From source file:org.opensilk.video.data.MediaDescriptionUtil.java

public static MediaDescription.Builder newBuilder(MediaDescription description) {
    MediaDescription.Builder bob = new MediaDescription.Builder().setIconUri(description.getIconUri())
            .setMediaId(description.getMediaId()).setExtras(description.getExtras())
            .setSubtitle(description.getSubtitle()).setTitle(description.getTitle())
            .setDescription(description.getDescription());
    if (VersionUtils.hasApi23()) {
        bob.setMediaUri(description.getMediaUri());
    }/*from w  w  w.j  a va  2s.com*/
    return bob;
}