We’re Still Here to Help (Even Over the Holidays!) - find out more here.
Forum Discussion
lisarosado
3 years agoExplorer | Level 3
Embedded iframe link to video doesn't work for some videos.
in chrome the console error is: Refused to frame 'https://www.dropbox.com/' because an ancestor violates the following Content Security Policy directive: "frame-ancestors 'self'". in firefox ...
Greg-DB
Dropbox Community Moderator
3 years agoBased on the error message, it looks like this may be because your site that displays the Embedder is itself being framed by a different site.
Do you have a sample page showing this issue that you can share so we can take a look into this for you?
lisarosado
3 years agoExplorer | Level 3
Hmm that wouldn't make sense if some videos are working and others are not. I do not have a publicly accessible version of this page to show you unfortunately. I'm not sure how this "Based on the error message, it looks like this may be because your site that displays the Embedder is itself being framed by a different site." would be possible. It's a react app and I am including it like so
```<iframe
frameBorder={0}
src={`${video}?raw=1&autoplay=1`}
height="480px"
width="640px"
title="Resource Video"
allowFullScreen
/>```
the video link is the same link you would use to share it, however I strip out the query args from that share url. So the url ends up being the share url minus the original ?dl=0 or whatever else is included, and then I add raw=1&autoplay=1
Again, this works for some videos with 0 change in setup, except that the link changes. There's no discernable difference between the videos. If you wanted to take this chat to email so this isn't publicly viewable I could send you the resource links.
- Greg-DB3 years ago
Dropbox Community Moderator
Thanks for following up. I was looking at the reference to the "frame-ancestors" directive in the error message in particular which relates to if/how frame parents are allowed.
It would be helpful to inspect this directly, so please do open a ticket here so you can share privately.
- Greg-DB3 years ago
Dropbox Community Moderator
Здравко is correct, the URL parameters may vary slightly for different links for different items, and can be important for how these get embedded, so you should not be stripping these from the links.
Regardless, I see your support ticket has been received so we'll review the details there and follow up with you soon.
- Здравко3 years agoLegendary | Level 20
lisarosado wrote:...
the video link is the same link you would use to share it, however I strip out the query args from that share url. So the url ends up being the share url minus the original ?dl=0 or whatever else is included, and then I add raw=1&autoplay=1
...
Hi lisarosado,
Can you take a look once again on the sets of link that work and the other that don't work? Is, by any chance, the only difference between the two groups availability of rlkey link parameter? 🧐
If so, that's the reason. It's never good idea to 'strip out query args'! If you need to change/replace particular parameter, just do it; without messing the others. 😉
Good luck.
About Discuss Dropbox Developer & API
Make connections with other developers
The Dropbox Community team is active from Monday to Friday. We try to respond to you as soon as we can, usually within 2 hours.
If you need more help you can view your support options (expected response time for an email or ticket is 24 hours), or contact us on X, Facebook or Instagram.
For more info on available support options for your Dropbox plan, see this article.
If you found the answer to your question in this Community thread, please 'like' the post to say thanks and to let us know it was useful!