jgraph / drawio

draw.io is a JavaScript, client-side editor for general diagramming.
https://www.drawio.com
Other
41.35k stars 7.67k forks source link

question: How to embed youtube? #4667

Closed winter60 closed 1 month ago

winter60 commented 1 month ago

<iframe width="560" height="315" src="https://www.youtube.com/embed/xxxxxxxxxxxx" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen></iframe>

How to embed youtube in drawio?

davidjgraph commented 1 month ago

https://groups.google.com/g/drawio/c/P9fnbXwOQAk

winter60 commented 1 month ago

thanks, I tried, video works, but iframe does not.

alderg commented 1 month ago

iframe is blocked and our frame-src CSP is https://viewer.diagrams.net https://www.draw.io https://*.google.com; for security reasons. You'd have to host your own instance with the following DOM_PURIFY_CONFIG:

window.DOM_PURIFY_CONFIG = window.DOM_PURIFY_CONFIG ||
    {ADD_TAGS: ['use', 'foreignObject'], FORBID_TAGS: ['form'],
    ALLOWED_URI_REGEXP: /^((?!javascript:).)*$/i,
    ADD_TAGS: ['iframe'],
    ADD_ATTR: ['target', 'content', 'pointer-events',
        'requiredFeatures']};