Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Preview of audios and videos is not rendering #8004

Closed
prernagp opened this issue Sep 23, 2020 · 5 comments
Closed

Preview of audios and videos is not rendering #8004

prernagp opened this issue Sep 23, 2020 · 5 comments
Labels
issue: feature request Issue suggesting a new feature

Comments

@prernagp
Copy link

Describe the bug
I am trying to make a blog post using Strapi editor. When I upload media files like image, audio, video etc, then it gets displayed as a markdown.

> audio
![mozart_2.mp3](https://spl-cms.s3.amazonaws.com/mozart_2_3b7ed7b864.mp3)

> video

![videoplayback.mp4](https://spl-cms.s3.amazonaws.com/videoplayback_a85dd9c12d.mp4)

But when I switch to preview for the same all I can see the preview as broken links.

audio
mozart_2.mp3

video
videoplayback.mp4

Steps to reproduce the behavior

  1. Go to "rich text editor"
  2. Click on 'add media in editor'
  3. Add audio and video in editor.
  4. Click on "switch to preview" button.
  5. See error :- You will not be able to see the preview of audio and video files.

Expected behavior
Just like images, the editor should be able to preview audio and video files.

Screenshots
Screenshot from 2020-09-23 15-45-49

Screenshot from 2020-09-23 15-48-05

System

  • Node.js version: 14.11.0
  • NPM version: 6.14.8
  • Strapi version: "strapi": "3.1.4",
  • Database: postgresql
  • Operating system: Ubuntu 18.04.5
@derrickmehaffy
Copy link
Member

@soupette @HichamELBSI AFAIK there isn't much we can do on this can we since those are stored in AWS-S3, the client would need to fetch the files and cache them locally to actually see the preview?

@soupette
Copy link
Contributor

soupette commented Sep 24, 2020

There's not much we can do, reading audio and video files in markdown is kinda not supported. I have found a plugin for markdown-it : markdown-it-video that enables youtube videos and more that a user can install in the editor but that's all what's supported.

However, you can read audio file, (I'm guessing you can do the same with videos) with html:

Screenshot 2020-09-24 at 09 43 46

@derrickmehaffy
Copy link
Member

This may be something when we move over to an actual rich-text style field, I know @alexandrebodin had some ideas in the past but I'm not sure when we plan to implement something besides markdown (though I remember something about us avoiding storing HTML directly in the database)

@derrickmehaffy derrickmehaffy added issue: feature request Issue suggesting a new feature and removed issue: help wanted labels Sep 24, 2020
@soupette
Copy link
Contributor

I remember addressing the issue of script injection such as

<script>alert('Hello Soupette')</script>

But the lib we are using as an option to prevent such behaviour and also supports some HTML so the preview is a bit better than it used to be. However, audio and video preview is not very common in markdown for instance the GitHub md preview that we are currently using does not support it.

I think that we can close this issue, don't you @derrickmehaffy ?

@derrickmehaffy
Copy link
Member

Yeah for now will mark as closed until we have a larger discussion about rich text in general.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
issue: feature request Issue suggesting a new feature
Projects
None yet
Development

No branches or pull requests

3 participants