blynx

TextformatterVideoEmbedOptions

Recommended Posts

Hi,

this is a textformatter-module to globally set all kinds of YouTube and Vimeo options to embedded videos.

It works well with TextformatterVideoEmbed and I think also with TextformatterOEmbed - 

https://github.com/blynx/TextformatterVideoEmbedOptions

... this is my first module - so I hope the code is acceptable ... ; )

What do you think about the way I implemented the configuration? I Seperated all the config and defaults into a JSON file and generated all fields automatically ... I was wondering if this was already possible or a good idea at all here: https://processwire.com/talk/topic/11155-create-inputfields-from-json-array/

Looking forward hearing your feedback!

Cheers,

Steffen

  • Like 5

Share this post


Link to post
Share on other sites

Hi,

I get a parse error when trying to install this module:

Parse Error: syntax error, unexpected '.1' (T_DNUMBER), expecting ')' (line 27 of /var/lib/openshift/xxxxxxxxxxxxxxxxxxxxx/app-root/runtime/repo/site/modules/TextformatterVideoEmbedOptions/TextformatterVideoEmbedOptions.module) 

Share this post


Link to post
Share on other sites

Ah, that one - 

It should be fixed now. I made a stupid mistake in the version number  :-[

Share this post


Link to post
Share on other sites

Sorry, but I still get errors with the latest version:

Parse Error: syntax error, unexpected 'class' (T_CLASS), expecting identifier (T_STRING) or variable (T_VARIABLE) or '{' or '$' (line 49 of /var/lib/openshift/xxxxxxxxxxxxxxxxxxxxx/app-root/runtime/repo/site/modules/TextformatterVideoEmbedOptions/TextformatterVideoEmbedOptions.module) 

Share this post


Link to post
Share on other sites

Ok,

I should have fixed that now - it worked for me before, though.

May I ask which PHP version you are running? I was using the self::class thing to get the classname and that didn't seem to be working for you.

Share this post


Link to post
Share on other sites

Thanks,

I´m running PHP Version 5.4.40.

It works now, but the module seems to output the parameters in text too:

<section id='video'>yt_autoplayyt_hlyt_relyt_startyt_autoplayyt_hlyt_relyt_start<div class='TextformatterVideoEmbed'...

I'm using your module in addition to TextformatterVideoEmbed and I have added it after that one.

Another question: Do you know how to mute the sound or set a low volume level when using the autoplay parameter?

I know this is not possible using parameters in the url, but there must be way :-)

Regards,

Peter

Share this post


Link to post
Share on other sites

Arrrgh!
ok - hum, so it is just adding it additionally but the url-parameters are ok? Will have a look into this later -

I don't know if or how it is possible to control the volume. At least you are able to activate some "JS API" - so I guess it should be possible.

You should have a look into it here: https://developers.google.com/youtube/js_api_reference

But it seems to be deprecated ...

EDIT:

Use the iFrame API --> https://developers.google.com/youtube/iframe_api_reference

There are some functions:

player.mute():Void
player.unMute():Void
player.setVolume(volume:Number):Void
player.getVolume():Number

Share this post


Link to post
Share on other sites

Update to 3.3 is not possible. 

I am running pw in 3.0.18.

I created a field named videos - put textformatter to embed youtube... - $page->video is just showing the url

CKEditor is used and the <p> tags are set. 

What am I doing wrong? 

Share this post


Link to post
Share on other sites

Hi,

mh, does it also 'not work' without this options module?

Maybe there is something wrong with the TextformatterVideoEmbed/Inputfield setup already because the link didn't get transformed in the first place. This module, the TextformatterVideoEmbedOptions only applies the embed options to the embedded object.

Also make sure that the VideoEmbedOptions module is run after the VideoEmbed module. (Though it might actually be that it doesn't matter)

Is the url transformed into an <a> link?

  • Like 1

Share this post


Link to post
Share on other sites

Thank you - was my fault. While installing the module with modulesmanager I just found the options module. Daaaaaaaah hours for nothing :)

Great support! 

So People get both modules and watch the pw magic happen. 

  • Like 1

Share this post


Link to post
Share on other sites

The YouTube: Show Info field is broken. When the value is 0 it doesn't add the parameter: &showinfo=0 at the video url to hide the info but if the value is changed to 1 then it adds &showinfo=1 on the url which is useless cause YouTube shows info by default. Please fix it.

Share this post


Link to post
Share on other sites

Oh! 
Thanks for the tip - will try to take care of that today if I find the time - otherwise next week, will be away from the computer for the weekend.

I will let you know when it is fixed -

 

Share this post


Link to post
Share on other sites
2 hours ago, blynx said:

Oh! 
Thanks for the tip - will try to take care of that today if I find the time - otherwise next week, will be away from the computer for the weekend.

I will let you know when it is fixed -

 

Ok Thanks. I will be waiting.

Share this post


Link to post
Share on other sites

I found another problem. ProcessWire doesn't display the correct version of your module. It keeps saying that I have 0.2.7 and that there is a newer version 0.3.3 which is false cause I already have the latest module version installed. I opened the module file to confirm that: 'version' => 033. Please fix that too.

Share this post


Link to post
Share on other sites
31 minutes ago, PWaddict said:

I found another problem. ProcessWire doesn't display the correct version of your module. It keeps saying that I have 0.2.7 and that there is a newer version 0.3.3 which is false cause I already have the latest module version installed. I opened the module file to confirm that: 'version' => 033. Please fix that too.

