1

I am adding a video in a Rich Text field through file button in toolbar. I want to play these video in iframe. How can I do this..?

Or is there anyother option or plugin by which I can upload video which and add in richtext filed anywhere I want and show this in iframe on frontend.

2 Answers 2

1

If you want to upload and host the video on your site's server, then I would create a field with an Asset field type and restrict the type to Video. Without further details, it's hard to understand why you'd want to handle it within a Rich Text field.

Since you're hosting the video, you don't need an iframe. Just use the HTML5 <video> tag...

{% for video in entry.FIELDNAME %}
<video width="320" height="240" controls>
<source src="{{ video.getUrl }}" type="video/mp4">
</video>

Your servers will be handling the bandwidth for video delivery though; which is why most people post to YouTube or Vimeo and use the iframe to pass it through. To do that, you'd use the include that Brad mentioned.

1
  • I have text content above the video and below the video so i think if i can handle this with the Rich Text so need to create an extra field for video asset. Commented Oct 5, 2017 at 7:42
0

In your Rich Text field settings, if you select the "Standard" Redactor config that ships with a fresh Craft install (maps to the .json files in craft/config/redactor), it has the "Video" plugin selected by default.

enter image description here

That will add a Video button to your Rich Text field toolbar.

enter image description here

Clicking it will let you embed iframe code that you can output on the front-end of your site.

enter image description here

2
  • Thanks, but i know about that. This video button help me to add video through embed code but I want to upload my video in my sites same as we upload images in our site. Commented Oct 2, 2017 at 5:09
  • Sorry... missed the upload part of the question.
    – Brad Bell
    Commented Oct 2, 2017 at 17:01

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.