*/
private void writeMetadataTag(double duration, Integer videoCodecId, Integer audioCodecId) throws IOException {
metaPosition = channel.position();
IoBuffer buf = IoBuffer.allocate(1024);
buf.setAutoExpand(true);
Output out = new Output(buf);
out.writeString("onMetaData");
Map<Object, Object> params = new HashMap<Object, Object>(4);
params.put("duration", duration);
if (videoCodecId != null) {
params.put("videocodecid", videoCodecId.intValue());
}
if (audioCodecId != null) {
params.put("audiocodecid", audioCodecId.intValue());
}
params.put("canSeekToEnd", true);
out.writeMap(params, new Serializer());
buf.flip();
if (fileMetaSize == 0) {
fileMetaSize = buf.limit();
}