Jump to content

Video Fieldtype


Recommended Posts

15 minutes ago, itsberni said:

i think my hoster( strato )doesn't support that . Does anybody from you know how to get this working with strato?
@adrian without this, there is no solution for a poster-image, right?

As far as I know ffmpeg is the only solution for being able to create poster images. That said, I haven't looked into this is a few years, so maybe now there is. If you find an alternative I might be able to implement it within this module.

Link to comment
Share on other sites

  • 4 months later...

I registered at cloudinary.com a year ago in order to manage images. I found that the free plan is only good for testing purposes because the monthly quota quickly got exhausted as they took into account any bits that were transferred in any way possible. I cannot remember the details but the only useful plans were the paid ones which were not an option for the client so I have not yet checked their services since then.

  • Like 1
Link to comment
Share on other sites

  • 2 years later...

Hi all,

Just wondering if anyone is using this module and what you'd think about me removing the "Links to required scripts" option. These days, all browsers natively support the HTML5 video element, so I don't think we really need a fallback to Flash, especially given that Flash EOL is Dec 31, 2020.

Anyone mind if I remove this?

  • Like 2
Link to comment
Share on other sites

4 hours ago, michelangelo said:

BTW the thumbnail generation is not really working for me. I am not sure if I did something wrong...

That's kinda the main point of the module ?

Do you have ffmpeg / php-ffmpeg properly installed?

  • Thanks 1
Link to comment
Share on other sites

Major new version just committed that removes mediaelementjs - now relies completely on browser support for <video>. It also includes a ffmpeg-php package because the old pecl script is no longer maintained.

Again, maybe no-one is using this, but if you are, please let me know how this version goes.

PS - captions are now VTT, rather than SRT.

  • Like 1
Link to comment
Share on other sites

1 hour ago, michelangelo said:

Wow @adrian I am hitting a huge wall with installing ffmpeg-php. There are many outdated or confusing tutorials online. Do you have any tips?

I am using MAMP with php 7.4.2 and ZSH as shell.

Did you see my comment in the last post? You no longer need that because it's included in the module. However, you still need to install ffmpeg itself. Let me know if you're having issues with that.

Link to comment
Share on other sites

  • 1 year later...

Hi Adrian!

Hope you can help me. I am revisiting this module after many years and am encountering an error.

I created a field named videos.
I added the field to my homepage template.
I add this code to my homepage. Is this correct?

