Liquid, JavaScript, Themes
Hi folks,
When loading meta objects for a video (webm or mp4), my Hydrogen app is having problems.
“Content-Security-Policy: The page's settings blocked the loading of a resource (media-src) at gid://shopify/Video/....”
Please see attached my current config. For a 3D-Model file, I could make it running by coping the full url string to the cdn... but for the videos it's not working.
Any idea how I can handle this?
const { nonce, header, NonceProvider } = createContentSecurityPolicy({
fontSrc: ['https://fonts.gstatic.com', 'data:'],
styleSrc: ['fonts.googleapis.com', ...localDirectives],
connectSrc: [
//"'self'",
'https://monorail-edge.shopifysvc.com',
'http://localhost:*',
'ws://localhost:*',
'ws://127.0.0.1:*',
'ws://*.tryhydrogen.dev:*',
'https://cdn.shopify.com',
'blob:',
'https://cdn.shopify.com*',
'https://cdn.shopify.com/videos/c/o/v/12345.webm',
],
mediaSrc: [
"'self'",
'https://cdn.shopify.com',
'https://cdn.shopify.com/videos/c/o/v/12345.webm',
],
OK I pulled the ID instead of the URL from the CDN.
Nevertheless. unfortunately shopify is not providing webP files. They converting them to mp4....
metaobjects(first: 50, type: "hero_banner") {
nodes {
headerText: field(key: "header_text") {
value
}
image: field(key: "image") {
reference {
... on MediaImage {
image {
url
altText
height
width
}
}
}
}
videoMp4: field(key: "video_mp_4") {
reference {
... on Video {
alt
sources {
url
mimeType
format
}
}
}
}
Teil 2 - Wie die Prinzipien des UX-Designs dir dabei helfen können einen großartigen Shop ...
By Kai Sep 16, 2024Teil 1 - Wie die Prinzipien des UX-Designs dir dabei helfen können einen großartigen Shop ...
By Kai Sep 9, 2024Anpassungen des benutzerdefinierten Codes an Shopify-Themes (CSS) leicht gemachtIn diesem...
By Gabe Aug 28, 2024