Skip to content

Commit e137088

Browse files
committed
feat: add width, height and aspect ratio to video nodes
1 parent 53909a2 commit e137088

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

packages/gatsby-transformer-video/src/gatsby-node.js

+5
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,8 @@ exports.createResolvers = async (
165165
bit_rate: bitRate,
166166
} = result.format
167167

168+
const { width, height } = result.streams[0]
169+
168170
const path = publicPath.replace(resolve(rootDir, `public`), ``)
169171

170172
const { name, ext } = parse(publicPath)
@@ -180,6 +182,9 @@ exports.createResolvers = async (
180182
duration: duration === `N/A` ? null : duration,
181183
size: size === `N/A` ? null : size,
182184
bitRate: bitRate === `N/A` ? null : bitRate,
185+
width,
186+
height,
187+
aspectRatio: width / height,
183188
}
184189
}
185190

0 commit comments

Comments
 (0)