XHTMLContentHandler xhtml = new XHTMLContentHandler(handler, metadata);
xhtml.startDocument();
// Pull out some information from the header box
MovieHeaderBox mHeader = getOrNull(moov, MovieHeaderBox.class);
if (mHeader != null) {
// Get the creation and modification dates
metadata.set(
Metadata.CREATION_DATE,
MP4TimeToDate(mHeader.getCreationTime())
);
metadata.set(
Property.externalDate(Metadata.MODIFIED), // TODO Should be a real property
MP4TimeToDate(mHeader.getModificationTime())
);
// Get the duration
double durationSeconds = ((double)mHeader.getDuration()) / mHeader.getTimescale();
// TODO Use this
// The timescale is normally the sampling rate
metadata.set(XMPDM.AUDIO_SAMPLE_RATE, (int)mHeader.getTimescale());
}
// Get some more information from the track header
// TODO Decide how to handle multiple tracks