collective / wildcard.media

13 stars 12 forks source link

Adding style `wcvideo` to a video link in a page produces exception in browser JS console #70

Open Rudd-O opened 3 years ago

Rudd-O commented 3 years ago

The exception is a 404 on the URL of the video plus /@@wildcard_video_macro tacked at the end.

It appears as if that view is only tagged on WildcardVideo Dexterity types. There is no reason this ought to be the case -- regular Files that contain videos should also be linkable with the media player.

zombified commented 3 years ago

I am not able to reproduce a 404 error in the console, with Plone 5.2 and Python 3.7, going to the /@@wildcard_video_macro view on an uploaded video. Which versions were you using?

I'm also not certain about the style selection you mention in the title -- with Plone 5 and TinyMCE 4, there is no longer a 'style' in the editor as far as I am aware, and most of that functionality moved to 'formats'. In Plone 5, there is no integration currently with the tinymce 4 editor to add the Video/Large/Small/Audio formatting for a link to a video/audio object. Are you using Plone 4 and experiencing this problem?

A work around for that, at least for now, is to and a <span class='wcvideo'></span> around the anchor created. In the page source it'll display the resolveuid url, but javascript will fetch and replace the <span> with the correct media element and other html, then enable the mediaelementplayer library on it.

With Plone 5, you should be able to add the 'Video' or 'Audio' behavior to the File type if you should want too (IE, through Site Setup -> Dexterity Content Types -> click on the File Type -> check the 'Video' behavior -> save), and be able to integrate with the wildcard.media functionality. Though, doing so will currently add a second upload field for videos... but that field will, as far as I can tell, be ignored in favor of the existing file upload field.

Rudd-O commented 3 years ago

A work around for that, at least for now, is to and a around the anchor created. In the page source it'll display the resolveuid url, but javascript will fetch and replace the with the correct media element and other html, then enable the mediaelementplayer library on it.

That's what doesn't work.

With Plone 5, you should be able to add the 'Video' or 'Audio' behavior to the File type if you should want too (IE, through Site Setup -> Dexterity Content Types -> click on the File Type -> check the 'Video' behavior -> save), and be able to integrate with the wildcard.media functionality. Though, doing so will currently add a second upload field for videos... but that field will, as far as I can tell, be ignored in favor of the existing file upload field.

Yeah, this seems like a hack, I'll pass.