redactor-rails icon indicating copy to clipboard operation
redactor-rails copied to clipboard

Video plugin

Open napster3000 opened this issue 9 years ago • 9 comments

I've added video plugin manually but it doesn't being showed

//= require redactor-rails //= require redactor-rails/video

config.js

$(document).ready( function(){ var csrf_token = $('meta[name=csrf-token]').attr('content'); var csrf_param = $('meta[name=csrf-param]').attr('content'); var params; if (csrf_param !== undefined && csrf_token !== undefined) { params = csrf_param + "=" + encodeURIComponent(csrf_token); } $('.redactor').redactor( { "imageUpload":"/redactor_rails/pictures?" + params, "imageGetJson":"/redactor_rails/pictures", "fileUpload":"/redactor_rails/documents?" + params, "fileGetJson":"/redactor_rails/documents", "path":"/assets/redactor-rails", "css":"style.css", "plugins": ['video']} ); });

napster3000 avatar Mar 18 '15 11:03 napster3000

I too am having this issue

earlbalai avatar Apr 03 '15 19:04 earlbalai

how i can add new plugins? it´s imposible or what?

koraks avatar Sep 09 '15 11:09 koraks

Hi folks, just had this issue and it seems like the API changed and video.js hasn't been updated since?

Simple fix, though, just change the first few lines of the script from/to: (Ensure you perform the RedactorPlugins instance check, this may be the first plugin loaded)

(function($)
{
    $.Redactor.prototype.video = function()
    {
if (!RedactorPlugins) var RedactorPlugins = {};

(function($)
{
    RedactorPlugins.video = function()
    {

@koraks: nothing is impossible, pal ;^)

MattRyder avatar Sep 13 '15 18:09 MattRyder

Excellent fix, thanks!

timkleier avatar Oct 06 '15 15:10 timkleier

For anyone else who comes across this, the exact same fix needs to be applied to any non-default plugins that you download from the redactor website. They will NOT work by default.

I can see the video button now, but I still can't insert a video without an error.

nfriend21 avatar Nov 08 '15 23:11 nfriend21

is it not possible to use the video plugin now at all? I have the same problem as @nfriend21, can see the button but nothing happens when I click on it...

connor-t avatar Dec 15 '15 20:12 connor-t

Hi! I found the modified JS files for audio/video plugins here https://github.com/kyan/redactor-plugins Its work for me.

Also, mb it will be useful, i use .sanitize method for showing my Articles. This method cuts iframe tag what needed for video. You may change tags for .sanitize in config/application.rb:

config.action_view.sanitized_allowed_tags = %w(strong em b i p code pre tt samp kbd var sub sup dfn cite big small address hr br div span h1 h2 h3 h4 h5 h6 ul ol li dl dt dd abbr acronym a img blockquote del ins iframe)

All tags except iframe are the same as in sanitizer.rb

robot-den avatar Feb 07 '16 12:02 robot-den

@robot-den Thank you so much. I can see the videos appearing now :)

suramai avatar Jun 08 '16 21:06 suramai

I have used this and it worked for me... https://www.votzap.com/debates/how-to-add-video-plugin-to-redactor-rails-gem

suryasteja59 avatar May 17 '17 18:05 suryasteja59