ryan

Module: Video embed for YouTube/Vimeo (TextformatterVideoEmbed)

Recommended Posts

Just now, artaylor said:

@PWaddict: Yes it is a textarea with an Inputfield Type of CKEditor

Is the Content Type: Markup/HTML? If you have that too then I'm not sure why it's not properly working for you. Maybe another installed module causing this issue. 

Share this post


Link to post
Share on other sites

Attached a screengrab of the field setup screen.

Not sure if it matters, but when I tried to do the standard install of the module via Module Class Name, I got some weird errors from PW site, so, I installed it manually.

It is listed in the modules list and I can access the settings so I am assuming the manual install went ok. I think I will uninstall then reinstall the module and see if that helps.

screenshot-2017-03-27-20-52-38.png

Share this post


Link to post
Share on other sites

Uninstalled the module then tried to reinstall using the Module Class Name but got the following error:

I will do a manual install again.

screenshot-moduleload-error-2017-03-27-21-07-14.png

Share this post


Link to post
Share on other sites

5 years late but just want to say thanks for this module! I would prefer to use just the CKEditor media button but I had issues installing that.

Share this post


Link to post
Share on other sites

seems to have stopped working on a fresh module install on a new site, not had an issue before now with hthis great module. PW v3.0.36, no errors in my logs, just link showing up no video

Share this post


Link to post
Share on other sites
On 2017-5-22 at 10:31 AM, benbyf said:

seems to have stopped working on a fresh module install on a new site, not had an issue before now with hthis great module. PW v3.0.36, no errors in my logs, just link showing up no video

Remove the link and it should kick in again. Needs to just be plain text. 

  • Like 1

Share this post


Link to post
Share on other sites

