EditorJS-React-Renderer icon indicating copy to clipboard operation
EditorJS-React-Renderer copied to clipboard

Video render doesn't output anything

Open pacid opened this issue 3 years ago • 2 comments

Hi,

I use the renderer to display images - and it works fine. The image html is rendered. However when attaching a video nothing gets rendered from the output data. And when adding it via editor.js it works fine - vid uploads, html rendered, you can play the video.

image

image

This is html rendered for an image: image

image

This is html rendered for a video. No video appears. image

Thanks in advance for your help, Pawel

pacid avatar Aug 14 '22 12:08 pacid

@pacid

Your video data uses an image format, which is incorrect. Ideally the data passed to ERR should be generated by one of the editor.js plugins (See Supported blocks section on NPM).

If your data is generated in other ways, it should take same format. For videos, see Simple Video plugin and/or Embed plugin.

In this case (using pasted URLs), your data should look like this

type SimpleVideoData = {
  type: 'video'
  data: {
    url: string
    caption?: string
    autoplay?: bool
    controls?: bool
    muted?: bool
    stretched?: bool
  }
}

dev-juju avatar Aug 14 '22 13:08 dev-juju

I am using

import VideoTool from "@weekwood/editorjs-video";

as it allows to upload the videos and the simple one only "Works only with pasted videos and URLs and requires no server-side uploader"

Now switched to SimpleVideo, pasted the video and then rendered in a post it looks like that: image

On the site: image

Definitely would like to have some player here after the video file has been uploaded. I understand that I can create a custom renderer, would you recommend any 3rd party vid players that I could harness here and use on the site to embed it?

I would even use this one that is from the above library that I added. (this is when I am using @weekwood/editorjs-video) image As it works okay. Just not sure how to go about adding it as a custom renderer.

I think it's this one https://github.com/CookPete/react-player, so might just add this as a renderer for this specific block.

Thanks for your help.

pacid avatar Aug 14 '22 21:08 pacid

@pacid

V3.5.0 should now have support for @weekwood/editorjs-video

dev-juju avatar Dec 02 '22 23:12 dev-juju