
Recherche avancée
Médias (1)
-
The Slip - Artworks
26 septembre 2011, par
Mis à jour : Septembre 2011
Langue : English
Type : Texte
Autres articles (65)
-
Des sites réalisés avec MediaSPIP
2 mai 2011, parCette page présente quelques-uns des sites fonctionnant sous MediaSPIP.
Vous pouvez bien entendu ajouter le votre grâce au formulaire en bas de page. -
Support de tous types de médias
10 avril 2011Contrairement à beaucoup de logiciels et autres plate-formes modernes de partage de documents, MediaSPIP a l’ambition de gérer un maximum de formats de documents différents qu’ils soient de type : images (png, gif, jpg, bmp et autres...) ; audio (MP3, Ogg, Wav et autres...) ; vidéo (Avi, MP4, Ogv, mpg, mov, wmv et autres...) ; contenu textuel, code ou autres (open office, microsoft office (tableur, présentation), web (html, css), LaTeX, Google Earth) (...)
-
Use, discuss, criticize
13 avril 2011, parTalk to people directly involved in MediaSPIP’s development, or to people around you who could use MediaSPIP to share, enhance or develop their creative projects.
The bigger the community, the more MediaSPIP’s potential will be explored and the faster the software will evolve.
A discussion list is available for all exchanges between users.
Sur d’autres sites (4510)
-
Generating test data – Introducing the Piwik Platform
9 octobre 2014, par Thomas Steur — DevelopmentThis 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 command). This time you’ll learn how to generate test data.
Developers are developing on their local Piwik instance which usually does not contain useful data compared to a real Piwik installation in production (only a few test visits and a few tests users and websites). The ‘VisitorGenerator’ plugin lets you generate any number of visits, websites, users, goals and more. The generator makes sure there will be data for each report so you can easily test anything.
Getting started
In this series of posts, we assume that you have already installed Piwik. If not, visit the Piwik Developer Zone where you’ll find the Installation guide for developers.
Installing the VisitorGenerator plugin
The easiest way to install the plugin is by using the Marketplace in Piwik itself. It is accessible via Settings => Marketplace => Get new functionality. There you’ll find the plugin “VisitorGenerator” which you can install and activate in one click.
If your Piwik instance is not connected to the internet you can download the plugin from the VisitorGenerator page on the Marketplace. Afterwards you can install the plugin by going to Settings => Marketplace => Uploading a plugin and uploading the previously downloaded ZIP file.
If you have already installed the plugin make sure it is activated by going to Settings => Plugins.
Generating websites
After you have installed the plugin you can add as many websites as you need. This is useful for instance when you want to test something that affects many websites such as the ‘All Websites’ dashboard or the Websites manager. To generate any number of websites use the following command :
./console visitorgenerator:generate-website --limit=10
This will generate 10 websites. If you need more websites simply specify a higher limit. In case you are wondering the names and URLs of the websites are randomly generated by the Faker PHP library.
Generating goals
In case you want to test anything related to Goals you should execute the following command :
./console visitorgenerator:generate-goals --idsite=1
This will generate a few goals for the specified site. The generated goals are defined in a way to make sure there will be conversions when generating the visits in the next step.
Generating visits
To generate visits there are two possibilities. Either via the Piwik UI by going to Settings => Visitor Generator or by using the command line. The UI is a bit limited in generating visits so we recommend to use the command line. There you can generate visits as follows :
./console visitorgenerator:generate-visits --idsite=1
This will generate many different visits for the current day. Don’t worry if it takes a while, it will insert quite a few visits by default.
In case you want to generate visits for multiple days in the past as well you can specify the
--days
option../console visitorgenerator:generate-visits --idsite=1 --days=5
Providing your own logs
Half of the generated visits are randomly generated and half of the visits are based on real logs to make sure there is data for each report. If you want to generate visits based on your own logs for a more realistic testing just place your log files in the
plugins/VisitorGenerator/data
folder and make sure the file name ends with.log
. You can find a few examples in the VisitorGenerator data folder.To generate visits based only on real log files then use the
--no-fake
option../console visitorgenerator:generate-visits --idsite=1 --no-fake
All generated visits will come from the logs and no random visits nor random fake data will be used.
Advanced features
We are regularly adding new commands, tools and runtime checks to make your life as a developer easier. For instance you can also generate users and annotations. In the future we want to extend the plugin to create visits in the background to make sure there will be constantly new actions in the real time report.
Are you missing any kind of generator or any other feature to make your life as a developer easier ? Let us know by email, we are listening !
Would you like to know more about the Piwik platform ? Go to our Piwik Developer Zone where you’ll find guides and references on how to develop plugin and themes.
-
WebM file not seekable in Chrome when loaded through PHP (other browsers work)
13 avril 2014, par ZoonI am having a mind-boggling problem, I just can't seem to resolve.
Providing a WebM file through PHP is nothing new in my world, and I even know how to work with HTTP 206 Partial Content. But for some reason Chrome does not like it.
A simple HTML5 video playback
<video width="640" height="360" poster="picture/preview/V00000006.jpg" controls="controls" preload="preload">
<source type="video/webm" src="/video/V00000006.webm">
</source></video>where
/video/V00000006.webm
is rewritten to a PHP-file in Apache, will playback just fine.
But in Chrome the seekbar is not effective. When clicking on the seekbar the player will freeze and no longer playback until page is refreshed. Firefox handles it just fine !If I change
/video/V00000006.webm
to be a direct link to the same video it works just fine. I even compared the network requests between the two versions (with and without PHP) and there is barely any difference in the first request, but the second is failing in the PHP-delivered video.Initial request and seek request for Apache-delivered video file :
Request URL :http://mytestserver.net/movie1152x720.webm Request Method:GET Status Code:206 Partial Content Request Headers Accept :*/* Accept-Encoding:identity ;q=1, * ;q=0 Accept-Language:da-DK,da ;q=0.8,en-US ;q=0.6,en ;q=0.4 Cache-Control:no-cache Connection:keep-alive Cookie:PHPSESSID=i562540rek172mnv3nk528acj0 ; userPassword= ; userEmail= Host:mytestserver.net Pragma:no-cache Range:bytes=0- Referer :http://mytestserver.net/video.html User-Agent:Mozilla/5.0 (X11 ; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/33.0.1750.146 Safari/537.36 Response Headers Accept-Ranges:bytes Connection:close Content-Length:4446451 Content-Range:bytes 0-4446450/4446451 Content-Type:video/webm Date:Fri, 11 Apr 2014 13:07:30 GMT ETag :"d2d0027-43d8f3-b91417c0" Last-Modified:Fri, 11 Apr 2014 12:46:31 GMT Server:Apache/2.2.3 (CentOS)
—
Request URL :http://mytestserver.net/movie1152x720.webm
Request Method:GET
Status Code:206 Partial Content
Request Headers
Accept :*/*
Accept-Encoding:identity ;q=1, * ;q=0
Accept-Language:da-DK,da ;q=0.8,en-US ;q=0.6,en ;q=0.4
Cache-Control:no-cache
Connection:keep-alive
Cookie:PHPSESSID=i562540rek172mnv3nk528acj0 ; userPassword= ; userEmail=
Host:mytestserver.net
Pragma:no-cache
Range:bytes=4445881-
Referer :http://mytestserver.net/video.html
User-Agent:Mozilla/5.0 (X11 ; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/33.0.1750.146 Safari/537.36
Response Headers
Accept-Ranges:bytes
Connection:close
Content-Length:570
Content-Range:bytes 4445881-4446450/4446451
Content-Type:video/webm
Date:Fri, 11 Apr 2014 13:09:02 GMT
ETag :"d2d0027-43d8f3-b91417c0"
Last-Modified:Fri, 11 Apr 2014 12:46:31 GMT
Server:Apache/2.2.3 (CentOS)Initial request and seek request for PHP-streamed video :
Request URL :http://mytestserver.net/video/V00000006.webm Request Method:GET Status Code:206 Partial Content Request Headers Accept :*/* Accept-Encoding:identity ;q=1, * ;q=0 Accept-Language:da-DK,da ;q=0.8,en-US ;q=0.6,en ;q=0.4 Cache-Control:no-cache Connection:keep-alive Cookie:PHPSESSID=i562540rek172mnv3nk528acj0 ; userPassword= ; userEmail= Host:mytestserver.net Pragma:no-cache Range:bytes=0- Referer :http://mytestserver.net/video.html User-Agent:Mozilla/5.0 (X11 ; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/33.0.1750.146 Safari/537.36 Response Headers Accept-Ranges:bytes Cache-Control:no-store, no-cache, must-revalidate, post-check=0, pre-check=0 Connection:close Content-Length:8566268 Content-Range:bytes 0-8566267/8566268 Content-Type:video/webm Date:Fri, 11 Apr 2014 13:31:27 GMT Expires:Thu, 19 Nov 1981 08:52:00 GMT Pragma:no-cache Server:Apache/2.2.3 (CentOS) X-Powered-By:PHP/5.3.27
—
Request URL :http://mytestserver.net/video/V00000006.webm
Request Headers CAUTION : Provisional headers are shown.
Accept-Encoding:identity ;q=1, * ;q=0
Cache-Control:no-cache
Pragma:no-cache
Range:bytes=4338314-
Referer :http://mytestserver.net/video.html
User-Agent:Mozilla/5.0 (X11 ; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/33.0.1750.146 Safari/537.36Notice how the second request does not complete, Provisional headers are shown.
I have tried altering the cache headers, setting it to the future, setting them blank and using file attachment headers.
I tried fiddling around a lot with the serving code, but lately I have ended up with a simple example.
<?php
$path = 'test.webm';
$size=filesize($path);
$fm=@fopen($path,'rb');
if(!$fm) {
header ("HTTP/1.0 404 Not Found");
die();
}
$begin=0;
$end = $size-1;
if(isset($_SERVER['HTTP_RANGE'])) {
if(preg_match('/bytes=\h*(\d+)-(\d*)[\D.*]?/i', $_SERVER['HTTP_RANGE'], $matches)) {
$begin=intval($matches[0]);
if(!empty($matches[1])) {
$end=intval($matches[1]);
}
}
}
if($begin>0||$end<$size)
header('HTTP/1.0 206 Partial Content');
else
header('HTTP/1.0 200 OK');
header("Content-Type: video/webm");
header('Accept-Ranges: bytes');
header('Content-Length:'.($end-$begin+1));
header("Content-Disposition: inline;");
header("Content-Range: bytes $begin-$end/$size");
header("Content-Transfer-Encoding: binary\n");
header('Connection: close');
ob_get_clean();
flush();
$f = fopen($path, 'r');
fseek($f, $offset);
$pos = 0;
$length = $end-$begin;
while($pos < $length)
{
$chunk = min($length-$pos, 1024);
echo fread($f, $chunk);
flush();
$pos += $chunk;
}
?>Please note, entering the PHP-delivered video URL directly into the browser does not make a difference from showing it in a HTML page.
I hope someone has an answer to why seeking might not work. Let me know if you have any suggestions.
Thanks !
-
WebM file not seekable in Chrome, when generated with ffmpeg
11 avril 2014, par ZoonI am having a mind-boggling problem, I just can't seem to resolve.
Providing a WebM file through PHP is nothing new in my world, and I even know how to work with HTTP 206 Partial Content. But for some reason Chrome does not like it.
A simple HTML5 video playback
<video width="640" height="360" poster="picture/preview/V00000006.jpg" controls="controls" preload="preload">
<source type="video/webm" src="/video/V00000006.webm">
</source></video>where
/video/V00000006.webm
is rewritten to a PHP-file in Apache, will playback just fine.
But in Chrome the seekbar is not effective. When clicking on the seekbar the player will freeze and no longer playback until page is refreshed. Firefox handles it just fine !If I change
/video/V00000006.webm
to be a direct link to the same video it works just fine. I even compared the network requests between the two versions (with and without PHP) and there is barely any difference in the first request, but the second is failing in the PHP-delivered video.Initial request and seek request for Apache-delivered video file :
Request URL :http://mytestserver.net/movie1152x720.webm Request Method:GET Status Code:206 Partial Content Request Headers Accept :*/* Accept-Encoding:identity ;q=1, * ;q=0 Accept-Language:da-DK,da ;q=0.8,en-US ;q=0.6,en ;q=0.4 Cache-Control:no-cache Connection:keep-alive Cookie:PHPSESSID=i562540rek172mnv3nk528acj0 ; userPassword= ; userEmail= Host:mytestserver.net Pragma:no-cache Range:bytes=0- Referer :http://mytestserver.net/video.html User-Agent:Mozilla/5.0 (X11 ; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/33.0.1750.146 Safari/537.36 Response Headers Accept-Ranges:bytes Connection:close Content-Length:4446451 Content-Range:bytes 0-4446450/4446451 Content-Type:video/webm Date:Fri, 11 Apr 2014 13:07:30 GMT ETag :"d2d0027-43d8f3-b91417c0" Last-Modified:Fri, 11 Apr 2014 12:46:31 GMT Server:Apache/2.2.3 (CentOS)
—
Request URL :http://mytestserver.net/movie1152x720.webm
Request Method:GET
Status Code:206 Partial Content
Request Headers
Accept :*/*
Accept-Encoding:identity ;q=1, * ;q=0
Accept-Language:da-DK,da ;q=0.8,en-US ;q=0.6,en ;q=0.4
Cache-Control:no-cache
Connection:keep-alive
Cookie:PHPSESSID=i562540rek172mnv3nk528acj0 ; userPassword= ; userEmail=
Host:mytestserver.net
Pragma:no-cache
Range:bytes=4445881-
Referer :http://mytestserver.net/video.html
User-Agent:Mozilla/5.0 (X11 ; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/33.0.1750.146 Safari/537.36
Response Headers
Accept-Ranges:bytes
Connection:close
Content-Length:570
Content-Range:bytes 4445881-4446450/4446451
Content-Type:video/webm
Date:Fri, 11 Apr 2014 13:09:02 GMT
ETag :"d2d0027-43d8f3-b91417c0"
Last-Modified:Fri, 11 Apr 2014 12:46:31 GMT
Server:Apache/2.2.3 (CentOS)Initial request and seek request for PHP-streamed video :
Request URL :http://mytestserver.net/video/V00000006.webm Request Method:GET Status Code:206 Partial Content Request Headers Accept :*/* Accept-Encoding:identity ;q=1, * ;q=0 Accept-Language:da-DK,da ;q=0.8,en-US ;q=0.6,en ;q=0.4 Cache-Control:no-cache Connection:keep-alive Cookie:PHPSESSID=i562540rek172mnv3nk528acj0 ; userPassword= ; userEmail= Host:mytestserver.net Pragma:no-cache Range:bytes=0- Referer :http://mytestserver.net/video.html User-Agent:Mozilla/5.0 (X11 ; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/33.0.1750.146 Safari/537.36 Response Headers Accept-Ranges:bytes Cache-Control:no-store, no-cache, must-revalidate, post-check=0, pre-check=0 Connection:close Content-Length:8566268 Content-Range:bytes 0-8566267/8566268 Content-Type:video/webm Date:Fri, 11 Apr 2014 13:31:27 GMT Expires:Thu, 19 Nov 1981 08:52:00 GMT Pragma:no-cache Server:Apache/2.2.3 (CentOS) X-Powered-By:PHP/5.3.27
—
Request URL :http://mytestserver.net/video/V00000006.webm
Request Headers CAUTION : Provisional headers are shown.
Accept-Encoding:identity ;q=1, * ;q=0
Cache-Control:no-cache
Pragma:no-cache
Range:bytes=4338314-
Referer :http://mytestserver.net/video.html
User-Agent:Mozilla/5.0 (X11 ; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/33.0.1750.146 Safari/537.36Notice how the second request does not complete, Provisional headers are shown.
I have tried altering the cache headers, setting it to the future, setting them blank and using file attachment headers.
I tried fiddling around a lot with the serving code, but lately I have ended up with a simple example.
<?php
$path = 'test.webm';
$size=filesize($path);
$fm=@fopen($path,'rb');
if(!$fm) {
header ("HTTP/1.0 404 Not Found");
die();
}
$begin=0;
$end = $size-1;
if(isset($_SERVER['HTTP_RANGE'])) {
if(preg_match('/bytes=\h*(\d+)-(\d*)[\D.*]?/i', $_SERVER['HTTP_RANGE'], $matches)) {
$begin=intval($matches[0]);
if(!empty($matches[1])) {
$end=intval($matches[1]);
}
}
}
if($begin>0||$end<$size)
header('HTTP/1.0 206 Partial Content');
else
header('HTTP/1.0 200 OK');
header("Content-Type: video/webm");
header('Accept-Ranges: bytes');
header('Content-Length:'.($end-$begin+1));
header("Content-Disposition: inline;");
header("Content-Range: bytes $begin-$end/$size");
header("Content-Transfer-Encoding: binary\n");
header('Connection: close');
ob_get_clean();
flush();
$f = fopen($path, 'r');
fseek($f, $offset);
$pos = 0;
$length = $end-$begin;
while($pos < $length)
{
$chunk = min($length-$pos, 1024);
echo fread($f, $chunk);
flush();
$pos += $chunk;
}
?>Please note, entering the PHP-delivered video URL directly into the browser does not make a difference from showing it in a HTML page.
I hope someone has an answer to why seeking might not work. Let me know if you have any suggestions.
Thanks !