Jump to content

TextformatterVideoEmbedOptions


blynx
 Share

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 7
Link to comment
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) 
Link to comment
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) 
Link to comment
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.

Link to comment
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

Link to comment
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
Link to comment
Share on other sites

  • 7 months later...

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? 

Link to comment
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
Link to comment
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
Link to comment
Share on other sites

  • 7 months later...

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.

Link to comment
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.

Link to comment
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.

Link to comment
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
Link to comment
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 2
Link to comment
Share on other sites

  • 1 year later...
3 hours ago, tires said:

Very helpful module!

Is there a setting to hide this ugly "ytp-pause-overlay"?

Change the "YouTube: Show Related Videos at the End" to 0 value. It hides the related videos when you pause too.

  • Like 1
Link to comment
Share on other sites

  • 2 weeks later...
On 5/17/2018 at 5:35 PM, PWaddict said:

Change the "YouTube: Show Related Videos at the End" to 0 value. It hides the related videos when you pause too.

No, these "ytp-pause-overlay" is displayed anyway.

Is there another way to hide this?

Link to comment
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
 Share

×
×
  • Create New...