Hi community, I have this function:
function elgg_webcam_convert_file($file, $ext) {
...ffmpeg conversion process..
}
and I call it from the upload file action:
elgg_register_event_handler('shutdown', 'system', function () use ($file) {
elgg_webcam_convert_file($file, 'mp4');
});
But the function doesn´t run.
What I´m doing wrong?
I´ve Elgg 2.2
info@elgg.org
Security issues should be reported to security@elgg.org!
©2014 the Elgg Foundation
Elgg is a registered trademark of Thematic Networks.
Cover image by Raül Utrera is used under Creative Commons license.
Icons by Flaticon and FontAwesome.
- ihayredinov@ihayredinov
ihayredinov - 0 likes
- Javier@chamus
Javier - 0 likes
- ihayredinov@ihayredinov
ihayredinov - 0 likes
- ihayredinov@ihayredinov
ihayredinov - 0 likes
- Javier@chamus
Javier - 0 likes
- ihayredinov@ihayredinov
ihayredinov - 0 likes
- Javier@chamus
Javier - 0 likes
You must log in to post replies.The code seems correct, though shutdown event may not always behave as you want it. Do you have vroom plugin installed?
Yes I´ve Vroom enabled and working.
I´ve tried in start.php with:
And it works, but I need the ffmpeg conversion at file upload, I tried with:
But doesn´t work, any idea how can I defer the ffmpeg process after file upload?
I am confused. The code you say works defers it already, so what doesn't work? Are you saying it works with update event and not the create event?
It looks like like you are modifying my code from elgg_file_viewer or working with a plugin that stole/recycled my code, so why are not just using the config values, and trying to make this work with closures instead?
Yes
Yes Ismayil, I looked for working vroom examples and I try with your plugin code.
I dont unsderstand it, I see you use elgg_get_config/elgg_set_config in your functions but neither works.
Are you using the file plugin? Perhaps the upload script calls save before moving the file to filestore.
You are using anonymous closures as callback handlers, which should work, but harder to follow or debug
My plugin handles the file upload from videojs-record and javascript to php, and the file is saved ($file->save();) to filestore after, it is so strange...
Finally I moved the process to cron.
Thanks Ismayil.