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 Macrura
      Field Descriptions Extended
      This module enables you to extend field descriptions by dividing short descriptions with a longer text that is revealed in a toggle.
      Modules Directory: http://modules.processwire.com/modules/field-descriptions-extended/
      Github: https://github.com/outflux3/FieldDescriptionsExtended
      Extending your field descriptions using the standard field's description field.
      Once this module is installed, it will automatically search your description field for the presence of 5 dashes (-----).
      Any content above the 5 dashes will be visible and the content below the dashes will be hidden. A 'More...' link will appear at the end of the short description which when clicked will reveal the rest of the description.
      Using Simple Markdown Editor with the description field
      If you have Simple Markdown Editor (InputfieldSimpleMDE) installed, you can enable the field description to have that editor.
      *When using Simple MDE, you can use the button (Insert Horizontal Line) instead of typing 5 dashes. More about SimpleMDE.
      Extending your field descriptions using content from a ProcessWire Page for the field description.
      You may use the content from a ProcessWire page as a field description. This would allow you to easily insert images, links, and use hanna codes.
      To use page content for your field descriptions, please follow these instructions:
      Install Select Fields module (FieldtypeFields) http://modules.processwire.com/modules/fieldtype-fields/ Create a new field using this field type, e.g. field_select. Add the field to any template you will be using for your field descriptions. Setup your help pages (for example under a settings branch) where you will store the field description content,using the template containing the Field Select. Add content to a page and select the field where that content should show. To show a short text before the link to the longer content, separate them with 5 dashes Be sure to update your settings on this page, first enable page content descriptions,then specify the name of the Select Fields field, template to search, and content field. If you create a field description using this method, please note that the description field must be blank for contexts where you want the page content to appear.
      You can freely use template context for field descriptions, but the Page Content method is not context sensitive and will display under all contexts where the description is blank.
      ----
      original post:
      This is a new module, hope to release soon, which allows extended field descriptions, in currently 2 ways.
      The main feature of the module is that you can have a short description and then a 'more...' link which drops down a longer block of text.
      This is achieved by separating the intro/visible text and the rest with 5 dashes.

      Example setup:

      the 2nd way is if you are using AdminThemeUiKit, you can show extended field instructions in a panel. The content of the panel is edited on a regular PW page. This use case would probably not be that common, but if you had a field that required some extended instructions for how to use, this could be useful; Also, since this allows you to target information and instructions down at the field level, it could reduce the amount of documentation needed on a global level, since it is a lot more context targeted.

    • By Robin S
      Breadcrumb Dropdowns
      Adds dropdown menus of page edit links to the breadcrumbs in Page Edit.

      Installation
      Install the Breadcrumb Dropdowns module. The module requires ProcessWire >= v3.0.83 and AdminThemeUikit.
      There is a checkbox option in the module config that determines if the breadcrumb dropdowns will include pages that the user does not have permission to edit.
      Features/details
      The module adds an additional breadcrumb item at the end for the currently edited page. That's because I think it's more intuitive for the dropdown under each breadcrumb item to show the item's sibling pages rather than the item's child pages. In the dropdown menus the current page and the current page's parents are highlighted in a crimson colour to make it easier to quickly locate them in case you want to edit the next or previous sibling page. If the option to include uneditable pages is selected then those pages are indicated by a reduced text opacity and the "not-allowed" cursor is shown on hover. There is a limit of 25 sibling pages per dropdown for performance reasons and to avoid the dropdown becoming unwieldy. Incompatibilities
      This module replaces the AdminThemeUikit::renderBreadcrumbs method so will potentially be incompatible with other modules that hook the same method.
       
      https://modules.processwire.com/modules/breadcrumb-dropdowns/
      https://github.com/Toutouwai/BreadcrumbDropdowns
    • By joshuag
      Hey guys, 
      Thought I would share a quick preview of Designme. A module we (Eduardo @elabx and I) are building for visually laying out your templates/edit screens. 🙂
      This is a really quick, zero polish screen grab. FYI. 
      Video #2 - UPDATE
      This new video shows the following features in Designme:
      Re-arranging fields via Drag & Drop Re-sizing fields via Dragging. Adjusting field settings - with live refresh. Working on "hidden" fields while Designme is active. Creating New fields. Deleting fields. Creating/Deleting Tabs. Dragging fields between tabs. Creating fieldsets. Tagging/Un-tagging fields. Fields without headers expand when hovered (like checkboxes). Live filtering of fields in the sidebar. Ability to adjust (all) Template settings without leaving Designme. Template File Tree Editing Template files source code with ACE Editor. Editing Multiple files with ACE Editor. (New Tabs) Saving files. Techie stuff Fields load their own js/css dependancies. *ready to use on creation (*most fields)  Everything happens via Ajax to ProcessPageEdit (via module + hooks). Designme has a JS api that you can use.  All actions trigger events.  We would love any detailed feedback on what you see so far. If you are interested in testing Designme. Let me know below. 🙂
       
       
      Video #1. 
       
    • By dreerr
      TemplateEnginePug (formally TemplateEngineJade)
       
      This module adds Pug templates to the TemplateEngineFactory. It uses https://github.com/pug-php/pug to render templates.
      doctype html html(lang='en') head meta(http-equiv='content-type', content='text/html; charset=utf-8') title= $page->title link(rel='stylesheet', type='text/css', href=$config->urls->templates . 'styles/main.css') body include header.pug h1= $page->title if $page->editable() p: a(href=$page->editURL) Edit Project on GitHub: github.com/dreerr/TemplateEnginePug
      Project in modules directory: modules.processwire.com/modules/template-engine-pug/
       
      For common problems/features/questions about the Factory, use the TemplateEngineFactory thread.
       
    • By tpr
      ProcessNetteTester
      Run Nette Tester tests within ProcessWire admin.
      (continued from here)

      Features
      AJAX interface for running Nette Tester tests, in bulk or manually display counter, error message and execution time in a table run all tests at once or launch single tests show formatted test error messages and report PHP syntax errors stop on first failed test (optional) hide passed tests (optional) display failed/total instead passed/total (optional) re-run failed tests only (optional) auto scroll (optional) include or exclude tests based on query parameters start/stop all tests with the spacebar reset one test or all tests (ctrl+click) https://modules.processwire.com/modules/process-nette-tester/
      https://github.com/rolandtoth/ProcessNetteTester