foreach($page->videos as $file) {
	echo $file->play;

I set Max number of files to zero.
I set formatted value to Automatic.
I am not using subtitles and so have done nothing with regard to this.

I uploaded two videos to the home page. All OK. Thumbnails are generated fine.
Both videos appear on the homepage. Yay!

However I get the following error messages displayed on the homepage as I am on a local machine with debug mode enabled.

Warning: file(/var/www/ceritabengkel.test/public//site/assets/files/1/test720p.vtt): failed to open stream: No such file or directory in /var/www/ceritabengkel.test/public/site/assets/cache/FileCompiler/site/modules/FieldtypeVideo/FieldtypeVideo.module.php on line 147

Warning: Invalid argument supplied for foreach() in /var/www/ceritabengkel.test/public/site/assets/cache/FileCompiler/site/modules/FieldtypeVideo/FieldtypeVideo.module.php on line 149

Each video I add will have output it's own pair of these error messages above...

I am running:
Debian 11.
PHP 7.4.25

I have gone to the Modules page and clicked on the Clear Compiled Files button but this does not seem to help.

Any suggestions what I might be doing wrong Adrian?
Is there any other info I can provide you with?

Many many thanks!



Link to comment
Share on other sites

Hi @adrian

Gosh you are a genius ?
It worked instantly ?

Looking at your GitHub commits Adrian, were the error messages appearing simply because I was not using subtitles?
Or was it something else?

Once again Adrian... you create such amazing goodness with the modules and help that you so generously give forth...
God bless you!

P.S. Still learning how to use this awesome module to it's full potential. So i might have a question or two in the future... ?

  • Like 1
Link to comment
Share on other sites

I think perhaps PHP's error reporting just became more strict since I built this module and previously it let me be a bit sloppy in the code. hence that error when no subtitles were entered.

Thanks for the kind words!

  • Thanks 1
Link to comment
Share on other sites

@adrian Hi Adrian!

Just a quick question.
I have just installed your Admin Actions module for the very first time.
The functionality of it that I am after is the FTP Files to Page action...

Ultimately what I want to do is FTP video files up to an uploads directory on the server and then move them into specific pages with a template that has a "Fieldtype Video" using your Admin Actions module.

I created a field named videos using the "Fieldtype Video".
I assigned this field to the home template.

Small videos I upload via the regular admin page ui work fine and the videos render on the site fine.
And so I can safely say the videos field works fine ?

The issue I am having Adrian is that when it comes to selecting my videos field via "Admin Actions FTP Files to Page", my videos field does not appear in the "Field" selection dropdown.
I have a couple of image fields in my home template and they appear just fine in the "Admin Actions FTP Files to Page" "Field" selection dropdown.
So Admin Actions does recognise image fields.
But it does not recognise my videos Fieldtype Videos field.

I hope I have clearly explained the issue.

Is there something extra that I need to do for the selection dropdown to recognise Fieldtype Videos fields?

Many many thanks Adrian!

Link to comment
Share on other sites

Hi @adrian

Thanks for looking into this Adrian!
I installed the latest version of AdminActions.

When trying to perform a "Admin Actions FTP Files to Page" action, my videos field now appears in the selection dropdown.
So that's fixed. Yay! ?

However, there is another problem.
I put a video file here: /var/www/ceritabengkel.test/public/site/assets/cache/AdminActions/uploads/video.mp4
I then tried to perform the Admin Action.

What happens is it errors out with the message heading: ProcessWire: ProcessAdminActions: Unable to install invalid image.
There is then a whole slew of text. I will add this error output at the bottom of this message.

Going to Setup > Logs > Exceptions gives me this error message: Unable to install invalid image In /wire/core/Pageimage.php line 1679

This is definitely beyond me! But as always happy to try out anything you want me experiment with.

Many thanks Adrian!

P.S. Those messages:

DEBUG MODE BACKTRACE ($config->debug == true):
#0 /var/www/ceritabengkel.test/public/wire/core/Wire.php(417): ProcessWire\Pageimage->___install()
#1 /var/www/ceritabengkel.test/public/wire/core/WireHooks.php(951): ProcessWire\Wire->_callMethod()
#2 /var/www/ceritabengkel.test/public/wire/core/Wire.php(485): ProcessWire\WireHooks->runHooks()
#3 /var/www/ceritabengkel.test/public/wire/core/Pagefile.php(183): ProcessWire\Wire->__call()
#4 /var/www/ceritabengkel.test/public/wire/core/Pagefile.php(134): ProcessWire\Pagefile->setFilename()
#5 /var/www/ceritabengkel.test/public/wire/core/Pageimage.php(167): ProcessWire\Pagefile->__construct()
#6 /var/www/ceritabengkel.test/public/wire/core/Pageimages.php(58): ProcessWire\Pageimage->__construct()
#7 /var/www/ceritabengkel.test/public/site/assets/cache/FileCompiler/site/modules/ProcessAdminActions/actions/FtpFilesToPage.action.php(78): ProcessWire\Pageimages->add()
#8 /var/www/ceritabengkel.test/public/site/assets/cache/FileCompiler/site/modules/ProcessAdminActions/ProcessAdminActions.module.php(272): FtpFilesToPage->executeAction()
#9 /var/www/ceritabengkel.test/public/wire/core/Wire.php(414): ProcessAdminActions->___executeRun()
#10 /var/www/ceritabengkel.test/public/wire/core/WireHooks.php(951): ProcessWire\Wire->_callMethod()
#11 /var/www/ceritabengkel.test/public/wire/core/Wire.php(485): ProcessWire\WireHooks->runHooks()
#12 /var/www/ceritabengkel.test/public/site/assets/cache/FileCompiler/site/modules/ProcessAdminActions/ProcessAdminActions.module.php(739): ProcessWire\Wire->__call()
#13 /var/www/ceritabengkel.test/public/wire/core/ProcessController.php(337): ProcessAdminActions->__call()
#14 /var/www/ceritabengkel.test/public/wire/core/Wire.php(414): ProcessWire\ProcessController->___execute()
#15 /var/www/ceritabengkel.test/public/wire/core/WireHooks.php(951): ProcessWire\Wire->_callMethod()
#16 /var/www/ceritabengkel.test/public/wire/core/Wire.php(485): ProcessWire\WireHooks->runHooks()
#17 /var/www/ceritabengkel.test/public/wire/core/admin.php(160): ProcessWire\Wire->__call()
#18 /var/www/ceritabengkel.test/public/wire/modules/AdminTheme/AdminThemeUikit/controller.php(15): require('/var/www/cerita...')
#19 /var/www/ceritabengkel.test/public/site/templates/admin.php(15): require('/var/www/cerita...')
#20 /var/www/ceritabengkel.test/public/wire/core/TemplateFile.php(327): require('/var/www/cerita...')
#21 /var/www/ceritabengkel.test/public/wire/core/Wire.php(414): ProcessWire\TemplateFile->___render()
#22 /var/www/ceritabengkel.test/public/wire/core/WireHooks.php(951): ProcessWire\Wire->_callMethod()
#23 /var/www/ceritabengkel.test/public/wire/core/Wire.php(485): ProcessWire\WireHooks->runHooks()
#24 /var/www/ceritabengkel.test/public/wire/modules/PageRender.module(554): ProcessWire\Wire->__call()
#25 /var/www/ceritabengkel.test/public/wire/core/Wire.php(417): ProcessWire\PageRender->___renderPage()
#26 /var/www/ceritabengkel.test/public/wire/core/WireHooks.php(951): ProcessWire\Wire->_callMethod()
#27 /var/www/ceritabengkel.test/public/wire/core/Wire.php(485): ProcessWire\WireHooks->runHooks()
#28 /var/www/ceritabengkel.test/public/wire/core/WireHooks.php(1059): ProcessWire\Wire->__call()
#29 /var/www/ceritabengkel.test/public/wire/core/Wire.php(485): ProcessWire\WireHooks->runHooks()
#30 /var/www/ceritabengkel.test/public/wire/modules/Process/ProcessPageView.module(225): ProcessWire\Wire->__call()
#31 /var/www/ceritabengkel.test/public/wire/modules/Process/ProcessPageView.module(171): ProcessWire\ProcessPageView->renderPage()
#32 /var/www/ceritabengkel.test/public/wire/core/Wire.php(417): ProcessWire\ProcessPageView->___execute()
#33 /var/www/ceritabengkel.test/public/wire/core/WireHooks.php(951): ProcessWire\Wire->_callMethod()
#34 /var/www/ceritabengkel.test/public/wire/core/Wire.php(485): ProcessWire\WireHooks->runHooks()
#35 /var/www/ceritabengkel.test/public/index.php(55): ProcessWire\Wire->__call()
#36 {main}


Link to comment
Share on other sites

H @adrian

Nothing to say sorry for mate! On the contrary it is I who am so very grateful.

I installed this dev version of Fieldtype Video.

The good news is it worked and the video file is imported into the page just fine. ?

The only drawback? I suppose Adrian is that no thumbnails are generated.
Would you know of some workaround that I can do to create the thumbnails Adrian?
Or is there any way that a button could be added to Fieldtype video such that one could regenerate it's thumbnails on the page?

I've added a picture of the successful Admin Action and the thumbnail issue seen on the page we have imported the file into...

Hopefully this last bit isn't too difficult? Or there is a workaround you can suggest... ?

Many thanks





Link to comment
Share on other sites

Hi @Zahari M. - I spent a fair bit of time on this last night without any success. It's due to AdminActions adding the videos via the API which requires hooking into Pagefiles::install rather than InputfieldFile::fileAdded which is what the module uses when adding a video the normal way.

I thought this would actually be fairly simple, but I couldn't get the hook to fire - not sure if I was just being dumb, or if there is something I need to do differently because this is a Fieldtype/Inputfield module - something I haven't actually done much with.

I'll try to take another look, but honestly not sure when I'm afraid as I don't have much time at the moment.

Sorry about that.

  • Like 1
  • Thanks 1
Link to comment
Share on other sites

Hi @adrian

No worries mate. I understand. More importantly, thanks so much for having tried!

I am very grateful to ya for all you have done! ?

The Video FieldType is so useful and awesome.

P.S. Any chance you could share that latest version that was not working?
Reason I ask is that as a personal project for next year, I want to figure this OOP stuff out and try and have a tinker with it.
Knowing you... it probably won't be too far off the mark ?

Thanks again Adrian!!




Link to comment
Share on other sites

  • 2 weeks later...
On 11/3/2021 at 7:20 AM, Zahari M. said:

Knowing you... it probably won't be too far off the mark

Unfortunately, I was a long way off and abandoned my attempts, so don't have anything to share at the moment. I'll need to take another look at some point.

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

  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Create New...