Recherche avancée

Médias (16)

Mot : - Tags -/mp3

Autres articles (54)

  • Les autorisations surchargées par les plugins

    27 avril 2010, par

    Mediaspip core
    autoriser_auteur_modifier() afin que les visiteurs soient capables de modifier leurs informations sur la page d’auteurs

  • Publier sur MédiaSpip

    13 juin 2013

    Puis-je poster des contenus à partir d’une tablette Ipad ?
    Oui, si votre Médiaspip installé est à la version 0.2 ou supérieure. Contacter au besoin l’administrateur de votre MédiaSpip pour le savoir

  • Librairies et binaires spécifiques au traitement vidéo et sonore

    31 janvier 2010, par

    Les logiciels et librairies suivantes sont utilisées par SPIPmotion d’une manière ou d’une autre.
    Binaires obligatoires FFMpeg : encodeur principal, permet de transcoder presque tous les types de fichiers vidéo et sonores dans les formats lisibles sur Internet. CF ce tutoriel pour son installation ; Oggz-tools : outils d’inspection de fichiers ogg ; Mediainfo : récupération d’informations depuis la plupart des formats vidéos et sonores ;
    Binaires complémentaires et facultatifs flvtool2 : (...)

Sur d’autres sites (10109)

  • Building my own FFmpeg for android in Ubuntu 14.04 LTS (Vitamio)

    16 août 2016, par EduardoUstarez

    I am trying to build FFmpeg because I realized that my app doesn’t work for android 6.0 in x86 devices before that I have published my app with targetsdkversion 23 (It has text relocations) and now I can’t publish my app using targetsdkversion 22 (This is the way that I could fix the problem). So I read a lot about this problem It seems there isn’t a solution. Some people say that I can compile ffmpeg using —disable-asm flag and I can solve the problem. I want to generate a libffmeg.so for vitamio that works on x86 android 6.0.

    I am using

    Ubuntu 14.04 LTS

    Android NDK r12b

    And my example project is Vitamio-5.0.2 from Download

    So I am working on this tutorial

    This is my FFmpeg-Android.sh file

    #!/bin/bash

    export ANDROID_NDK=/home/myuser/Downloads/android-ndk-r12b

    DEST=`pwd`/build/ffmpeg && rm -rf $DEST
    SOURCE=`pwd`/ffmpeg

    if [ -d ffmpeg ]; then
     cd ffmpeg
    else
     git clone git://source.ffmpeg.org/ffmpeg.git ffmpeg
     cd ffmpeg
    fi

    git reset --hard
    git clean -f -d
    git checkout `cat ../ffmpeg-version`
    patch -p1 <../FFmpeg-VPlayer.patch
    [ $PIPESTATUS == 0 ] || exit 1

    git log --pretty=format:%H -1 > ../ffmpeg-version

    TOOLCHAIN=$ANDROID_NDK/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86
    SYSROOT=$ANDROID_NDK/platforms/android-14/arch-arm/
    $ANDROID_NDK/build/tools/make-standalone-toolchain.sh --platform=android-14 --install-dir=$TOOLCHAIN

    export PATH=$TOOLCHAIN/bin:$PATH
    export CC="ccache arm-linux-androideabi-gcc"
    export LD=arm-linux-androideabi-ld
    export AR=arm-linux-androideabi-ar

    CFLAGS="-O3 -Wall -mthumb -pipe -fpic -fasm \
     -finline-limit=300 -ffast-math \
     -fstrict-aliasing -Werror=strict-aliasing \
     -fmodulo-sched -fmodulo-sched-allow-regmoves \
     -Wno-psabi -Wa,--noexecstack \
     -D__ARM_ARCH_5__ -D__ARM_ARCH_5E__ -D__ARM_ARCH_5T__ -D__ARM_ARCH_5TE__ \
     -DANDROID -DNDEBUG"

    FFMPEG_FLAGS="--target-os=linux \
     --arch=arm \
     --enable-cross-compile \
     --cross-prefix=arm-linux-androideabi- \
     --enable-shared \
     --enable-static \
     --disable-symver \
     --disable-doc \
     --disable-ffplay \
     --disable-ffmpeg \
     --disable-ffprobe \
     --disable-ffserver \
     --disable-avdevice \
     --disable-avfilter \
     --disable-encoders \
     --disable-muxers \
     --disable-filters \
     --disable-devices \
     --disable-everything \
     --enable-protocols  \
     --enable-parsers \
     --enable-demuxers \
     --enable-decoders \
     --enable-bsfs \
     --enable-network \
     --enable-swscale  \
     --disable-demuxer=sbg \
     --disable-demuxer=dts \
     --disable-parser=dca \
     --disable-decoder=dca \
     --disable-asm \
     --enable-version3"


    for version in neon armv7 vfp armv6; do

     cd $SOURCE

     case $version in
       neon)
         EXTRA_CFLAGS="-march=armv7-a -mfpu=neon -mfloat-abi=softfp -mvectorize-with-neon-quad"
         EXTRA_LDFLAGS="-Wl,--fix-cortex-a8"
         ;;
       armv7)
         EXTRA_CFLAGS="-march=armv7-a -mfpu=vfpv3-d16 -mfloat-abi=softfp"
         EXTRA_LDFLAGS="-Wl,--fix-cortex-a8"
         ;;
       vfp)
         EXTRA_CFLAGS="-march=armv6 -mfpu=vfp -mfloat-abi=softfp"
         EXTRA_LDFLAGS=""
         ;;
       armv6)
         EXTRA_CFLAGS="-march=armv6"
         EXTRA_LDFLAGS=""
         ;;
       *)
         EXTRA_CFLAGS=""
         EXTRA_LDFLAGS=""
         ;;
     esac

     PREFIX="$DEST/$version" && mkdir -p $PREFIX
     FFMPEG_FLAGS="$FFMPEG_FLAGS --prefix=$PREFIX"

     ./configure $FFMPEG_FLAGS --extra-cflags="$CFLAGS $EXTRA_CFLAGS" --extra-ldflags="$EXTRA_LDFLAGS" | tee $PREFIX/configuration.txt
     cp config.* $PREFIX
     [ $PIPESTATUS == 0 ] || exit 1

     make clean
     make -j4 || exit 1
     make install || exit 1

     rm libavcodec/inverse.o
     $CC -lm -lz -shared --sysroot=$SYSROOT -Wl,--no-undefined -Wl,-z,noexecstack $EXTRA_LDFLAGS libavutil/*.o libavutil/arm/*.o libavcodec/*.o libavcodec/arm/*.o libavformat/*.o libswresample/*.o libswscale/*.o -o $PREFIX/libffmpeg.so

     cp $PREFIX/libffmpeg.so $PREFIX/libffmpeg-debug.so
     arm-linux-androideabi-strip --strip-unneeded $PREFIX/libffmpeg.so

    done

    https://www.vitamio.org/en/2013/Tutorial_0509/13.html

    The other files are the same as url provides

    Then the result is

    enter image description here

    I have deleted -Werror=strict-aliasing from CFLAGS and it generates the other .so files less libffmpeg.so

    enter image description here

    The error is in this code line

    $CC -lm -lz -shared --sysroot=$SYSROOT -Wl,--no-undefined -Wl,-z,noexecstack $EXTRA_LDFLAGS libavutil/*.o libavutil/arm/*.o libavcodec/*.o libavcodec/arm/*.o libavformat/*.o libswresample/*.o libswscale/*.o -o $PREFIX/libffmpeg.so

    I have removed ccache from export CC="ccache arm-linux-androideabi-gcc"
    and I have an error

    enter image description here

    I have changed —disable-asm to —enable-asm and I have compiled FFmpeg-Android.sh correctly

    enter image description here

    I copied the libffmpeg.so generated in armv6, armv7, neon and vfp files in my android studio project.

    I don’t know if I copied libffmpeg.so files in the correct place

    armv6 -> arm64-v8a
    armv7 -> armeabi-v7a
    neon  -> x86

    enter image description here

    And the result in Android Studio

    I/Vitamio[5.0.2][Player]: Copyright (c) YIXIA (http://yixia.com).
                             THIS SOFTWARE (Vitamio) IS WORK OF YIXIA (http://yixia.com)
    I/Vitamio[5.0.2][Player]: LOAD FFMPEG START: libffmpeg.so
    E/Vitamio[5.0.2][Player]: FIND_NAME_SYM ffmpeg, av_copy_packet
    E/Vitamio[5.0.2][Player]: FIND_NAME_SYM ffmpeg, avfilter_register_all
    E/Vitamio[5.0.2][Player]: FIND_NAME_SYM ffmpeg, avfilter_uninit
    E/Vitamio[5.0.2][Player]: FIND_NAME_SYM ffmpeg, avfilter_get_by_name
    E/Vitamio[5.0.2][Player]: FIND_NAME_SYM ffmpeg, avfilter_inout_alloc
    E/Vitamio[5.0.2][Player]: FIND_NAME_SYM ffmpeg, avfilter_inout_free
    E/Vitamio[5.0.2][Player]: FIND_NAME_SYM ffmpeg, avfilter_graph_alloc
    E/Vitamio[5.0.2][Player]: FIND_NAME_SYM ffmpeg, avfilter_graph_create_filter
    E/Vitamio[5.0.2][Player]: FIND_NAME_SYM ffmpeg, avfilter_graph_parse
    E/Vitamio[5.0.2][Player]: FIND_NAME_SYM ffmpeg, avfilter_graph_parse2
    E/Vitamio[5.0.2][Player]: FIND_NAME_SYM ffmpeg, avfilter_graph_parse_ptr
    E/Vitamio[5.0.2][Player]: FIND_NAME_SYM ffmpeg, avfilter_graph_config
    E/Vitamio[5.0.2][Player]: FIND_NAME_SYM ffmpeg, av_buffersrc_add_frame
    E/Vitamio[5.0.2][Player]: FIND_NAME_SYM ffmpeg, av_buffersink_get_buffer_ref
    E/Vitamio[5.0.2][Player]: FIND_NAME_SYM ffmpeg, avfilter_unref_bufferp
    E/Vitamio[5.0.2][Player]: FIND_NAME_SYM ffmpeg, avfilter_graph_free
    E/Vitamio[5.0.2][Player]: FIND_NAME_SYM ffmpeg, av_abuffersink_params_alloc
    E/Vitamio[5.0.2][Player]: FIND_NAME_SYM ssl, SSL_shutdown
    E/Vitamio[5.0.2][Player]: FIND_NAME_SYM ssl, SSL_free
    E/Vitamio[5.0.2][Player]: FIND_NAME_SYM ssl, SSL_CTX_free
    E/Vitamio[5.0.2][Player]: FIND_NAME_SYM ssl, SSL_load_error_strings
    E/Vitamio[5.0.2][Player]: FIND_NAME_SYM ssl, SSL_library_init
    E/Vitamio[5.0.2][Player]: FIND_NAME_SYM ssl, SSL_CTX_new
    E/Vitamio[5.0.2][Player]: FIND_NAME_SYM ssl, TLS_client_method
    E/Vitamio[5.0.2][Player]: FIND_NAME_SYM ssl, SSL_new
    E/Vitamio[5.0.2][Player]: FIND_NAME_SYM ssl, SSL_set_fd
    E/Vitamio[5.0.2][Player]: FIND_NAME_SYM ssl, SSL_connect
    E/Vitamio[5.0.2][Player]: FIND_NAME_SYM ssl, SSL_read
    E/Vitamio[5.0.2][Player]: FIND_NAME_SYM ssl, SSL_write
    E/Vitamio[5.0.2][Player]: FIND_NAME_SYM ssl, ERR_print_errors_fp
    I/Vitamio[5.0.2][Player]: LOAD FFMPEG END: libffmpeg.so
    I/Vitamio[5.0.2][Player]: LOAD VVO START: libvvo.9.so
    E/Vitamio[5.0.2][Player]: FIND_NAME_SYM vvo, render_yuv
    I/Vitamio[5.0.2][Player]: LOAD VVO END: libvvo.9.so
    I/Vitamio[5.0.2][Player]: LOAD VAO START: libvao.0.so
    I/Vitamio[5.0.2][Player]: LOAD VAO END: libvao.0.so
    I/Vitamio[5.0.2][Player]: VPLAYER INIT BEGIN
    I/Vitamio[5.0.2][Player]: Application package name: **.*******.******************.*********

                             --------- beginning of crash
    A/libc: Fatal signal 11 (SIGSEGV), code 1, fault addr 0x0 in tid 3334 (ez.**********
    Application terminated.
  • How to create a widget – Introducing the Piwik Platform

    4 septembre 2014, par Thomas Steur — Development

    This is the next post of our blog series where we introduce the capabilities of the Piwik platform (our previous post was How to create a scheduled task in Piwik). This time you’ll learn how to create a new widget. For this tutorial you will need to have basic knowledge of PHP.

    What is a widget in Piwik ?

    Widgets can be added to your dashboards or exported via a URL to embed it on any page. Most widgets in Piwik represent a report but a widget can display anything. For instance a RSS feed of your corporate news. If you prefer to have most of your business relevant data in one dashboard why not display the number of offline sales, the latest stock price, or other key metrics together with your analytics data ?

    Getting started

    In this series of posts, we assume that you have already set up your development environment. If not, visit the Piwik Developer Zone where you’ll find the tutorial Setting up Piwik.

    To summarize the things you have to do to get setup :

    • Install Piwik (for instance via git).
    • Activate the developer mode : ./console development:enable --full.
    • Generate a plugin : ./console generate:plugin --name="MyWidgetPlugin". There should now be a folder plugins/MyWidgetPlugin.
    • And activate the created plugin under Settings => Plugins.

    Let’s start creating a widget

    We start by using the Piwik Console to create a widget template :

    ./console generate:widget

    The command will ask you to enter the name of the plugin the widget should belong to. I will simply use the above chosen plugin name “MyWidgetPlugin”. It will ask you for a widget category as well. You can select any existing category, for instance “Visitors”, “Live !” or “Actions”, or you can define a new category, for instance your company name. There should now be a file plugins/MyWidgetPlugin/Widgets.php which contains already some examples to get you started easily :

    1. class Widgets extends \Piwik\Plugin\Widgets
    2. {
    3.     /**
    4.      * Here you can define the category the widget belongs to. You can reuse any existing widget category or define your own category.
    5.      * @var string
    6.      */
    7.     protected $category = 'ExampleCompany';
    8.  
    9.     /**
    10.      * Here you can add one or multiple widgets. You can add a widget by calling the method "addWidget()" and pass the name of the widget as well as a method name that should be called to render the widget. The method can be defined either directly here in this widget class or in the controller in case you want to reuse the same action for instance in the menu etc.
    11.      */
    12.     protected function init()
    13.     {
    14.         $this->addWidget('Example Widget Name', $method = 'myExampleWidget');
    15.         $this->addWidget('Example Widget 2',    $method = 'myExampleWidget', $params = array('myparam' => 'myvalue'));
    16.     }
    17.  
    18.     /**
    19.      * This method renders a widget as defined in "init()". It's on you how to generate the content of the widget. As long as you return a string everything is fine. You can use for instance a "Piwik\View" to render a twig template. In such a case don't forget to create a twig template (eg. myViewTemplate.twig) in the "templates" directory of your plugin.
    20.      *
    21.      * @return string
    22.      */
    23.     public function myExampleWidget()
    24.     {
    25.         $view = new View('@MyWidgetPlugin/myViewTemplate');
    26.         return $view->render();
    27.     }
    28. }

    Télécharger

    As you might have noticed in the generated template we put emphasis on adding comments to explain you directly how to continue and where to get more information. Ideally this saves you some time and you don’t even have to search for more information on our developer pages. The category is defined in the property $category and can be changed at any time. Starting from Piwik 2.6.0 the generator will directly create a translation key if necessary to make it easy to translate the category into any language. Translations will be a topic in one of our future posts until then you can explore this feature on our Internationalization guide.

    A simple example

    We can define one or multiple widgets in the init method by calling addWidget($widgetName, $methodName). To do so we define the name of a widget which will be seen by your users as well as the name of the method that shall render the widget.

    protected $category = 'Example Company';

    public function init()
    {
       // Registers a widget named 'News' under the category 'Example Company'.
       // The method 'myCorporateNews' will be used to render the widget.
       $this->addWidget('News', $method = 'myCorporateNews');
    }

    public function myCorporateNews()
    {
       return file_get_contents('http://example.com/news');
    }

    This example would display the content of the specified URL within the widget as defined in the method myCorporateNews. It’s on you how to generate the content of the widget. Any string returned by this method will be displayed within the widget. You can use for example a View to render a Twig template. For simplification we are fetching the content from another site. A more complex version would cache this content for faster performance. Caching and views will be covered in one of our future posts as well.

    Example Widget

    Did you know ? To make your life as a developer as stress-free as possible the platform checks whether the registered method actually exists and whether the method is public. If not, Piwik will display a notification in the UI and advice you with the next step.

    Checking permissions

    Often you do not want to have the content of a widget visible to everyone. You can check for permissions by using one of our many convenient methods which all start with \Piwik\Piwik::checkUser*. Just to introduce some of them :

    // Make sure the current user has super user access
    \Piwik\Piwik::checkUserHasSuperUserAccess();

    // Make sure the current user is logged in and not anonymous
    \Piwik\Piwik::checkUserIsNotAnonymous();

    And here is an example how you can use it within your widget :

    public function myCorporateNews()
    {
       // Make sure there is an idSite URL parameter
       $idSite = Common::getRequestVar('idSite', null, 'int');

       // Make sure the user has at least view access for the specified site. This is useful if you want to display data that is related to the specified site.
       Piwik::checkUserHasViewAccess($idSite);

       $siteUrl = \Piwik\Site::getMainUrlFor($idSite);

       return file_get_contents($siteUrl . '/news');
    }

    In case any condition is not met an exception will be thrown and an error message will be presented to the user explaining that he does not have enough permissions. You’ll find the documentation for those methods in the Piwik class reference.

    How to test a widget

    After you have created your widgets you are surely wondering how to test it. First, you should write a unit or integration test which we will cover in one of our future blog posts. Just one hint : You can use the command ./console generate:test to create a test. To manually test a widget you can add a widget to a dashboard or export it.

    Publishing your Plugin on the Marketplace

    In case you want to share your widgets with other Piwik users you can do this by pushing your plugin to a public GitHub repository and creating a tag. Easy as that. Read more about how to distribute a plugin.

    Advanced features

    Isn’t it easy to create a widget ? We never even created a file ! Of course, based on our API design principle “The complexity of our API should never exceed the complexity of your use case.” you can accomplish more if you want : You can clarify parameters that will be passed to your widget, you can create a method in the Controller instead of the Widget class to make the same method also reusable for adding it to the menu, you can assign different categories to different widgets, you can remove any widgets that were added by the Piwik core or other plugins and more.

    Would you like to know more about widgets ? Go to our Widgets class reference in the Piwik Developer Zone.

    If you have any feedback regarding our APIs or our guides in the Developer Zone feel free to send it to us.

  • How to create a widget – Introducing the Piwik Platform

    4 septembre 2014, par Thomas Steur — Development

    This is the next post of our blog series where we introduce the capabilities of the Piwik platform (our previous post was How to create a scheduled task in Piwik). This time you’ll learn how to create a new widget. For this tutorial you will need to have basic knowledge of PHP.

    What is a widget in Piwik ?

    Widgets can be added to your dashboards or exported via a URL to embed it on any page. Most widgets in Piwik represent a report but a widget can display anything. For instance a RSS feed of your corporate news. If you prefer to have most of your business relevant data in one dashboard why not display the number of offline sales, the latest stock price, or other key metrics together with your analytics data ?

    Getting started

    In this series of posts, we assume that you have already set up your development environment. If not, visit the Piwik Developer Zone where you’ll find the tutorial Setting up Piwik.

    To summarize the things you have to do to get setup :

    • Install Piwik (for instance via git).
    • Activate the developer mode : ./console development:enable --full.
    • Generate a plugin : ./console generate:plugin --name="MyWidgetPlugin". There should now be a folder plugins/MyWidgetPlugin.
    • And activate the created plugin under Settings => Plugins.

    Let’s start creating a widget

    We start by using the Piwik Console to create a widget template :

    ./console generate:widget

    The command will ask you to enter the name of the plugin the widget should belong to. I will simply use the above chosen plugin name “MyWidgetPlugin”. It will ask you for a widget category as well. You can select any existing category, for instance “Visitors”, “Live !” or “Actions”, or you can define a new category, for instance your company name. There should now be a file plugins/MyWidgetPlugin/Widgets.php which contains already some examples to get you started easily :

    1. class Widgets extends \Piwik\Plugin\Widgets
    2. {
    3.     /**
    4.      * Here you can define the category the widget belongs to. You can reuse any existing widget category or define your own category.
    5.      * @var string
    6.      */
    7.     protected $category = 'ExampleCompany';
    8.  
    9.     /**
    10.      * Here you can add one or multiple widgets. You can add a widget by calling the method "addWidget()" and pass the name of the widget as well as a method name that should be called to render the widget. The method can be defined either directly here in this widget class or in the controller in case you want to reuse the same action for instance in the menu etc.
    11.      */
    12.     protected function init()
    13.     {
    14.         $this->addWidget('Example Widget Name', $method = 'myExampleWidget');
    15.         $this->addWidget('Example Widget 2',    $method = 'myExampleWidget', $params = array('myparam' => 'myvalue'));
    16.     }
    17.  
    18.     /**
    19.      * This method renders a widget as defined in "init()". It's on you how to generate the content of the widget. As long as you return a string everything is fine. You can use for instance a "Piwik\View" to render a twig template. In such a case don't forget to create a twig template (eg. myViewTemplate.twig) in the "templates" directory of your plugin.
    20.      *
    21.      * @return string
    22.      */
    23.     public function myExampleWidget()
    24.     {
    25.         $view = new View('@MyWidgetPlugin/myViewTemplate');
    26.         return $view->render();
    27.     }
    28. }

    Télécharger

    As you might have noticed in the generated template we put emphasis on adding comments to explain you directly how to continue and where to get more information. Ideally this saves you some time and you don’t even have to search for more information on our developer pages. The category is defined in the property $category and can be changed at any time. Starting from Piwik 2.6.0 the generator will directly create a translation key if necessary to make it easy to translate the category into any language. Translations will be a topic in one of our future posts until then you can explore this feature on our Internationalization guide.

    A simple example

    We can define one or multiple widgets in the init method by calling addWidget($widgetName, $methodName). To do so we define the name of a widget which will be seen by your users as well as the name of the method that shall render the widget.

    protected $category = 'Example Company';

    public function init()
    {
       // Registers a widget named 'News' under the category 'Example Company'.
       // The method 'myCorporateNews' will be used to render the widget.
       $this->addWidget('News', $method = 'myCorporateNews');
    }

    public function myCorporateNews()
    {
       return file_get_contents('http://example.com/news');
    }

    This example would display the content of the specified URL within the widget as defined in the method myCorporateNews. It’s on you how to generate the content of the widget. Any string returned by this method will be displayed within the widget. You can use for example a View to render a Twig template. For simplification we are fetching the content from another site. A more complex version would cache this content for faster performance. Caching and views will be covered in one of our future posts as well.

    Example Widget

    Did you know ? To make your life as a developer as stress-free as possible the platform checks whether the registered method actually exists and whether the method is public. If not, Piwik will display a notification in the UI and advice you with the next step.

    Checking permissions

    Often you do not want to have the content of a widget visible to everyone. You can check for permissions by using one of our many convenient methods which all start with \Piwik\Piwik::checkUser*. Just to introduce some of them :

    // Make sure the current user has super user access
    \Piwik\Piwik::checkUserHasSuperUserAccess();

    // Make sure the current user is logged in and not anonymous
    \Piwik\Piwik::checkUserIsNotAnonymous();

    And here is an example how you can use it within your widget :

    public function myCorporateNews()
    {
       // Make sure there is an idSite URL parameter
       $idSite = Common::getRequestVar('idSite', null, 'int');

       // Make sure the user has at least view access for the specified site. This is useful if you want to display data that is related to the specified site.
       Piwik::checkUserHasViewAccess($idSite);

       $siteUrl = \Piwik\Site::getMainUrlFor($idSite);

       return file_get_contents($siteUrl . '/news');
    }

    In case any condition is not met an exception will be thrown and an error message will be presented to the user explaining that he does not have enough permissions. You’ll find the documentation for those methods in the Piwik class reference.

    How to test a widget

    After you have created your widgets you are surely wondering how to test it. First, you should write a unit or integration test which we will cover in one of our future blog posts. Just one hint : You can use the command ./console generate:test to create a test. To manually test a widget you can add a widget to a dashboard or export it.

    Publishing your Plugin on the Marketplace

    In case you want to share your widgets with other Piwik users you can do this by pushing your plugin to a public GitHub repository and creating a tag. Easy as that. Read more about how to distribute a plugin.

    Advanced features

    Isn’t it easy to create a widget ? We never even created a file ! Of course, based on our API design principle “The complexity of our API should never exceed the complexity of your use case.” you can accomplish more if you want : You can clarify parameters that will be passed to your widget, you can create a method in the Controller instead of the Widget class to make the same method also reusable for adding it to the menu, you can assign different categories to different widgets, you can remove any widgets that were added by the Piwik core or other plugins and more.

    Would you like to know more about widgets ? Go to our Widgets class reference in the Piwik Developer Zone.

    If you have any feedback regarding our APIs or our guides in the Developer Zone feel free to send it to us.