@blynx - FYI that is because of the way you have declared the version number: 033

Either use: 33 or '0.3.3'

  • Like 2

Share this post


Link to post
Share on other sites
9 hours ago, blynx said:

Oh! 
Thanks for the tip - will try to take care of that today if I find the time - otherwise next week, will be away from the computer for the weekend.

I will let you know when it is fixed -

 

To quickly fix the issue just replace the below code from TextformatterVideoEmbedOptions.config.json

"yt_showinfo": {
        "type": null,
        "value": 0,
        "label":"YouTube: Show Info",
        "description":"Supported values are 0 and 1.",
        "notes": "Default: 0"
      }

to this:

"yt_showinfo": {
        "type": null,
        "value": 1,
        "label":"YouTube: Show Info",
        "description":"Supported values are 0 and 1.",
        "notes": "Default: 1"
      }

 

  • Like 1

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 BitPoet
      Since I was stuck to my flat today I took up a wish and rolled a Process module / CKEditor plugin combo that adds @-autocomplete like the mentions here in the forum to CKEditor fields. It's configurable, but only in module settings for now, the positioning of the select list is quite off and there's still some visual work to be done, so it is in early alpha state.
      Nonetheless, if you want to take a look, here it is:
      https://github.com/BitPoet/ProcessMention

       
      After installation, you may want to look into the "Additional selector" entry in the module's settings. You will most likely want to limit results to certain templates there.
       
      Edit: Updated to version 0.0.30 with fixed positioning of the dropdown.
      Edit2: Settings are configurable in field context now. If pwmentions is enabled, the according settings are shown on the "Input" tab.
       
    • By thuijzer
      https://github.com/thuijzer/processwire-FieldtypeBusinessHours
      Fieldtype Business Hours
      ProcessWire Fieldtype for entering business hours (opening hours)
       
      Input format
      Leave a day empty when closed on that day
      Times are in 24 hour format.
      9:00-12:00 9:00-12:00, 13:00-17:30 16:00-2:00  
      Usage in templates
      Days are from 1 to 7 where 1 is Monday and 7 is Sunday (ISO-8601)
      echo $page->field_name->isNowOpen() ? 'Now open' : 'Now closed'; if($page->field_name[1] == null) { echo 'Closed on Monday'; } if($page->field_name[2]->inRange('11:00')) { echo 'Tuesday at 11:00 open'; } echo $page->field_name[1]; echo $page->field_name[1]->getEntries()->getFrom()->format('H:i');  
    • By hellomoto
      I was working on this:
      class PWCRM extends WireData implements Module { public static function getModuleInfo() { return array( 'title' => 'Client Relationship Management', 'version' => .001, 'singular' => true, 'autoload' => true ); } public function init() {} public function ready() { $this->pages->addHookBefore('render', $this, 'accessHook'); $this->pages->addHookAfter('render', $this, 'hookAfterPageRender'); } public function accessHook(HookEvent $event) { $page = $this->wire('page'); if (!strpos($page->template->tags, 'crm')) return; if (!$this->wire('user')->hasRole('crm')) $this->wire('session')->redirect($this->wire('config')->urls->login);//throw new Wire404Exception(); } public function hookAfterPageRender(HookEvent $event) { $page = $event->object; echo $page->template->tags; if (!strpos($page->template->tags, 'crm')) return; echo $this->wire('config')->urls->templates; include_once($this->wire('config')->urls->templates.'functions.inc'); $pagehtml = $event->return; $pagehtml = str_replace( '</head>', '<link id="css_crm" rel="stylesheet" href="'.$this->wire('config')->urls->templates.'css/crm.css"> </head>', $pagehtml ); $event->return = $pagehtml; //$event->replace = true; } } I have tried placing the hooks into the init() function, and more... Neither method is effective. The echoes now output, but no redirection (although I have the access settings for the top-level template for this set to render a 404 for underprivileged users, which it does, overriding this, but nonetheless this should work aside from that.
      Then I wrote this up quick:
      <?php namespace ProcessWire; class MaintenanceMode extends WireData implements Module { public static function getModuleInfo() { return array( 'title' => 'Maintenance Mode', 'version' => 1, 'summary' => 'Disables the website frontend for non-superusers.', 'singular' => true, 'autoload' => true, 'permanent' => false ); } public function init() { $this->addHookBefore('Page::render', $this, 'displayDecide'); } public function displayDecide($event) { $page = $event->object; if ($page->template == 'admin' || $this->wire('user')->hasRole('superuser')) return; // replace the method hooked $event->replace = true; $event->return = "Patience please while we undergo some brief maintenance work."; } } which likewise avails nothing. What the hell is my problem here? 
    • By adrian
           Tracy Debugger for ProcessWire
      The ultimate “swiss army knife” debugging and development tool for the ProcessWire CMF/CMS
       

       
      Integrates and extends Nette's Tracy debugging tool and adds 30+ custom tools designed for effective ProcessWire debugging and lightning fast development
      The most comprehensive set of instructions and examples is available at: https://adrianbj.github.io/TracyDebugger
      Modules Directory: http://modules.processwire.com/modules/tracy-debugger/
      Github: https://github.com/adrianbj/TracyDebugger
      A big thanks to @tpr for introducing me to Tracy and for the idea for this module and for significant feedback, testing, and feature suggestions.