Closed carstensbix closed 4 months ago
you have to do a join on the _reference field to get the actual mux video data
video
{
...,
"asset": asset->
}
Thank you @droplab for the help!
@carstensbix as Mike pointed out above, you need to expand the video document reference in your Sanity query. You can find an example in our Codesandbox demo:
const query = /* groq */ `*[_type == "trailer"][0]{
title,
"playbackId": video.asset->playbackId
}`
Please refer to References and Joins in Sanity's documentation for more information.
I only get this information returned from my sanity query: (it's an mp4 i uploaded), i am on localhost
video: { _type: 'mux.video', asset: { _ref: '938955fe-0d39-4011-9a70-a7dafb4866d2', _type: 'reference', _weak: true } },
How can i play an video without the playbackId? Can i use the _ref in any way?