redactor-rails
redactor-rails copied to clipboard
Video plugin
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']} ); });
I too am having this issue
how i can add new plugins? it´s imposible or what?
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 ;^)
Excellent fix, thanks!
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.
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...
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 Thank you so much. I can see the videos appearing now :)
I have used this and it worked for me... https://www.votzap.com/debates/how-to-add-video-plugin-to-redactor-rails-gem