Skip to content

Commit

Permalink
Include codec in MediaFile struct
Browse files Browse the repository at this point in the history
  • Loading branch information
Lunkers committed Feb 14, 2025
1 parent 173cd6c commit 45b87e0
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
1 change: 1 addition & 0 deletions VMAP/structure.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,4 +90,5 @@ type MediaFile struct {
Height int `xml:"height,attr"`
Delivery string `xml:"delivery,attr"`
MediaType string `xml:"type,attr"`
Codec string `xml:"codec,attr"`
}
8 changes: 8 additions & 0 deletions VMAP/structure_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,4 +72,12 @@ func TestUnmarshalVast(t *testing.T) {
is.Equal(len(firstCreative.Linear.TrackingEvents), 5)
is.Equal(firstCreative.Linear.Duration, "00:00:10")
is.Equal(len(firstCreative.Linear.MediaFiles), 1)

mediaFile := firstCreative.Linear.MediaFiles[0]
is.Equal(mediaFile.Width, 718)
is.Equal(mediaFile.Height, 404)
is.Equal(mediaFile.MediaType, "video/mp4")
is.Equal(mediaFile.Delivery, "progressive")
is.Equal(mediaFile.Bitrate, 1300)
is.Equal(mediaFile.Codec, "H.264")
}

0 comments on commit 45b87e0

Please sign in to comment.