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

Video plugin #133

Open
napster3000 opened this issue Mar 18, 2015 · 9 comments
Open

Video plugin #133

napster3000 opened this issue Mar 18, 2015 · 9 comments

Comments

@napster3000
Copy link

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']}
);
});

@earlbalai
Copy link

I too am having this issue

@koraks
Copy link

koraks commented Sep 9, 2015

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

@MattRyder
Copy link

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 ;^)

@timkleier
Copy link

Excellent fix, thanks!

@nfriend21
Copy link

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.

@connor-t
Copy link

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...

@robot-den
Copy link

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

@suramai
Copy link

suramai commented Jun 8, 2016

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

@suryasteja59
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

10 participants