
Recherche avancée
Médias (2)
-
Granite de l’Aber Ildut
9 septembre 2011, par
Mis à jour : Septembre 2011
Langue : français
Type : Texte
-
Géodiversité
9 septembre 2011, par ,
Mis à jour : Août 2018
Langue : français
Type : Texte
Autres articles (68)
-
Websites made with MediaSPIP
2 mai 2011, parThis page lists some websites based on MediaSPIP.
-
Multilang : améliorer l’interface pour les blocs multilingues
18 février 2011, parMultilang est un plugin supplémentaire qui n’est pas activé par défaut lors de l’initialisation de MediaSPIP.
Après son activation, une préconfiguration est mise en place automatiquement par MediaSPIP init permettant à la nouvelle fonctionnalité d’être automatiquement opérationnelle. Il n’est donc pas obligatoire de passer par une étape de configuration pour cela. -
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.
Sur d’autres sites (7184)
-
Revision 36114 : Éviter que les navigateurs gardent en cache les étapes de la mutu ...
11 mars 2010, par kent1@… — LogÉviter que les navigateurs gardent en cache les étapes de la mutu notemment intéressant pour ne pas garder la page http://xxx.domaine.tld/ qui restait en cache (sur FF notemment) après l’installation de SPIP en cliquant sur "visiter"
-
Revision 34657 : lister les plugins non utilises (le glob() est pourri, qui fait mieux)
23 janvier 2010, par fil@… — Loglister les plugins non utilises (le glob() est pourri, qui fait mieux)
-
MJPG video stream does not close
17 janvier 2024, par karlcessI'm using Node.js and React.
In React I have a simple component that is displayed on the screen when a button is clicked. The component is as follows :


import React from 'react'

const Image = () => {
 return <img src="http://stackoverflow.com/api/mjpgStream/stream01" style='max-width: 300px; max-height: 300px' />;
}




Webpack redirects my requests (api=localhost:3456/mjpgStream/stream0).
In node I created an express server that when receiving the GET continuously sends JPEG images with multipart/x-mixed-replace. Below is the code :


const cb: RequestHandler = (req, res) => {
 const url = req.url.toString().slice(1);
 res.writeHead(200, {
 "Content-Type": "multipart/x-mixed-replace;boundary='stream'",
 Connection: "keep-alive",
 Expires: "Fri, 27 May 1977 00:00:00 GMT",
 "Cache-Control": "no-cache, no-store, max-age=0, must-revalidate",
 Pragma: "no-cache",
 });
 let sub = PubSub.subscribe(url, function (msg: any, data: any) {
 res.write("--stream\r\n");
 res.write("Content-Type: image/jpeg\r\n");
 res.write("Content-Length: " + data.length + "\r\n");
 res.write("\r\n");
 res.write(data, "binary");
 res.write("\r\n");
 });

 req.on("close", () => {
 PubSub.unsubscribe(sub);
 res.end();
 });

 res.on("error", function (err) {
 console.error("Error in response:", err);
 });
};

router.get(/\/[a-z,0-9]*/, cb);



The video stream is published in the topic with PubSub and is correctly displayed in the Image component.
The problem is that when I click the button to close the Image component from the web page, the close event is not captured on the express server side and the mjpg flow continues to exist. I can't understand why.