... not sure thats a fix. do you mean dont use the CKEditor or within a CKeditor field delete the link and paste in again, as i tried that and did not work :(

Share this post


Link to post
Share on other sites

Yes delete the link from the ckeditor field. If it is an <a href to the YouTube video it will not embed. 

Share this post


Link to post
Share on other sites

Dummy question here:

If I wanted the plugin to add a specific player parameter to all youtube shortlinks (e.g. enablejsapi=1) where would be the best place to add this?
I changed line 170 to:

"&format=json&maxwidth={$this->maxWidth}&maxheight={$this->maxHeight}&enablejsapi=1&html5=1";

but since the oembed?url gets rewritten by youtube I'm not sure this is working. Any pointers?

Cheers guys!

Share this post


Link to post
Share on other sites
30 minutes ago, phil_s said:

Dummy question here:

If I wanted the plugin to add a specific player parameter to all youtube shortlinks (e.g. enablejsapi=1) where would be the best place to add this?
I changed line 170 to:


"&format=json&maxwidth={$this->maxWidth}&maxheight={$this->maxHeight}&enablejsapi=1&html5=1";

but since the oembed?url gets rewritten by youtube I'm not sure this is working. Any pointers?

Cheers guys!

Use the Global Options for Embedded YouTube/Vimeo Videos module to add player parameters.

Share this post


Link to post
Share on other sites

What's the current method for getting this to work with CKEditor?
I can't turn off HTML Purifier, or ACF.

 

Share this post


Link to post
Share on other sites
1 hour ago, renobird said:

What's the current method for getting this to work with CKEditor?
I can't turn off HTML Purifier, or ACF.

This module is a textformatter, so it doesn't write anything to the CKEditor field. As long as you can insert a link URL into your field as text without interference from HTML Purifier then there shouldn't be any problem.

Share this post


Link to post
Share on other sites

Thanks Robin,

It works fine with a textarea that isn't using CKEditor, and since it appears that the <iframe> tags are being stripped out; I figured it was a CKEditor issue.
 

Share this post


Link to post
Share on other sites
2 minutes ago, renobird said:

since it appears that the <iframe> tags

There shouldn't be any iframe tags involved - you simply insert the URL to the video (not an embed snippet or anything like that) in a new paragraph in your CKEditor field.

Share this post


Link to post
Share on other sites

The textformatter adds the iframe, that's how the embed works. At least it used to, I'll check the code again.

Share this post


Link to post
Share on other sites

I might be wrong, but my understanding is that the ACF/Purifier settings for a CKEditor field only affect content that goes through the CKEditor inputfield and is then saved to the database.

A textformatter on the other hand never saves its changes to the database and it isn't involved with the inputfield - it just makes changes on-the-fly as the content is output to the front-end.

Another thought: if you have multiple textformatters applied, check to see if the order they are applied makes a difference.

  • Like 2

Share this post


Link to post
Share on other sites

Yeah, that's right. At least that's my understanding as well. I just can't figure out why it won't work with CKEditor, even when it's the only textFormatter. I thought perhaps there was some other interaction with CKEditor that I was missing. Maybe that's not the issue at all. I'm stumped. I'll try a fresh install and work my way backwards. 

Share this post


Link to post
Share on other sites

@renobird the url must be written in its own line, only surrounded by <p>paragraph tags</p>. Have you checked this too?

  • Like 1

Share this post


Link to post
Share on other sites

What @horst said.

Also I got the same issue two days ago while I was trying to insert Facebook video in CKEditor. I needed to add this line to the Extra Allowed Content field to support iframe with HTML Purifier On: iframe[src,title,width,height,allowfullscreen,frameborder]

 

EAC.thumb.png.6fb42c681db8e5d20f23e08e7f1787cc.png

  • Like 3

Share this post


Link to post
Share on other sites
6 hours ago, flydev said:

Also I got the same issue two days ago while I was trying to insert Facebook video in CKEditor. I needed to add this line to the Extra Allowed Content field to support iframe with HTML Purifier On: iframe[src,title,width,height,allowfullscreen,frameborder]

Not actually the same issue - this module doesn't insert iframe (or any other code) into the RTE field. It's a textformatter, so it converts the youtube "view" URL into an iframe embedded URL on page load (frontend) only.

Share this post


Link to post
Share on other sites

Definitely on it's own line. Surrounding <p> tags are there. Everything checks out, and yet — *crickets*

I appreciate you all confirming it's not CKEditor related. I'll explore other options.

Share this post


Link to post
Share on other sites

Just wanted to report back in case I can save anyone else an hour or so.

After bashing my head against this I finally tracked it down to domain restrictions on some of the Vimeo videos.
In my test env I was using Youtube and Vimeo links from my personal account (no embed restrictions).
In production we were using Vimeo links from a colleagues account — they all had domain restrictions set.

Removed the restrictions, and waddya know, it works just fine.

 

  • Like 5

Share this post


Link to post
Share on other sites

Hi all. This has been driving me nuts: I've used this module previously and it worked perfectly. I've got it on 2 sites, but music-related. One works normally; I use the textformatter on the body text and videos display fine. The other only works if it's a Vimeo video; YouTube URLs slow the page loading then only displays the URL. I've tried a number of tests and different URLs and I can't figure this out. Both sites are not new and I'm pretty sure that it used to work where now it doesn't.

Here are two samples (they are past gigs, so I can play around with them without messing up the live sites):

Works: https://waveneyvalleyfolkcollective.co.uk/events/kirsty-merryn-jack-harris/

Doesn't Work: http://www.burstoncrown.com/events/sunday-sessions/falling-from-trees/

Any suggestions?

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.

  • Similar Content

    • By Robin S
      Another little admin helper module...
      Template Field Widths
      Adds a "Field widths" field to Edit Template that allows you to quickly set the widths of inputfields in the template.

      Why?
      When setting up a new template or trying out different field layouts I find it a bit slow and tedious to have to open each field individually in a modal just to set the width. This module speeds up the process.
      Installation
      Install the Template Field Widths module.
      Config options
      You can set the default presentation of the "Field widths" field to collapsed or open. You can choose Name or Label as the primary identifier shown for the field. The unchosen alternative will become the title attribute shown on hover. You can choose to show the original field width next to the template context field width.  
      https://github.com/Toutouwai/TemplateFieldWidths
      https://modules.processwire.com/modules/template-field-widths/
    • By horst
      Croppable Image 3
      for PW 3.0.20+
      Module Version 1.1.16
      Sponsored by http://dreikon.de/, many thanks Timo & Niko!
      You can get it in the modules directory!
      Please refer to the readme on github for instructions.
       
      -------------------------------------------------------------------------
       
      Updating from prior versions:
       
      Updating from Croppable Image 3 with versions prior to 1.1.7, please do this as a one time step:
      In the PW Admin, go to side -> modules -> new, use "install via ClassName" and use CroppableImage3 for the Module Class Name. This will update your existing CroppableImage3 module sub directory, even if it is called a new install. After that, the module will be recogniced by the PW updater module, what makes it a lot easier on further updates.
      -------------------------------------------------------------------------
       
      For updating from the legacy Thumbnail / CropImage to CroppableImage3 read on here.
       
      -------------------------------------------------------------------------
       
    • By MoritzLost
      UPDATE: I have published a stable version of this module!
      Discussion thread:
      Github: https://github.com/MoritzLost/TextformatterPageTitleLinks
      ---
      Hello there,
      I'm working on a tiny textformatter module that searches the text for titles of other pages on your site and creates hyperlinks to them. I'm not sure if something like this exists already, but I haven't found anything in the module directory, so I wrote my own solution 🙂
      It's not properly tested yet and is still missing some functionality I would like to implement, so at the moment it should be considered in BETA. Features include limiting the pages that will get searched by template, and adding a custom CSS class to the generated hyperlinks. As I'm writing this I noticed that it will probably include unpublished and hidden pages at the moment, so yeah ... it's still in development alright 😅
      You can download the module from Github:
      https://github.com/MoritzLost/TextformatterPageTitleLinks
      There's some more information in the readme as well.
      Anyway, let me know what you think! I'm happy about any feedback, possible improvements or ideas on how to improve the module. Cheers.
    • By blad
      Hi guys!
      I just uploaded a module to explore files based on elFinder. By default it will show the "Files" folder.
      Screenshots:

      Video:
       
      To do:
       More options To fix:
       The function of rotating or scaling an image fails  Image editors V 1.01 (view issue)
      Fixed the bug working with the Multi-Language support ( translation of folders ). Fixed the name of elfinder.en  Github:
      https://github.com/LuisSantiago/ProcessElFinder/
      I hope you like it.
    • By BitPoet
      I'm really in love with FormBuilder, but the one thing missing to match all my end users' expectations were repeatable field groups. Think repeaters, in ProcessWire terms. Our primary application of PW is our corporate intranet, so "lines" of fields are quite common in the forms I build. We have all kinds of request forms where the information for a varying number of colleagues needs to be entered (from meal order to flight booking request) and where it is simply impractical to send a form for each, and I don't want to clutter my forms with multiple instances of fields that may only get used ten percent of the time.
      That's why I started to build FormBuilderMultiplier (link to GitHub).
      What it does:
      Adds an option to make a regular Fieldgroup repeatable Lets you limit the number of instances of a Fieldgroup on the form Adds an "Add row" button the form that adds another instance of the Fieldgroup's fields Adds a counter suffix at the end of every affected field's label Stores the entered values just like regular fields Makes the entered values available in preview and email notifications Supports most text based fields, textareas and selects (really, I haven't had enough time to test all the available choices yet) What it doesn't do (yet):
      Support saving to ProcessWire pages (i.e. real Repeaters) I haven't tested all the validation stuff, Date/Time inputs etc. yet, but since I'm utterly swamped with other stuff at work, I didn't want to wait until I have it polished. Any feedback is welcome. There might also be some issues with different output frameworks that I haven't encountered yet. The forms I work with mostly use UIKit.
      Status:
      Still alpha, so test well before using it in the field.
      Known issues:
      When rows are added, the form's iframe needs to be resized, which isn't completely clean yet.
      How it works:
      The Fieldgroup settings are added through regular hooks, as is the logic that adds the necessary field copies for processing the form and displaying previews.
      "Multiplied" field instances are suffixed with _NUM, where NUM is an incremental integer starting from 1. So if you have add two fields named "surname" and "givenname" to a fieldgroup and check the "multiply" checkbox, the form will initially have "surname_1" and "givenname_1" field (I'm still considering changing that to make the risk to shoot oneself into the foot by having a regular "surname_1" field somewhere else in the form less likely).
      When a "row" is added, the first row is cloned through JS and the counter in the fields' IDs, names and "for" attributes as well as the counter in the label are incremented before appending the copies to the Fieldset container in the form.
      To keep backend and frontend in sync, a hidden field named [name of the fieldset]__multiplier_rows is added to the form. Both the backend and the frontend script use this to store and retrieve the number of "rows".
      ToDo:
      Naturally, add the option to store the data in real repeaters when saving to pages. Do a lot of testing (and likely fixing). Make a few things (like the "Add row" button label etc.) configurable in field(set) context. Add a smooth API to retrieve the multiplied values as WireArrays. The mandatory moving screenshot: