use of com.sonos.services._1.MediaMetadata in project Signal-Android by signalapp.
the class VoiceNotePlaybackPreparer method indexAfter.
private int indexAfter(@NonNull MediaItem target) {
int size = player.getMediaItemCount();
long targetMessageId = target.mediaMetadata.extras.getLong(VoiceNoteMediaItemFactory.EXTRA_MESSAGE_ID);
for (int i = 0; i < size; i++) {
MediaMetadata mediaMetadata = player.getMediaItemAt(i).mediaMetadata;
long messageId = mediaMetadata.extras.getLong(VoiceNoteMediaItemFactory.EXTRA_MESSAGE_ID);
if (messageId > targetMessageId) {
return i;
}
}
return size;
}
use of com.sonos.services._1.MediaMetadata in project mollyim-android by mollyim.
the class VoiceNotePlaybackPreparer method indexAfter.
private int indexAfter(@NonNull MediaItem target) {
int size = player.getMediaItemCount();
long targetMessageId = target.mediaMetadata.extras.getLong(VoiceNoteMediaItemFactory.EXTRA_MESSAGE_ID);
for (int i = 0; i < size; i++) {
MediaMetadata mediaMetadata = player.getMediaItemAt(i).mediaMetadata;
long messageId = mediaMetadata.extras.getLong(VoiceNoteMediaItemFactory.EXTRA_MESSAGE_ID);
if (messageId > targetMessageId) {
return i;
}
}
return size;
}
use of com.sonos.services._1.MediaMetadata in project SonosOneDriveServer by bertique.
the class SonosService method buildMMD.
private static MediaMetadata buildMMD(Item m) {
MediaMetadata mmd = new MediaMetadata();
TrackMetadata tmd = new TrackMetadata();
if (m == null)
return null;
mmd.setId(m.getId());
if (m.getType().equals(Item.FileType.file) && m.getName().endsWith(".flac")) {
mmd.setMimeType("audio/flac");
} else if (m.getMimeType().endsWith("wma")) {
mmd.setMimeType("audio/wma");
} else {
mmd.setMimeType(m.getMimeType());
}
mmd.setItemType(ItemType.TRACK);
mmd.setDisplayType("audio");
if (m.getTitle() != null && !m.getTitle().isEmpty()) {
mmd.setTitle(m.getTitle());
} else {
mmd.setTitle(m.getName());
}
if (m.getArtist() != null) {
tmd.setArtist(m.getArtist());
}
if (m.getAlbum() != null) {
tmd.setAlbum(m.getAlbum());
}
if (m.getDuration() > 0) {
tmd.setDuration(m.getDuration());
}
if (m.getThumbnail() != null) {
AlbumArtUrl art = new AlbumArtUrl();
art.setValue(m.getThumbnail());
tmd.setAlbumArtURI(art);
}
tmd.setTrackNumber(m.getTrack());
mmd.setTrackMetadata(tmd);
return mmd;
}
use of com.sonos.services._1.MediaMetadata in project ExoPlayer by google.
the class PictureFrameTest method populateMediaMetadata_setsBuilderValues.
@Test
public void populateMediaMetadata_setsBuilderValues() {
byte[] pictureData = new byte[] { -12, 52, 33, 85, 34, 22, 1, -55 };
Metadata.Entry entry = new PictureFrame(/* pictureType= */
MediaMetadata.PICTURE_TYPE_FRONT_COVER, /* mimeType= */
MimeTypes.IMAGE_JPEG, /* description= */
"an image", /* width= */
4, /* height= */
2, /* depth= */
1, /* colors= */
1, pictureData);
MediaMetadata.Builder builder = MediaMetadata.EMPTY.buildUpon();
entry.populateMediaMetadata(builder);
MediaMetadata mediaMetadata = builder.build();
assertThat(mediaMetadata.artworkData).isEqualTo(pictureData);
assertThat(mediaMetadata.artworkDataType).isEqualTo(MediaMetadata.PICTURE_TYPE_FRONT_COVER);
}
use of com.sonos.services._1.MediaMetadata in project ExoPlayer by google.
the class IcyHeadersTest method populateMediaMetadata.
@Test
public void populateMediaMetadata() {
IcyHeaders headers = new IcyHeaders(/* bitrate= */
1234, /* genre= */
"pop", /* name= */
"radio station", /* url= */
"url", /* isPublic= */
true, /* metadataInterval= */
5678);
MediaMetadata.Builder builder = new MediaMetadata.Builder();
headers.populateMediaMetadata(builder);
MediaMetadata mediaMetadata = builder.build();
assertThat(mediaMetadata.station.toString()).isEqualTo("radio station");
assertThat(mediaMetadata.genre.toString()).isEqualTo("pop");
}
Aggregations