plone / plone.staticresources

Static resources for Plone
https://pypi.org/project/plone.staticresources/
5 stars 12 forks source link

resolveuid support for videos #179

Closed Rudd-O closed 2 years ago

Rudd-O commented 2 years ago

The video inserter / media plugin allows for insertion of videos hosted on a Plone instance (this is swell), but unlike the image insertion plugin, it does not automatically transform the link (source src tag inside the video tag) to a resolveuid URL (this does not seem to be done inside Plone as an input filter, but rather in the TinyMCE editor, but if I have misunderstood this, I would be happy to be pointed to the egg that does inbound transformations to resolveuid links).

When videos are moved, this results in broken links (modulo the URL redirection now available in Plone 6). Also, even correctly-linked videos often show up broken in RSS feeds as well, because relative links (as opposed to resolveuid links) are necessarily going to be relative to a different base URL when rendered in the RSS feed.

I have fortunately already begun doing the part of tracking link integrity so that deletion of videos does not cause data loss. https://github.com/plone/plone.app.linkintegrity/pull/83 — I wish I could do the JS stuff, but I just can't swim in the frontend waters well.

I am requesting this resolveuid feature to be added to the media plugin to support the above usecases. Thank you in advance!

Rudd-O commented 2 years ago

The TinyMCE media plugin can have a callback that could be used to take the URL the user pasted from the src= attribute, and then call upon a Plone view to resolve the UID of the URL, and then embed that as src=https://www.tiny.cloud/docs/plugins/opensource/media/ has details on it.

For this ticket it is not strictly necessary to have a file chooser like the ploneimage plugin has, although that would certainly be phenomenal as a stretch goal.

Rudd-O commented 2 years ago

Related but not quite the same: IFRAME SRC= should also be resolveuid'd as it can be used to embed PDFs.

Rudd-O commented 2 years ago

Moved more upstream.