Adding Shopify CDN media to products

I have created both mp4 and mov media in the Shopify CDN:

&

Both cdn media link urls appear to be valid when accessed via a browser.

In either case, if I try use the productCreate mutation with mediaContentType = “VIDEO”, I fail with the originalSource = cdn url
Ex:
“data”:{“productCreate”:{“product”:null,“userErrors”:[{“field”:[“media”,“1”,“originalSource”],“message”:“Invalid video
url={failed url}”,

Is there any guidance on how to use CreateMediaInput in mutation productCreate for VIDEO media?

Thanks, all!

Do you have an example of what your mutation looks like? And variables for the media part? Please :pray:

Please follow the documentation:

AMal,
Thanks once again for your help.
I tried to take a shortcut and derive the originalSource URL from an existing product in the CDN. Tne Manage Media documentation shows that I obviously need to dig deeper to obtain the resourceUrl value returned by the stagedUploadsCreate mutation. (Since the media had been uploaded in the past, I’ll need to think about how to obtain this parameter.)
Thanks again for pointing me in the right direction. Happy New Year!
Tom

Jordan,
Thanks for your quick reply.
The reply below from AMal indicates that my shortcut to derive the originalSource URL from an existing product in the CDN is incorrect. Tne Manage Media documentation shows that I obviously need to dig deeper to obtain the resourceUrl value returned by the stagedUploadsCreate mutation. If I correct this originalSource parameter, then all will be well. More work ahead.
Thanks again for your quick reply and have a Happy New Year!
Tom

1 Like

You’re very welcome! I’m glad I could help. Wishing you a Happy New Year as well! Here’s to a fantastic year ahead!

1 Like