Skip to content

Commit

Permalink
Exported the metadata object from NAVFormat to Media.
Browse files Browse the repository at this point in the history
  • Loading branch information
manast committed Jan 29, 2012
1 parent b6d77b4 commit 588bf94
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions lib/navcodec.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@ function open(input, cb){
return;
}
// TODO: this function will be asynchronous in the future.
var inputFormat = new native.NAVFormat(input);

var inputFormat = new native.NAVFormat(input);
var media = new Media(inputFormat, stats.size);

cb(null, media);
Expand Down Expand Up @@ -47,6 +46,9 @@ var Media = function(inputFormat, fileSize){

// Find video and audio streams
for(var i=0,len=streams.length;i<len;i++){
console.log("Stream Metadata");
console.log(streams[i].metadata);

if(streams[i].codec.codec_type === 'Video') {
videoStreams.push(streams[i]);
} else if(streams[i].codec.codec_type === 'Audio') {
Expand All @@ -55,6 +57,7 @@ var Media = function(inputFormat, fileSize){
}

this.inputFormat = inputFormat;
this.metadata = inputFormat.metadata;
this.fileSize = fileSize;
this.videoStreams = videoStreams;
this.audioStreams = audioStreams;
Expand Down

0 comments on commit 588bf94

Please sign in to comment.