Recherche avancée

Médias (91)

Autres articles (35)

  • Personnaliser en ajoutant son logo, sa bannière ou son image de fond

    5 septembre 2013, par

    Certains thèmes prennent en compte trois éléments de personnalisation : l’ajout d’un logo ; l’ajout d’une bannière l’ajout d’une image de fond ;

  • Ecrire une actualité

    21 juin 2013, par

    Présentez les changements dans votre MédiaSPIP ou les actualités de vos projets sur votre MédiaSPIP grâce à la rubrique actualités.
    Dans le thème par défaut spipeo de MédiaSPIP, les actualités sont affichées en bas de la page principale sous les éditoriaux.
    Vous pouvez personnaliser le formulaire de création d’une actualité.
    Formulaire de création d’une actualité Dans le cas d’un document de type actualité, les champs proposés par défaut sont : Date de publication ( personnaliser la date de publication ) (...)

  • 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

Sur d’autres sites (9671)

  • Unable to probe

    8 mai 2017, par Etson

    I’m using php-ffmpeg on windows with cakephp3, and encountered an issue that says :

    Unable to probe /var/www/blogchild.dev/webroot/uploads/records//Танец довольного теннисиста.mp4

    MultimediaController

    <?php
    namespace App\Controller;

    use App\Controller\AppController;

    class MultimediaController extends AppController
    {

       public function initialize()
       {
           parent::initialize(); // TODO: Change the autogenerated stub
           $this->Auth->allow(['index', 'addvideo']);
           $this->loadModel('Posts');
           $this->loadComponent('File');
           $this->loadComponent('Flash');
           $this->loadComponent('Upload');
       }

       public function addvideo()
       {
           $this->viewBuilder()->template('addvideo');
           $posts = $this->Posts->newEntity();
    //        $posts = $this->MsPosts->find()->toArray();
    //        dump($posts);
    //        die();
           if ($this->request->is('post')) {
               $data = $this->request->data;
               $data['mentor_id'] = '1';
               $data['nbr_of_views'] = '0';
               $data['nbr_of_loves'] = '0';
               $data['nbr_of_smiles'] = '0';
               $data['mentor_id'] = '1';
               $data['child_id'] = '1';

               $post = $this->Posts->patchEntity($posts, $data);
    //            var_dump($data);
    //            die();
    //            debug($this->MsPosts->save($post));die();

    //                $upload = $this->File->uploadFile($this->request->data['file'], $post['id']);
    //                $post->file = $upload['url'];
               if (!empty($this->request->data['file']['name'])) {
                   $path = '/uploads' . DS . 'records' . DS . $post->id;
                   $this->uploadFile($_FILES['file'], $path, $post->id);
                   $post->file = $path . DS . $_FILES['file']['name'];
                   $this->Posts->save($post);
               } else {
                   $this->Posts->save($post);
               }
               $this->Flash->success(__('The post saved'));
               return $this->redirect(['action' => 'addvideo']);

    AppController

    <?php
    /**
    * CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
    * Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
    *
    * Licensed under The MIT License
    * For full copyright and license information, please see the LICENSE.txt
    * Redistributions of files must retain the above copyright notice.
    *
    * @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
    * @link      http://cakephp.org CakePHP(tm) Project
    * @since     0.2.9
    * @license   http://www.opensource.org/licenses/mit-license.php MIT License
    */
    namespace App\Controller;

    use Cake\Controller\Controller;
    use Cake\Event\Event;
    use Cake\Filesystem\Folder;
    use FFMpeg\Coordinate\TimeCode;
    use FFMpeg\FFMpeg;
    use Cake\Controller\Component;
    use Cake\I18n\I18n;

    /**
    * Application Controller
    *
    * Add your application-wide methods in the class below, your controllers
    * will inherit them.
    *
    * @link http://book.cakephp.org/3.0/en/controllers.html#the-app-controller
    */
    class AppController extends Controller
    {


       /**
        * Initialization hook method.
        *
        * Use this method to add common initialization code like loading components.
        *
        * e.g. `$this->loadComponent('Security');`
        *
        * @return void
        */
       public function initialize()
       {

           parent::initialize();

           $this->loadComponent('Cookie');
           $this->loadComponent('RequestHandler');
           $this->loadComponent('Flash');
           $provider = $this->request->query('provider');
           //if ($provider === null) {
           $this->loadComponent('Auth', [
               'authenticate' => [
                   'Form' => [
                       'finder' => 'auth',
                       'fields' => [
                           'username' => 'email',
                           'password' => 'password'
                       ],
                       'loginAction' => [
                           'controller' => 'Auth',
                           'action' => 'login'
                       ],

                       'loginRedirect' => [
                           'controller' => 'Auth',
                           'action' => 'login'
                       ],

                       'logoutRedirect' => [
                           'controller' => 'Auth',
                           'action' => 'login'
                       ]
                   ],
                   'ADmad/HybridAuth.HybridAuth' => [
                       // All keys shown below are defaults
                       'fields' => [
                           'provider' => 'provider',
                           'openid_identifier' => 'openid_identifier',
                           'email' => 'email'

                       ],
                       'profileModel' => 'ADmad/HybridAuth.SocialProfiles',
                       'profileModelFkField' => 'user_id',

                       // The URL Hybridauth lib should redirect to after authentication.
                       // If no value is specified you are redirect to this plugin's
                       // HybridAuthController::authenticated() which handles persisting
                       // user info to AuthComponent and redirection.
                       'hauth_return_to' => null,

                       'loginRedirect' => [
                           'controller' => 'Auth',
                           'action' => 'login'
                       ],

                       'logoutRedirect' => [
                           'controller' => 'Auth',
                           'action' => 'login'
                       ]
                   ],
               ],



           ]);
    //        } else {
    //            $this->loadComponent('Auth', [
    //                'authenticate' => [
    //                    'Form',
    //
    //
    //                ]
    //
    //            ]);
    //        }

       }

       /**
        * Before render callback.
        *
        * @param \Cake\Event\Event $event The beforeRender event.
        * @return void
        */
       public function beforeRender(Event $event)
       {
           if (!array_key_exists('_serialize', $this->viewVars) &&
               in_array($this->response->type(), ['application/json', 'application/xml'])
           ) {
               $this->set('_serialize', true);
           }

           if ($this->request->session()->read('Auth.User')) {
               $this->set('loggedIn', true);
           } else {
               $this->set('loggedIn', false);
           }
       }

       protected function uploadFile(array $file, $path, $postId)
       {
           $objFile = $file;
           $path = $_SERVER['DOCUMENT_ROOT'] . $path;
           //@TODO check file size|Return error
           $folder = new Folder();
           $folder->create($path, 0755);

           move_uploaded_file($objFile['tmp_name'], $path . DS . $objFile['name']);

           $ffmpeg = FFMpeg::create(
               array(
                   'ffmpeg.binaries' => '/usr/bin/ffmpeg',
                   'ffprobe.binaries' => '/usr/bin/ffprobe',
                   'timeout' => 3600, // The timeout for the underlying process
                   'ffmpeg.threads' => 12,   // The number of threads that FFMpeg should use
               )
           );
           $temp = explode('.', $objFile['name']);
           $video = $ffmpeg->open(WWW_ROOT . 'uploads/records' . DS . $postId . DS . $objFile['name']);
           $frame = $video->frame(TimeCode::fromSeconds(1));
           $userPath = 'uploads/records' . DS . $postId . DS . $temp[0] . '.jpg';
           $frame->save(WWW_ROOT . $userPath);
       }

    WARNING !!!!! Help me......
    enter image description here

  • Chrome’s New Audio Notifier

    30 janvier 2014, par Multimedia Mike — General

    Version 32 of Google’s Chrome web browser introduced this nifty feature :


    Chrome audio notifier icon

    When a browser tab has an element that is producing audio, the browser’s tab shows the above audio notification icon to inform the user. I have seen that people have a few questions about this, specifically :

    1. How does this feature work ?
    2. Why wasn’t this done sooner ?
    3. Are other browsers going to follow suit ?

    Short answers : 1) Chrome offers a new plugin API that the Flash Player is now using, as are Chrome’s internal media playing facilities ; 2) this feature was contingent on the new plugin infrastructure mentioned in the previous answer ; 3) other browsers would require the same infrastructure support.

    Longer answers follow…

    Plugin History
    Plugins were originally based on the Netscape Plugin API. This was developed in the early 1990s in order to support embedding PDFs into the Netscape web browser. The NPAPI does things like providing graphics contexts for drawing and input processing, and mediate network requests through the browser’s network facilities.

    What NPAPI doesn’t do is handle audio. In the early-mid 1990s, audio support was not a widespread consideration in the consumer PC arena. Due to the lack of audio API support, if a plugin wanted to play audio, it had to go outside of the plugin framework.


    NPAPI plugin model

    There are a few downsides to this approach :

    So that last item hopefully answers the question of why it has been so difficult for NPAPI-supporting browsers to implement what seems like it would be simple functionality, like implementing a per-tab audio notifier.

    Plugin Future
    Since Google released Chrome in an effort to facilitate advancements on the client side of the internet, they have made numerous efforts to modernize various legacy aspects of web technology. These efforts include the SPDY protocol, Native Client, WebM/WebP, and something call the Pepper Plugin API (PPAPI). This is a more modern take on the classic plugin architecture to supplant the aging NPAPI :


    PPAPI plugin model

    Right away, we see that the job of the plugin writer is greatly simplified. Where was this API years ago when I was writing my API jungle piece ?

    The Linux version of Chrome was apparently the first version that packaged the Pepper version of the Flash Player (doing so fixed an obnoxious bug in the Linux Flash Player interaction with GTK). Now, it looks like Windows and Mac have followed suit. Digging into the Chrome directory on a Windows 7 installation :

    AppData\Local\Google\Chrome\Application[version]\PepperFlash\pepflashplayer.dll

    This directory exists for version 31 as well, which is still hanging around my system.

    So, to re-iterate : Chrome has a new plugin API that plugins use to access the audio API. Chrome knows when the API is accessed and that allows the browser to display the audio notifier on a tab.

    Other Browsers
    What about other browsers ? “Mozilla is not interested in or working on Pepper at this time. See the Chrome Pepper pages.”

  • How to track single-page websites and web applications using Piwik Analytics

    21 février 2017, par InnoCraft — Community, Development

    Single-page websites and web applications have become a standard over the last years. Getting the tracking of such websites and apps right is crucial to your success as you need to ensure the measured data is meaningful and correct. That’s why we, at InnoCraft, help our clients setting up their web tracking and measurement strategy. Some challenges our clients face are the tracking of single-page websites and web applications. We will cover this challenge in this post with a complete example at the bottom.

    Embedding the Tracking Code

    First you need to embed your JavaScript tracking code into your single-page website or web application as usual. To do this go to “Administration” in the top right in your Piwik, click on “Tracking Code” and adjust the tracking code to your needs.

    Tracking a New Page View

    The challenge begins when you need to track a new page view. A single-page app is different from a usual website as there is no regular new page load and Piwik cannot detect automatically when a new page is viewed. This means you need to let Piwik know whenever the URL and the page title changes. You can do this using the methods setCustomUrl and setDocumentTitle like this :

    window.addEventListener('hashchange', function() {
           _paq.push(['setCustomUrl', '/' + window.location.hash.substr(1)']);
           _paq.push(['setDocumentTitle', 'My New Title']);
           _paq.push(['trackPageView']);
    }

    Resetting previously set custom variables

    If you have set any Custom Variables in scope “page”, you need to make sure to delete these custom variables again as they would be attributed to the new page view as well otherwise. The following code requires Piwik 3.0.2 :

    _paq.push(['deleteCustomVariables', 'page']);      
    _paq.push(['trackPageView']);

    Updating the generation time

    Next you need to update the generation time before tracking a new page view. Otherwise, the initial page generation time will be attributed to all of your subsequent pageviews.

    If you don’t load new content from the server when the page changes, simply set the value to zero :

    _paq.push(['setGenerationTimeMs', 0]);
    _paq.push(['trackPageView']);

    In case you load new content from the server, we recommend to measure the time it took to load this content (in milliseconds) and set the needed time :

    _paq.push(['setGenerationTimeMs', timeItTookToLoadPage]);
    _paq.push(['trackPageView']);

    Updating the referrer

    Depending on whether you want to track the previous page as a referrer for the new page view, you should update the referrer URL by setting it to the previous page URL :

    _paq.push(['setReferrerUrl', previousPageUrl]);
    _paq.push(['trackPageView']);

    Making Piwik Aware of New Content

    When you show a new page, your single-page DOM might change as well. For example, you might replace parts of your page with new content that you loaded from your server via Ajax. This means you need to instruct Piwik to scan the DOM for new content. We’ll now go over various content types (Videos & Audio, Forms, Links and Downloads, Content tracking).

    Video and Audio tracking

    If you use the Media Analytics feature to track your videos and audios, whenever a new page is displayed you need to call the following method :

    _paq.push(['MediaAnalytics::scanForMedia', documentOrElement]);

    When you don’t pass any parameter, it will scan the entire DOM for new media. Alternatively, you can pass an element to scan only a certain area of your website or app for new media.

    Form tracking

    If you use the Form Analytics feature to measure the performance of your online forms, whenever a new page is displayed you need to call the following method :

    _paq.push(['FormAnalytics::scanForForms', docuemntOrElement]);

    Where documentOrElement points either to document to re-scan the entire DOM (the default when no parameter is set) or you can pass an element to restrict the re-scan to a specific area.

    Link tracking

    Supposing that you use the link tracking feature to measure outlinks and downloads, Piwik needs to re-scan the entire DOM for newly added links whenever your DOM changes. To make sure Piwik will track such links, call this method :

    _paq.push(['enableLinkTracking']);

    Content tracking

    If you use the Content Tracking feature, whenever a new page is displayed and some parts of your DOM changes, you need to call this method :

    _paq.push(['trackContentImpressionsWithinNode', documentOrElement]);

    Where documentOrElement points either to document or an element similar to the other methods. Piwik will then scan the page for newly added content blocks.

    Measuring Single-Page Apps : Complete Example

    In this example we show how everything works together assuming you want to track a new page whenever a hash changes :

    var currentUrl = location.href;
    window.addEventListener('hashchange', function() {
       _paq.push(['setReferrerUrl', currentUrl]);
        currentUrl = '' + window.location.hash.substr(1);
       _paq.push(['setCustomUrl', currentUrl]);
       _paq.push(['setDocumentTitle', 'My New Title']);

       // remove all previously assigned custom variables, requires Piwik 3.0.2
       _paq.push(['deleteCustomVariables', 'page']);
       _paq.push(['setGenerationTimeMs', 0]);
       _paq.push(['trackPageView']);
       
       // make Piwik aware of newly added content
       var content = document.getElementById('content');
       _paq.push(['MediaAnalytics::scanForMedia', content]);
       _paq.push(['FormAnalytics::scanForForms', content]);
       _paq.push(['trackContentImpressionsWithinNode', content]);
       _paq.push(['enableLinkTracking']);
    });

    Questions ?

    If you have any questions or need help, please get in touch with us. You can find more information about the Piwik JavaScript tracker on the Piwik Developer Zone.