One of the deprecated features of Known is video support. This was build in to the Audio plugin back when it was the Media plugin, but it didn’t really work very well.

The missing component was video transcoding – converting the uploaded video into something that can be played in the browser. This plugin attempts to fill that hole…

Installation

  • Drop VideoTranscode into your IdnoPlugins directory and activate
  • Install ffmpeg sudo apt-get install ffmpeg x264
  • Configure the location of ffmpeg and qt-faststart

Now, when you upload a video, it will be queued and transcoded.

It is strongly recommended that you use the Asynchronous Queue in your Known configuration as this will do the transcoding in the background.

You should also run the service queue as the web server user, so that it can read and write files, e.g.

sudo -u www-data KNOWN_DOMAIN='your.domain' ./known.php service-event-queue

» Visit the project on Github...

A few months ago I wrote a bit about extending your Known plugins to support console functionality. I’ve recently pushed a patch which will make this functionality even more useful.

Previously, you could only have one console command available to your regular Known plugin, this was of course limiting. Now, you can have multiple!

Create a directory Console within your plugin’s home directory. Then fill it with one or more classes, which extend \Idno\Common\ConsolePlugin, one for each command you want to export. The format of this is exactly the same as those for any other console plugin.

Enjoy!

Known has a mechanism for translating text into other languages, and I’ve been working on this recently to try and make this ready for folk to begin adding translations.

When Known boots, it creates a new Language() object on the Idno object for the current language, which is addressable by \Idno\Core\Idno::site()->language();. Your code/plugin can add strings to this object for later use, usually by registering them on the registerTranslations() method hook.

Adding a translation for a language

It is possible to add single strings, one by one, for the current language, however the easiest way to register multiple strings is to extend Idno/Core/Translation for each language you want to translate, and then implement its getStrings() method.

It is then possible to add them all at once for each language (this way, Known will automatically select the appropriate translation for the loaded language).

E.g.

\Idno\Core\Idno::site()->language()->register(new \IdnoPlugins\Example\Languages\English('en'));
\Idno\Core\Idno::site()->language()->register(new \IdnoPlugins\Example\Languages\French('fr'));

Using a translation

Once a string has been registered, it is possible to echo the string, and have it translated:

E.g.

echo \Idno\Core\Idno::site()->language()->_('This is the string to translate');