Search in sources :

Example 1 with TxxxFrame

use of com.google.android.exoplayer2.metadata.id3.TxxxFrame in project react-native-video by react-native-community.

the class VideoEventEmitter method timedMetadata.

void timedMetadata(Metadata metadata) {
    WritableArray metadataArray = Arguments.createArray();
    for (int i = 0; i < metadata.length(); i++) {
        Id3Frame frame = (Id3Frame) metadata.get(i);
        String value = "";
        if (frame instanceof TxxxFrame) {
            TxxxFrame txxxFrame = (TxxxFrame) frame;
            value = txxxFrame.value;
        }
        String identifier = frame.id;
        WritableMap map = Arguments.createMap();
        map.putString("identifier", identifier);
        map.putString("value", value);
        metadataArray.pushMap(map);
    }
    WritableMap event = Arguments.createMap();
    event.putArray(EVENT_PROP_TIMED_METADATA, metadataArray);
    receiveEvent(EVENT_TIMED_METADATA, event);
}
Also used : WritableMap(com.facebook.react.bridge.WritableMap) WritableArray(com.facebook.react.bridge.WritableArray) TxxxFrame(com.google.android.exoplayer2.metadata.id3.TxxxFrame) Id3Frame(com.google.android.exoplayer2.metadata.id3.Id3Frame)

Example 2 with TxxxFrame

use of com.google.android.exoplayer2.metadata.id3.TxxxFrame in project LeafPic by HoraApps.

the class PlayerActivity method onId3Metadata.

// DemoPlayer.MetadataListener implementation
@Override
public void onId3Metadata(List<Id3Frame> id3Frames) {
    for (Id3Frame id3Frame : id3Frames) {
        if (id3Frame instanceof TxxxFrame) {
            TxxxFrame txxxFrame = (TxxxFrame) id3Frame;
            Log.i(TAG, String.format("ID3 TimedMetadata %s: description=%s, value=%s", txxxFrame.id, txxxFrame.description, txxxFrame.value));
        } else if (id3Frame instanceof PrivFrame) {
            PrivFrame privFrame = (PrivFrame) id3Frame;
            Log.i(TAG, String.format("ID3 TimedMetadata %s: owner=%s", privFrame.id, privFrame.owner));
        } else if (id3Frame instanceof GeobFrame) {
            GeobFrame geobFrame = (GeobFrame) id3Frame;
            Log.i(TAG, String.format("ID3 TimedMetadata %s: mimeType=%s, filename=%s, description=%s", geobFrame.id, geobFrame.mimeType, geobFrame.filename, geobFrame.description));
        } else {
            Log.i(TAG, String.format("ID3 TimedMetadata %s", id3Frame.id));
        }
    }
}
Also used : GeobFrame(com.google.android.exoplayer.metadata.id3.GeobFrame) TxxxFrame(com.google.android.exoplayer.metadata.id3.TxxxFrame) PrivFrame(com.google.android.exoplayer.metadata.id3.PrivFrame) Id3Frame(com.google.android.exoplayer.metadata.id3.Id3Frame)

Aggregations

WritableArray (com.facebook.react.bridge.WritableArray)1 WritableMap (com.facebook.react.bridge.WritableMap)1 GeobFrame (com.google.android.exoplayer.metadata.id3.GeobFrame)1 Id3Frame (com.google.android.exoplayer.metadata.id3.Id3Frame)1 PrivFrame (com.google.android.exoplayer.metadata.id3.PrivFrame)1 TxxxFrame (com.google.android.exoplayer.metadata.id3.TxxxFrame)1 Id3Frame (com.google.android.exoplayer2.metadata.id3.Id3Frame)1 TxxxFrame (com.google.android.exoplayer2.metadata.id3.TxxxFrame)1